Skip to main content

Module model

Module model 

Source
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 normal that 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). For normal = +Z this 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 SOLID storing 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).
AttributeDisplay
Text presentation of a displayed attribute value.
Block
A block definition (DGN: shared cell definition).
Document
A complete drawing.
Entity
One drawn object.
HatchLoop
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.
SchemaVersion
Version of the Document JSON layout, serialized as the integer schema_version.
SourceInfo
Origin of a Document.
Summary
Lightweight header summary returned by header-only inspect routines without decoding entity streams.
TextStyle
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.
DimensionType
Dimension kind.
EntityKind
Geometry and type-specific data of an Entity.
Format
File format family.
GroupKind
What a EntityKind::Group represents.
HAlign
Horizontal text alignment.
HatchEdge
A hatch boundary edge.
LengthUnit
Length unit. Mirrors the DWG $INSUNITS set.
Lineweight
Line weight.
ModelKind
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").