Skip to main content

Module dxf

Module dxf 

Source
Expand description

DXF: 2D drawings, the interchange the field expects.

Reading takes a drawing’s curves as written (read_dxf_entities: lines, arcs, circles, ellipses, splines, bulged polylines and text, with the units and which layers are dashed), or as polylines (read_dxf).

Writing takes the same entities (write_dxf_entities: R2000, with the unit and named layers), or bare polylines (write_dxf). The polyline writer is R12 ASCII, the most widely readable dialect: a TABLES section declaring the two linetypes and two layers a technical drawing needs, then one POLYLINE per curve. Visible curves go on the VISIBLE layer with continuous lines; hidden curves on HIDDEN, dashed. It takes bare polylines rather than a drawing type, so anything that produces 2D curves (the hidden-line projector, a section outline, a sketch) writes without this crate knowing where they came from.

Structs§

DxfDrawing
The polylines a DXF carries, by the layer they were drawn on.
DxfEntities
A DXF’s drawing entities, typed, with the drawing’s units.
DxfEntity
One entity: the curve, and where it was drawn.
DxfItem
One entity to write, and the layer it goes on.
DxfLabel
A text, and the layer it was drawn on.
DxfLayer
A layer: its name, and whether it draws dashed.
DxfOut
A drawing to write with write_dxf_entities.
DxfText
A line of text: where it sits, how tall, at what angle, and what it says.

Enums§

DxfCurve
A DXF curve in the drawing’s plane.
DxfShape
What an item draws.
DxfUnit
The unit a drawing’s lengths are in, written as $INSUNITS.

Functions§

read_dxf
Read the polylines out of an ASCII DXF.
read_dxf_entities
Read the typed entities, the units and the layers’ linetypes out of an ASCII DXF.
write_dxf
Write polylines as an R12 DXF document.
write_dxf_entities
Write a drawing as an R2000 (AC1015) ASCII DXF, each entity as itself.