Skip to content

Releases

v0.5.3

Choose a tag to compare

@github-actions github-actions released this 16 Nov 00:58
b85da78

Added

  • WASM CadDocument.pickEntityBounded caps inspection metadata before copying
    and JSON conversion, reports shortened previews, omits raw properties and
    rejects exhausted output/work budgets. Legacy pickEntity remains compatible
    and now copies metadata only after selecting the winning entity.
  • cadkit_dgn::check_structure (also native::structure, and cadkit::dgn::check_structure
    through the facade) returns a StructureReport of a DGN V8 file without the write
    feature: sibling trees that are ordered red-black trees and that have the writer's
    top-down shape, unused directory slots outside the MS-CFB free form, the writer's slot
    order, pages with a page number or population, records without a time and split
    dictionary pages, with the stable warning codes dgn.cfb_tree_unordered,
    dgn.cfb_tree_unbalanced, dgn.cfb_tree_shared (a sibling tree reaching entries another
    storage's tree holds; analysed once, so the work stays proportional to the directory),
    dgn.cfb_free_entry, dgn.record_time, dgn.dictionary_page_split and
    dgn.model_page_counter. CLI: cadkit check-dgn file.dgn prints it as JSON (exit 1 when
    it has warnings). Not exposed in Python, WASM or C.
  • cadkit_dgn::strip_seed_v8 (facade cadkit::strip_dgn_seed) copies a single-model DGN V8
    seed without the drawing content of its model and without the document properties that
    name people or organisations, for use as the seed of write_v8: graphic records and
    their XAttributes go, so do by default the model's control records (model settings,
    model-level tag sets, raster groups) and every property set stream, replaced by a
    \u{5}SummaryInformation with code page, application and times only and a
    \u{5}DocumentSummaryInformation with the code page only. The dictionary (levels, fonts,
    colour table, tag sets, text styles, views, settings, cell definitions), units and
    undecoded streams stay byte for byte; the file header and model times are normalised from
    StripSeedOptions::timestamp_ms and the container is built anew (storages carry that
    time, the root entry its modification time only, as MS-CFB 2.6.1 requires), so no byte of
    a removed stream stays in free space. The application name is written as VT_LPSTR, the
    type MS-OLEPS 2.25.1 gives PIDSI_APPNAME (the observed files store VT_LPWSTR; the
    reader reads both). StripSeedOptions (keep_controls, keep_raster_template,
    keep_cell_definitions, model_name, timestamp_ms, application; JSON with
    defaults, unknown fields rejected) and the returned StrippedSeed / StripSeedReport,
    which counts what was removed and what remains that may identify the source (named
    levels, tag sets, cell definitions, model name and description, kept controls, raster
    file references, undecoded streams). The result is not anonymous: names in the kept tables remain and must
    be reviewed. Equal input and options give equal bytes; stripping a result again changes
    nothing. Bindings: CLI cadkit strip-seed in.dgn out.dgn [--keep-controls] [--keep-raster-template] [--drop-cell-definitions] [--model-name NAME] [--timestamp-ms MS] [--application NAME] [--report] (refuses to overwrite its input, also through a symbolic
    link or, on Unix, a hard link), Python
    cadkit.strip_dgn_seed(seed, **options) -> (bytes, dict), WASM
    stripDgnSeed(seed, options?, readOptions?) -> { seed, report }, C
    cadkit_dgn_strip_seed (seed bytes via cadkit_bytes_free, report JSON via
    cadkit_string_free) and C++ cadkit::strip_dgn_seed. No stripped seed has been opened
    in another application.
  • Attribute::color and Attribute::lineweight (optional, with with_color /
    with_lineweight): the attribute record's own symbology when it differs from the
    owning entity's; None means the owner's. The DGN reader resolves a tag element's
    color through the file color table (or the default palette) and its weight as it does
    for entities, keeping dgn.color_index / dgn.weight; the SVG renderer draws a
    displayed attribute in its own color; the DGN writer uses them when the attribute has
    no explicit dgn.color_index / dgn.weight (the explicit index still wins; a typed
    color must exist in the seed palette, as for entities); Document::explode_inserts and the
    DXF writer's ATTRIB records use them too (ByBlock and None take the insert's). Both
    fields are omitted from JSON when unset, so schema_version stays 1 and older JSON reads
    unchanged (#30).
  • DGN type 11 curves carry their end conditions as dgn.curve_start_tangent /
    dgn.curve_end_tangent (GDAL dgnlib's slope at the first and last fit points, not
    normalised); the DXF writer emits them, normalised, as SPLINE groups 12/13 of fit-point
    splines (#28). Entity::transformed keeps them under a translation and positive uniform
    scale only and drops them otherwise (they would describe the untransformed curve).
  • cadkit_dgn::native::TagData::display_rotation interprets the orientation doubles of
    a tag element by its 3D flag, and reads the quaternions cadkit up to 0.5.2 wrote into 2D
    tags as such.
  • Warning dgn.complex_count: a complex chain or shape declared more components than it
    stores and was closed by the next chain or shape header that is itself a component (the
    pattern reported in #27).
  • cadkit_dgn::palette::exact_index (the writer's palette match) and nearest_index (the
    match V8Seed::prepare_document uses for off-palette colors).
  • V8Seed::font_entries (the seed's font table in stored order, repeated names included)
    and V8Seed::font_number (exact name, then trimmed ASCII case-insensitive; absent and
    ambiguous names are distinct Unsupported errors).
  • dgn.text_length_source = "range" on DGN text whose length comes from its element range
    (V7, and V8 as under Changed).
  • dgn.level_weight_raw / dgn.level_style_raw on layers read from 240-byte level entries:
    the two fields that presumably hold the level's weight (0x44) and style (0x40), kept
    raw; they set no lineweight or linetype.
  • DGN acceptance kit: cargo run -p cadkit --example interchange -- SEED [DIR] writes small
    synthetic DGN V8 files into a public seed (repacked and stripped seed, every supported
    geometry kind on new levels, justified, Turkish UTF-16 and windows-1254 and rotated text,
    a tag set with displayed, rotated and hidden tags, a hidden element, a 2D document in a 3D
    seed, large coordinates, a new raster attachment with a synthetic 1-bit TIFF beside it, a
    chained write, ByLayer colour), each read back and compared, checked with
    check_structure and opened with cfb in strict mode before it is written, plus
    MANIFEST.json and README.md. docs/dgn/ACCEPTANCE.md is the protocol for opening
    them in another application; no external acceptance is claimed. The example replaces the
    former three-file output (01-repacked.dgn, 02-new-geometry.dgn,
    03-moved-and-tagged.dgn); synthetic.gml stays.
  • docs/dgn/FORMAT_NOTES.md ("Built-in blank seed") and tests/blank_seed_evidence.rs
    record why cadkit ships no built-in blank seed: Dgn~H and Dgn~Mh hold undecoded
    fields whose values differ between the public writers.

Changed

  • DGN flat ellipses and arcs (smaller semi-axis at most 1e-9 of the larger one) are read as
    Line (the segment the sweep covers along the non-zero axis) or Point (both axes
    zero) instead of Ellipse { ratio: 0 }, which broke the documented (0, 1] range. The
    element data stays in dgn.degenerate_ellipse, dgn.primary_axis,
    dgn.secondary_axis, dgn.center, dgn.start_angle, dgn.sweep_angle and
    dgn.rotation / dgn.quaternion; the DGN writer writes such an entity back as a line
    (#24).
  • DGN V8 graphic elements with property bit 0x0080 are read with Entity::visible = false
    instead of true, following the report in #25 that other readers do not draw them; the
    raw word stays in dgn.properties. In the corpora only TreeText's tags carry the bit, so
    graphics are covered by synthetic records only. V7 elements are unchanged. Written tags
    take their hidden bit from Attribute::invisible only, so a displayed tag of a hidden
    entity stays displayed in the file (SVG output skips it with its owner).
  • A complex chain or shape header that follows an unfinished chain or shape closes it
    instead of becoming its component, so chains in cells no longer nest into each other when
    a chain declares more components than it stores, the cause of the nesting reported in
    #27 (the reporter's files were not available; every chain and shape of the corpora
    declares exactly the components it stores; the pattern is reproduced synthetically).
  • The bytes of every DGN file write_v8 writes change: the first dword of the model header
    stream prefix (Dgn~Mh) is the number of graphic and control pages the output holds with
    records, the relation observed in 552 of 567 private and 3 of 3 public V8 files (it was
    the seed's value); a page without records is its 16-byte header (no empty zlib stream).
    write_v8 and repack_v8 write unused directory slots in the MS-CFB 2.6.3 free form
    (the cfb crate's form had a name length of 2). Slot order and the page headers of
    unchanged seed pages are unchanged.
  • The DGN writer gives a ByLayer entity without its own dgn.color_index the layer's
    dgn.color_index (0–255) before trying the layer color, as it does for dgn.weight.
    Documents read from a file write the same bytes as before (their elements carry their own
    index); a new ByLayer entity on a colored level is written with that level's index
    instead of 0, also into a seed whose palette lacks the layer's RGB.
  • DGN V8 layers read from 240-byte level entries (the only layout of the private corpus;
    the three public V8 samples use 104-byte entries) carry the level color:
    Layer.color is the file palette color of the entry's color index (0x48), kept in t...
Read more

v0.5.2

Choose a tag to compare

@github-actions github-actions released this 01 Nov 10:03
7226089

Added

  • cadkit::to_svg_bounded, cadkit_core::svg::render_bounded and WASM
    CadDocument.toSvgBounded reject SVG output or work-budget exhaustion without
    returning a partial drawing. The UTF-8 output cap covers XML, layer names,
    definitions, intermediate SVG strings and final assembly. Existing SVG entry
    points retain their truncation behavior.

v0.5.1

Choose a tag to compare

@github-actions github-actions released this 25 Oct 09:58
f66f3a2

Documentation

  • Present cadkit as a modular CAD engine, with a module map, document operations,
    geometry/scene/rendering boundaries and clearer supported file input/output.
  • Align package descriptions and READMEs with the current APIs, document the scene bridge
    and CPU handoff, and clarify 0.5 migration and the untested DWG R13 scope.

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 12:52
0caf492

0.5 is the deliberate breaking release that settles the API: later 0.5.x releases only add.
See "Migrating from 0.4" below.

Added

  • Constructors and with_* setters for every model and option type (Layer::new,
    Block::new, Model::new, Linetype::new, TextStyle::new, Attribute::new,
    AttributeDisplay::new, Warning::new, SourceInfo::new, Units::new, Limits::new,
    WalkOptions::new, BBoxOptions::new and new() on the reader/writer options).
  • Document::schema_version (SchemaVersion, currently 1) in the document JSON, typed
    Error::SchemaVersion for other versions, and an optional schemars feature on
    cadkit-core with the committed schema docs/schema/document-v1.schema.json.
  • LimitKind on Error::LimitExceeded, naming the Limits field, a work or output budget,
    or a format capacity overflow.
  • cadkit_dgn::Symbology with the dgn.level_id / dgn.color_index / dgn.weight /
    dgn.style key constants, and V8Seed::palette, levels, fonts and timestamp_ms.
  • cadkit_gml::tkgm::Severity for profile findings.
  • New cadkit-scene crate (GPU-free, WASM-compatible): Plan2d, a chunked 2D store of
    lines, polylines, arcs and circles with documented GPU instance encoding, per-frame f32
    error budget checks, overlay cut-outs and CPU fallback; Mesh3d / MeshScene /
    MeshBudget and the error-checked relative_positions f64 to f32 conversion.
  • New cadkit-gpu crate on wgpu 30 (re-exported): PlanRenderer for Plan2d frames
    (analytic antialiased lines and arcs, mitred corners, hairline fading, premultiplied
    blending, per-generation chunk uploads), MeshRenderer with OrbitCamera and
    incremental mesh/camera updates, RenderTargetCache, render_texture,
    render_offscreen, mesh_budget, typed GpuErrors and a block_on helper. CI runs
    its rendering tests on Mesa lavapipe.
  • cadkit-scene feature document: document::plan_document turns the visible entities
    of a Document model (blocks and arrays expanded) into plan items with resolved colors,
    lineweight widths, layer groups and SVG-like contrast against the background; curves that
    do not stay circular are flattened. A DocumentPlanReport counts what is not drawn
    (text, hatches, points, images, unknown records, dashes drawn solid).
    cadkit-gpu/examples/render_png.rs renders a DWG, DXF or DGN file to PNG with it.
  • cadkit_core::svg::with_contrast, the stroke contrast rule of the SVG export.

Changed

  • Breaking: Document, SourceInfo, Units, Layer, Linetype, TextStyle, Block,
    Model, Entity, Attribute, AttributeDisplay, Warning, the enums EntityKind,
    Value, Format, ModelKind and GroupKind, and the option structs Limits,
    ReadOptions, SvgOptions, BBoxOptions, WalkOptions, cadkit_dgn::WriteOptions,
    SeedPrepareOptions, cadkit_gml::ExportOptions, ImportOptions, ValidationOptions
    and ProfileIssue are #[non_exhaustive]. Color, Lineweight, HatchEdge,
    DimensionType and LengthUnit mirror closed sets of the formats and stay exhaustive.
  • Breaking: Error::LimitExceeded(String) is now Error::LimitExceeded { limit, message };
    the error text is unchanged.
  • Breaking: ProfileIssue::severity is a Severity; its JSON stays "error" / "review".
  • Document JSON written by this version starts with "schema_version": 1. JSON without
    the field still reads.
  • CI runs cargo-semver-checks, so 0.5.x releases stay additive.

Migrating from 0.4

  • Struct literals of the types above no longer compile outside cadkit. Use the
    constructors and setters, or start from Default::default() / new() and assign fields:
    Layer { name, color, ..Layer::default() } becomes Layer::new(name).with_color(color).
    Layer::new makes a visible, plottable layer; Layer::default() keeps every flag false.
    TextStyle::new sets a width factor of 1.
  • match on EntityKind, Value, Format, ModelKind or GroupKind needs a _ arm.
  • Replace Error::LimitExceeded(message) patterns with Error::LimitExceeded { message, .. }.
  • Compare ProfileIssue::severity with Severity::Error / Severity::Review
    (or severity.as_str()).
  • The C ABI, the Python and WASM APIs and the JSON of the options are unchanged.

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 00:26
b2b403b

Added

  • Independent cadkit-geom crate with analytic curves, polygon booleans and source
    provenance, calibration, trim/offset, and certified NURBS evaluation,
    tessellation and nearest-point search.
  • Optional schemars feature, unconditional serde support, explicit numerical
    budgets, English API documentation and synthetic extreme-input regressions.

Changed

  • Raise the workspace MSRV from Rust 1.85 to 1.88 for the pinned i_overlay 9.0.0
    geometry dependency.
  • Update existing workspace code to the lint spelling enabled by Rust 1.88
    (let chains, fixed-size chunk iteration and divisibility checks), without
    changing the format or binding contracts.

v0.3.7

Choose a tag to compare

@github-actions github-actions released this 23 Oct 16:28
158c8ce

Header inspection, CAD document operations and binding/CLI parity, with additional format
coverage and explicit export controls. Existing 0.3.x option-struct layouts are retained.

Added

  • Header-only inspection and stream-oriented facade helpers, feature selection, and a prelude.
  • Document transformations, unit conversion, block expansion, geometry utilities and reusable
    DGN V8 seed preparation with explicit unit/dimension/symbology conversion.
  • Additional SVG hatch/dimension/linetype handling, binary DXF and CAD entity support,
    CityGML curve/geometry handling, and legacy OEM code-page decoding/byte export.
  • Python inspection, reusable V8Seed, immutable document operations and updated typing;
    additive C/C++ entry points with immutable result handles and CMake/pkg-config installation.
  • CLI JSON summaries, bounded stdin/stdout conversion, output code pages, geometry filters
    and shell completion scripts without extra Cargo dependencies.
  • WASM option/result types and object options, document operations and geometric picking;
    viewer code-page, visibility, coordinate, selection and GML export controls.

Fixed

  • GML shell diagnostics handle extreme finite coordinates without integer-overflow panics.
  • Reader/export bounds, encoding, geometry and cross-format fidelity edge cases, backed by
    synthetic regressions. Reader/export paths also avoid several temporary allocations.
  • Circular viewer picking uses analytic XY distance; display-hidden layers are excluded
    from selection. GML export requires an explicit CRS and explicit metadata-only opt-in.
  • C ABI struct layouts and existing entry points remain unchanged; failed operations reset
    outputs and immutable block expansion reports exhausted work limits instead of a partial copy.

Changed

  • English repository documentation/public messages, contribution and security guidance,
    issue/PR templates, deterministic fuzz seeding and release checks.
  • Expanded API and architecture documentation and C++ contract testing in CI.

v0.3.6

Choose a tag to compare

@github-actions github-actions released this 23 Oct 01:40

DGN CFB directory trees, page header counters, and default element timestamps match
MicroStation V8 output.

Fixed

  • write_v8 orders the CFB directory with Dgn~H at slot 1, Dgn~S at slot 2, and
    Dgn-Md at slot 3 (each storage before its child streams, ^AH before $1 in
    Dgn^GA/Dgn^CA), and rebalances every storage's child sibling tree in place using
    top-down 2-3-4 red-black insertion in directory slot order. The cfb crate wrote
    storages first and left sibling trees as unbalanced all-black chains.
  • All DGN $ page streams (Dgn^G, Dgn^C, Dgn^GA, Dgn^CA, Dgn^Nm, Dgn^NmA)
    write (page_number, population) == (0, 0) at bytes 8..16 of the 16-byte page header,
    and Dgn-Md/#000000/Dgn^CA/^AH is preserved when preserve_seed_controls is enabled.
  • When WriteOptions::timestamp_ms is 0.0, write_v8 defaults element timestamps to
    the seed's Dgn~H timestamp at offset 0x130.

v0.3.5

Choose a tag to compare

@github-actions github-actions released this 20 Oct 00:06

DGN dictionary pages keep the seed's layout, so a level table is no longer split across
pages.

Fixed

  • write_v8 no longer joins the seed's dictionary records (Dgn^Nm) and re-splits them
    into new 256 KiB pages. A level table split over two pages is not loaded as one table
    by MicroStation: every element showed on "Default". Every seed page now keeps its
    number and record order; a page whose records did not change keeps its stream byte for
    byte (empty pages included), a changed page is rewritten in place, and new tables and
    tag sets share one new page after the seed's last page. No table or complex element
    crosses a page; only max_decompressed_bytes bounds a page (exceeding it is a
    LimitExceeded error, nothing is split silently).
  • Dictionary and XAttribute page headers write page number and population 0, as on every
    surveyed file. XAttribute records move with their elements.
  • A new level entry is appended to the level table's page with the seed entries' flags
    and a fresh level code (+0x5C), instead of the first level's code. Seeds written by
    earlier cadkit versions (split tables) are repaired on write.
  • The workspace builds with its declared MSRV (Rust 1.85) again: the DGN writer no
    longer uses let chains (since 0.3.2).

v0.3.4

Choose a tag to compare

@github-actions github-actions released this 19 Oct 11:43

DGN raster attachments can name a file beside the DGN instead of a machine path.

Added

  • A new raster attachment whose path is relative and names a file beside the DGN
    stores no machine-specific location: a bare file name writes the name and an empty
    full path, .\name (or ./name) is stored as given. Absolute paths still write the
    file:// URL. Relative paths into other folders are rejected.

Fixed

  • An empty raster full path or file name reads as absent: the image path falls back to
    the file name and no empty dgn.raster_path is reported.

v0.3.3

Choose a tag to compare

@github-actions github-actions released this 16 Oct 16:55

DGN raster attachments can be written into seeds that hold none.

Added

  • New raster attachments no longer need a seed attachment to clone: a seed without one
    gets a built-in attachment group made of the bytes every surveyed attachment shares,
    with a bitonal display (white foreground, black background) and 200 DPI unless
    dgn.raster_dpi is set. seed_has_raster_template still tells whether the seed's own
    group is used.