Skip to content

0.4.0: hatch, leader, identity, dimensions, block expansion, extrusion

Latest

Choose a tag to compare

@gsdali gsdali released this 12 Nov 23:34
babcfeb

New

  • Entity identity: DXF.Identity (the handle, group 5, plus a locator such as ENTITIES:12) on every entity, block, layer, line type and dimension style (#25).
  • DXF.Entity.hatch and .leader, with boundary paths, pattern and arrowhead; LAYER and LTYPE tables and effectiveLineType(ofEntityAt:) (#24).
  • Dimensions: rotation, obliqueAngle, styleName, style overrides, DIMSTYLE precision, and computedMeasurement for linear, aligned, radius and diameter. measurement is nil when the file stores zero or a negative value (#23).
  • entity.fitted(tolerance:) and drawing.fittedCurve(at:tolerance:) fit a single SPLINE or ELLIPSE to lines and arcs, with the deviation measured against the exact curve (#26).
  • Block references: ReadOptions(expandBlocks:) flattens INSERT (nested blocks, scale, rotation, mirroring, arrays) and skipPaperSpace leaves out paper-space entities, matching ezdxf's modelspace(). Drawing.references, Drawing.warnings, Drawing.paperSpace; dxfdump --expand and --skip-paper-space (#5).
  • Extrusion: ARC, CIRCLE, LWPOLYLINE, 2D POLYLINE, TEXT, HATCH, ELLIPSE and a dimension's text point are read in their object coordinate system and returned as world geometry. LWPOLYLINE vertices carry the elevation (group 38) as z (#21).

Source-breaking: DXF.Entity gains .hatch and .leader, so an exhaustive switch without a default needs updating. Dimension.measurement is nil where it returned -1. Entities on a -z plane now come back mirrored into the world, so a drawing that relied on the old coordinates moves. "Upgrading from 0.3" in the README lists every change.

Known limits: a tilted extrusion (not along z) is read as written and reported as a warning; angular and ordinate dimensions have no computed value; expansion stops after about two million entities and says so. The mirrored-dimension rotation was checked against ezdxf on a generated fixture, not on an AutoCAD-written drawing.