Skip to main content

write_dxf_entities

Function write_dxf_entities 

Source
pub fn write_dxf_entities(drawing: &DxfOut<'_>) -> OgeomResult<String>
Expand description

Write a drawing as an R2000 (AC1015) ASCII DXF, each entity as itself.

Lines, arcs, circles, ellipses, LWPOLYLINEs with their bulges, splines and TEXT, on named layers, with the unit as $INSUNITS. Coordinates are written in their shortest exact form, so read_dxf_entities reads back the same numbers; angles go out in degrees, as the format has them. A spline with no knots is written by its fit points, as the reader returns one. Text outside printable ASCII is written as \U+XXXX escapes, as are a backslash, the first % of %%, and spaces at either end, so that the string reads back as given in any code page.

§Errors

OgeomError::Construction if a layer’s name is not one DXF allows or two names match ignoring case, an item names no layer, a number is not finite, a radius, a text height or a spline weight is not positive, an ellipse’s major axis is zero or its ratio outside (0, 1], a polyline has fewer than two vertices or a bulge per vertex, a spline’s knots do not number its control points plus its order or decrease, or a text holds a control character or a character outside the Basic Multilingual Plane.