Skip to content

v1.37.1-beta.7: drawing read tools on SwiftDXF 0.3.0

Pre-release
Pre-release

Choose a tag to compare

@gsdali gsdali released this 13 Nov 07:46
990c468

Pre-release. Pinned exactly to OCCTSwift 4.0.0-beta.6, with OCCTSwiftMesh 1.7.6-beta.4, OCCTSwiftScripts 1.7.1-beta.4, OCCTSwiftInteraction 3.0.0-beta.6 and OCCTSwiftIO 2.0.0-beta.5, and SwiftDXF held on the 0.3 line. A consumer only gets this by naming it. 83 tools in the Swift server.

The drawing read tools support SwiftDXF 0.3.0 (#263).

  • A SPLINE is an entity. list_drawing_entities returns a spline record with degree, closed, periodic, rational and, as stored in the file, controlPoints, knots, weights and fitPoints (each left out when the file has none), and spline is a valid types filter. Its bounds follow the curve, not its control polygon.
  • measure_drawing measures to a spline. When the control data defines a curve it is an exact NURBS edge (rational or not, clamped or unclamped). When it does not (fit points only, a knot vector OCCT refuses, a degree above OCCT's 25, a closed spline whose curve's ends do not meet) it is cut into chords within a stated tolerance and the result says so in notes.
  • read_drawing reports what SwiftDXF skipped from SwiftDXF's own report, so a spline is no longer counted as skipped as well as read.
  • Every drawing tool's source now names the SwiftDXF release line (readerVersion, 0.3), because entity ids (e<index>) shift when a newer reader models more types.

Why SwiftDXF is held on the 0.3 line. OCCTSwiftIO 2.0.0-beta.5 requires SwiftDXF 0.3.0 but its floor admits 0.4.0 (released 2026-11-12), which adds DXF.Entity.hatch and .leader and stops OCCTSwiftIO's DXFLoader compiling (SecondMouseAU/OCCTSwiftIO#60). Package.swift now declares SwiftDXF directly, .upToNextMinor(from: "0.3.0"), so a resolve gives 0.3.0. A host that embeds OCCTMCPCore gets the same constraint, which would conflict with a host that wants SwiftDXF 0.4 itself. Adopting 0.4.0 (entity handles, hatch and leader, computed dimension values, block expansion) and dropping the cap is #271.

Behaviour changes worth reading.

  • In a file with a spline, the ids after it are one higher than before: the spline takes an index. source.readerVersion and the SHA-256 tell a caller when ids no longer mean what they did.
  • read_drawing now reports an INSERT's ATTRIB records as skipped entities of their own, because that is how SwiftDXF counts them. A title block with 12 attributes shows 13 skipped, where the raw scan counted one.
  • A spline record has no length, unlike line, arc and polyline.

Test-only. The slow-observer test no longer times the result against a wall-clock bound, which failed once on a loaded CI runner (#268). The observer is held shut and the result must arrive anyway.

Not in this release. DWG and JWW are still not read (SecondMouseAU/OCCTSwiftIO#53 and #54). The spline support is tested on hand-built DXF fixtures and a hand-written file over stdio; it has not been run against a CAD-written drawing.