Expand description
Format-neutral drawing model.
Every reader (DWG, DGN, DXF) produces a Document. The model keeps the
common CAD semantics typed and pushes format-specific details into
Props under a format prefix (dgn., dwg., dxf.), so nothing a
reader understood is thrown away.
Conventions:
- Coordinates are in drawing units (see
Units); DGN UORs are already converted to master units. - Every point and vector is in world coordinates (WCS). Readers convert DWG/DXF object coordinates (OCS) to WCS; there is no OCS in this model.
- Planar entities carry a
normalthat defines their plane. Angles (arc start/end, text/insert rotation, hatch pattern angle) are radians, counter-clockwise about that normal, measured from the plane’s X axis as given by the DXF arbitrary-axis algorithm (geom_ops::arbitrary_axes). Fornormal = +Zthis is the ordinary world X axis. - Ordered point lists (polyline vertices, face corners, hatch edges) are in
outline order. Readers fix format quirks such as DXF
SOLIDstoring corners 3 and 4 swapped. - Entities reference layers, blocks, linetypes and text styles by name.
Structs§
- Attribute
- Non-graphic data attached to an entity (DWG ATTRIB, DGN tag, item-type property).
- Attribute
Display - Text presentation of a displayed attribute value.
- Block
- A block definition (DGN: shared cell definition).
- Document
- A complete drawing.
- Entity
- One drawn object.
- Hatch
Loop - One hatch boundary loop.
- Layer
- A layer (DGN: level).
- Linetype
- A linetype definition.
- Model
- A space that holds drawn entities: model space, a paper-space layout or a DGN model.
- Raw
- Original bytes of a record, for lossless inspection.
- Schema
Version - Version of the
DocumentJSON layout, serialized as the integerschema_version. - Source
Info - Origin of a
Document. - Summary
- Lightweight header summary returned by header-only
inspectroutines without decoding entity streams. - Text
Style - A text style definition.
- Units
- Drawing units.
- Vertex
- Polyline vertex.
- Warning
- A recoverable problem found while reading.
Enums§
- Attachment
- Multi-line text attachment point.
- Color
- Color.
- Dimension
Type - Dimension kind.
- Entity
Kind - Geometry and type-specific data of an
Entity. - Format
- File format family.
- Group
Kind - What a
EntityKind::Grouprepresents. - HAlign
- Horizontal text alignment.
- Hatch
Edge - A hatch boundary edge.
- Length
Unit - Length unit. Mirrors the DWG
$INSUNITSset. - Lineweight
- Line weight.
- Model
Kind - Kind of
Model. - VAlign
- Vertical text alignment.
- Value
- A loosely typed value for attributes and props.
Type Aliases§
- Props
- Format-specific extra data, keyed
"<format>.<name>"(e.g."dgn.level_id").