Provenance
cadkit is a clean-room implementation. This ledger records every source of format knowledge. Contributors add a row when they rely on a new source.
Allowed sources
Section titled “Allowed sources”| Source | License | Used for |
|---|---|---|
| Open Design Alliance, Open Design Specification for .dwg files v5.4.1 | Public document (not redistributed; fetched into refs/) |
DWG container, bit codes, objects |
| ACadSharp | MIT | DWG/DXF cross-check, sample files |
| ezdgn | MIT | DGN V8 format notes cross-check |
GDAL frmts/dgn (dgnlib) and autotest data |
MIT/X | DGN V7 structure, sample files, V8 reference CSV |
| ezdxf | MIT | DXF structure cross-check; dev-time validator (audit) of written DXF and reader comparison — not a runtime dependency |
| Autodesk DXF Reference (public documentation) | Public document | DXF group codes per entity |
| [MS-CFB] Compound File Binary File Format and [MS-OLEPS] Object Linking and Embedding (OLE) Property Set Data Structures (public Microsoft open specifications, learn.microsoft.com) | Open specification | CFB container; directory entry layout and stream entry times (2.6.1), free entry form (2.6.3 “Other Directory Entries”), sibling tree order and colours (2.6.4 “Red-Black Tree”), the root entry’s zero creation time (2.6.1); property set streams: PropertySetStream (2.21), PropertySet (2.20), TypedPropertyValue (2.15), CodePageString (2.5), UnicodeString (2.7), FILETIME, the Summary Information (2.25.1, property types) and Document Summary Information property sets and their property ids |
| Adobe, TIFF Revision 6.0 (public specification, 1992), Part 1 “Baseline TIFF” | Public document | The synthetic 1-bit image of the DGN acceptance kit (crates/cadkit/examples/support/acceptance_kit.rs): header, IFD entry layout, bilevel tags; not used by any library crate |
| Public issue reports #24–#30 | — | DGN reader corrections (structural descriptions only; see “Attributions”) |
| Top-down 2-3-4 red-black tree insertion: L. J. Guibas and R. Sedgewick, “A dichromatic framework for balanced trees” (FOCS 1978), and R. Sedgewick, Algorithms (public literature) | Published algorithm | The sibling tree shape the DGN writer builds and check_structure compares (cfb_tree::top_down_shape) |
| Own hex analysis of public and private corpus files | — | All formats |
Excluded sources
Section titled “Excluded sources”LibreDWG, libdxfrw, LibreCAD, QCAD and any other GPL/LGPL/AGPL code; ODA SDK headers, binaries or wrappers; decompiled vendor code; Autodesk/Bentley SDKs.
Test corpus
Section titled “Test corpus”Fetched by scripts/fetch-corpus.py into corpus/public/ (not committed):
- ACadSharp
samples/— one drawing saved as DWG AC1014…AC1032 plus ASCII/binary DXF. - GDAL
autotest/ogr/data/dgnanddgnv8— DGN V7 and V8 samples, V8 reference CSV; GDALogr/ogrsf_frmts/dgn/data/seed_{2d,3d}.dgn. - Apache Tika
tika-parser-cad-moduletest documents (Apache-2.0) — 19 DWG files AC1015…AC1032 for structure-only validation. - Safe Software public support-article attachments (
TreeTextNodeLabelsWithTags.dgn,Water_distribution_mains.dgn) — public downloads without an explicit license: fetched for local testing only, never redistributed.
Private client drawings in corpus/private/ are used only for local, structural tests.
Attributions
Section titled “Attributions”cadkit-dwg: R2007 (AC1021) LZ77 decompressor ported from ACadSharpDwgLZ77AC21Decompressor.cs(MIT, © DomCR); R2007 container read flow follows ACadSharpDwgReader.cs. Spec errata found during implementation are listed indocs/dwg/FORMAT_NOTES.md.cadkit-dgn: default 256-color DGN palette ported from GDAL dgnlibabyDefaultPCT(MIT/X) →src/palette.rs; V7 element layouts, TCB, tag set/tag value layouts follow GDAL dgnlib; V7 description-length rule and shared-cell offsets from ezdgn (MIT) →src/native/v7.rs; V8 model-header search from ezdgn →src/native/v8.rs. Full source table indocs/dgn/FORMAT_NOTES.md.cadkit-dgn(issues #24–#30): type 11 curve end tangents follow the slope formula of GDAL dgnlibDGNStrokeCurve(ogr/ogrsf_frmts/dgn/dgnstroke.cpp, MIT/X) →map::curve_end_tangents; the rule that a complex chain/shape owns plain components rests on GDAL dgnlibDGNCreateComplexHeaderFromGroup(dgnwrite.cpp) and the complex-header child loop ofogrdgnlayer.cpp(MIT/X) plus own structural counts of the public and private corpus; V7’s property bit0x0080is left uninterpreted because GDAL’sDGNPF_*flags (dgnlib.h) define none; theff fe 01 00marker in string linkages is the one ezdgn documents (docs/v8/FORMAT_NOTES.md, MIT). Theff febyte-order-mark names, hidden graphics, 2D tag angles and chain-in-chain nesting are taken from the public issue reports (structural descriptions only); tests use invented records. No other external implementation was consulted.cadkit-dgnstructural report and writer fidelity (0.5.3): the free directory entry form and the red-black rules follow the public [MS-CFB] sections 2.6.3 and 2.6.4; the insertion that builds the top-down 2-3-4 shape is the published algorithm in the sources table; the CFB name order’s case conversion matches thecfbcrate (MIT)compare_names(src/internal/path.rsand its exception tableuppercase.txt, extracted from ICU data), restated as rules incfb_tree::cfb_upperwithout copying the table; that most observed trees have the top-down shape, slot orders, page header fields, the model header prefix counter, level sentinels and font table duplicates are own structural counts over the public and private corpus (counts only). Tests use invented names and synthetic records. No external implementation was consulted.cadkit-dgnlevel colors and text lengths (0.5.3): the level color index at0x48of 240-byte level entries, the raw weight/style fields, the V8 text length taken from the element range and the property-word observations (0x0800point layout,0x8000,0x1000, type 36, model header type words) are own structural counts over the public and private corpus (counts only). Tests use invented names and synthetic records. No external implementation was consulted.cadkit-dgnseed stripping (0.5.3): the minimal property set streams follow the public [MS-OLEPS] structures named in the sources table, with the values observed in the three public V8 samples (code page 1200, system identifier0x00020005) and the application name typed as [MS-OLEPS] 2.25.1 specifies (VT_LPSTR; the samples storeVT_LPWSTR); the decision which control records to keep rests on own structural scans of the public and private corpus (record types, in-record offsets and value equality across files, counts only); the container builder reuses the writer’s [MS-CFB] directory rules; the per-record-kind decisions, the time fields (Dgn~H0x130, model header0x18/0x88, model index+8) and the model index entry layout are own structural counts over the public and private corpus (counts only). Tests use invented names and synthetic records. No external implementation was consulted.cadkit-core: ACI color table from ACadSharpColor.cs(MIT), entries 250–254 corrected to the published AutoCAD greys; DOS/OEM single-byte high-half (0x80..=0xFF) character tables (CP437,CP850,CP852,CP855,CP857,CP860,CP861,CP863,CP864,CP865,CP869) from the Unicode Consortium Public Mapping tables (PUBLIC/MAPPINGS/VENDORS/MICSFT/PC/, Unicode License v3) →src/text.rs.
CityGML and DGN writing additions
Section titled “CityGML and DGN writing additions”- OGC CityGML 2.0, OGC 12-019
and official OGC schemas: namespaces,
feature/property ordering, geometry, generic attributes and XSD validation.
Schema license/copyright notices remain in the downloaded files; they are not
redistributed. OGC’s
citygml/xAL/xAL.xsdsupplies the catalog mapping for the legacy OASIS import. Cache manifest records source URLs and SHA-256 digests. - quick-xml 0.41.0, MIT: bounded XML reading/writing dependency, Rust 1.79 minimum, compatible with the workspace’s Rust 1.88. The 0.41 series was selected when the workspace supported Rust 1.85; this geometry addition does not change the XML dependency.
- rust-cfb / cfb 0.14, MIT:
pure Rust CFB writing and independent strict-container validation. Rust 1.74
minimum; WASM compilation was checked. No vendor SDK is used. The
cadkitfacade uses the same workspace version as a dev-dependency only, for the strict open of the acceptance kit (example and its test). - DGN V8 record encoders follow cadkit’s existing attributed native decoders and own public/private corpus analysis. The public GDAL V8 sample and its checked-in reference CSV are test data; no ODA SDK or V8 driver implementation was used.
- DGN rotation and duplicate-level export regressions use invented geometry and
synthetic level records. Quaternion storage follows the existing attributed
Rotation::matrixconvention; neutral level naming is shared by the reader and writer. No additional external implementation was consulted for these fixes. - DGN text alignment, standalone tags and raster retention follow the same
existing native decoders and own structural corpus analysis. Raster control
records and auxiliary payloads are retained, not reconstructed from guessed
fields. New regression fixtures contain invented records only. Bulged-polyline
decomposition uses the analytic
tan(sweep / 4)convention already documented by cadkit-core; no additional external implementation was consulted. - DGN raster frame placement and new raster attachments (0.3.1) rest on own structural hex analysis of the private corpus only (record sizes, subtypes, field variation between attachments, cross ids, XAttribute 170 framing). New attachments copy a seed attachment and rewrite only the fields that analysis identified; tests use invented records. No external implementation was consulted.
- The blank seed analysis (
docs/dgn/FORMAT_NOTES.md, “Built-in blank seed”;tests/blank_seed_evidence.rs) is own byte comparison of the public GDALtest_dgnv8.dgn(ODA-written) and the two Safe Software samples (MicroStation-written), with structural counts over the private corpus (equal / not equal, distinct-value counts; no names, values or coordinates copied); ezdgn’s V8 notes (MIT) were checked and decode none of the differing fields. Nothing was embedded: no bytes of a third-party template or of any sample are in the sources, and no built-in seed exists. cadkit-corewriter preflight (validate_limits) validates object, vertex, nesting, string, finite-float, and byte budgets directly on the in-memoryDocumentAST without extra dependencies.- DGN V8 type-17 range writing uses own byte inspection of the existing public GDAL and Safe Software samples: low slots are absolute UOR bounds and high slots are relative spans (0.3.0 found the same extent rule for every graphic type, see below). Rotated measured rectangles and model/cell aggregate bounds are tested with invented geometry and synthetic records. Seed font identity checks and native lineweight resolution use the existing attributed decoders; no additional external implementation was consulted.
- DGN V8 range, string-length, displayed-tag and control-retention changes (0.3.0) come
from own byte inspection: every line, line string and shape of the public GDAL
test_dgnv8.dgn(ODA-written) stores the low corner and the extent, as do all records of the Water sample and structural counts over the private corpus (MicroStation 8.11 files). The displayed-tag layout, the code page linkage bytes and the 56-byte tag target dependency are aggregate structural observations of the private corpus (offsets, constants and counts only; no names, values or coordinates were copied). Tests use invented geometry and synthetic records; the public sample only calibrates the range reading. No external implementation was consulted. - The default polygon planarity tolerance (0.01 coordinate units) matches the documented default distance-to-plane tolerance of the val3dity validator. Only that public parameter value was used; no val3dity code was read or ported. The planarity measurements behind it come from own analysis of private CityGML files.
Private source files and derived drawing data are not copied into the repository,
examples, schema cache or acceptance kit. The kit uses public and synthetic data: the
DGN acceptance kit (crates/cadkit/examples/interchange.rs, docs/dgn/ACCEPTANCE.md)
writes invented names, texts, tag values and coordinates into GDAL’s public
test_dgnv8.dgn (MIT/X); nothing in it is derived from the Safe Software samples or the
private corpus. Its read-back comparison, structure check and TIFF writer are original
code; no external implementation was consulted.
External vendor application and receiving-system acceptance remain untested.
Generic GML export and TKGM local preflight
Section titled “Generic GML export and TKGM local preflight”- OGC GML 3.1.1 geometryPrimitives.xsd: public Circle/ArcString layout, three distinct non-collinear circle positions, fixed circularArc3Points interpolation and numArc=1. Circumcenter arithmetic was written from the mathematical construction, using existing cadkit vector helpers. No external CAD implementation was consulted.
- TKGM Digital Building production guide, retrieved 2026-10-01: local registration field/type, object-role, coordinate system and reference checks. The guide’s revision list ends at TKGMCityGML 3.0.3 (2025-03-19), using OGC CityGML 2.0. Public examples exposed ambiguities in buildingHeight and propertyLot typing; these remain explicit unchecked rules. Downloaded public examples were inspected in memory only. Nothing from private field values was used to construct the rule tables or regression fixtures.
- Conversion reports, application new/edit/reopen tests and strict-versus-metadata policy are original cadkit code. No new Rust dependency was introduced. Existing pytest and lxml test tooling was used locally; neither is a library dependency.
TKGM architectural city-model tender preflight (2026-10-01)
Section titled “TKGM architectural city-model tender preflight (2026-10-01)”The optional workflow-specific common checks use only the public TKGM production guide, particularly architectural fields, storeys, independent sections, common areas, LoD requirements, MAKS conditions, and revision history. Retrieved 2026-10-01; latest listed revision v2.50 (2025-05-06). These public field/type/reference rules are implemented independently; no validator binaries, vendor SDKs or third-party CAD implementation were consulted. Conditional tender rules are listed as unchecked instead of being replaced by registration defaults. Tests use invented identifiers/values. No dependencies were added.
Independent analytic geometry
Section titled “Independent analytic geometry”cadkit-geom was transferred by file copy, without Git history, from an internal
closed-source geometry library owned by the same owner, TNYCL. The owner authorized
relicensing under MIT OR Apache-2.0. Only the standalone analytic geometry source
and synthetic tests were transferred; no application data, format seeds, private
corpus files, proprietary SDKs or application models are included. English comments,
diagnostics and schema descriptions replace the original language. Public data
structures, algorithmic conventions and numerical budgets are retained.
The source implements analytic constructions, least-squares calibration, de Casteljau evaluation, knot insertion, and outward-rounded interval bounds. No GPL/LGPL/AGPL-derived implementation was found in the reviewed source, and none was consulted for this transfer. The explicit boolean dependency is not replaced with copied third-party code.
| Geometry dependency | License | Purpose |
|---|---|---|
serde / serde_derive |
MIT OR Apache-2.0 | Persistent data serialization |
thiserror / thiserror-impl |
MIT OR Apache-2.0 | Typed error display |
schemars / schemars_derive 1.x (optional) |
MIT | JSON Schema generation |
i_overlay 9.0.0 |
MIT OR Apache-2.0 | Integer polygon overlay and slicing; requires Rust 1.88 |
robust 1.2.0 |
MIT OR Apache-2.0 | Adaptive orientation predicate |
i_float, i_shape, i_tree, i_key_sort (transitive) |
MIT | Integer geometry and overlay support |
serde_json (tests; also used by optional schemas) |
MIT OR Apache-2.0 | Serialization regression checks |
Upstream crate license files are retained in their registry packages; the workspace license checker audits the resolved dependency graph. Geometry contracts and numerical guarantees are documented in geom/NOTES.md.