Repository navigation
kSTEP 0.3.0
Pre-releasekSTEP 0.3.0 — 2026-10-24 (pre-release)
Fourth pre-release. It makes the geometry layer parametric and adds presentation data: sketches gain radius,
tangency and angle constraints and re-solve inside a feature history, edges generated by extrude, revolve, fillet,
chamfer, boolean and hole operations get persistent names, a feature history gets undo/redo, kstep render / preview /
GLB honour assembly placements, the OCCT bridge gains mirror, uniform scale, face and vertex selection and shell, and
colours and layers are written by kstep export and read back by kstep import, which now also reports the length
unit and runs in a supervised worker process. As before, the GitHub release carries a platform-independent JVM-only
kstep-cli-0.3.0.zip (about 87 MB because it bundles the Kotlin compiler for *.kstep.kts scripts) and a SHA-256
checksum, and nothing is published to Maven Central or Homebrew.
Geometry, sketches and kstep import need the native bridges. The zip is built without them, so those
features report a clear "unavailable" error there; build from source with a system OpenCascade (Linux
x86-64, or macOS arm64 via Homebrew) to use them. Interoperability is verified with OpenCascade-based readers
(OpenCascade's own readers and FreeCAD), not yet with other CAD/PLM systems.
Added
- Sketch extensions (ADR-0032, Welle M). Circle and arc radii can be solver unknowns (
fixedRadius = false);
new sketch constraintsradius,diameter,equalRadius,tangent(line, circle),tangent(circle, circle, internal)andangle(l1, l2, degrees);SolvedSketch.radius(ref). New PlaneGCS constraint kinds 7-12 and
scalar unknowns (SketchScalar,RadiusConstraint,EqualScalarConstraint,PointOnCircleConstraint,
TangentLineCircleConstraint,TangentCircleCircleConstraint,AngleConstraint) behind the new native entry
pointnativeSolveSystem(at most 128 scalars). SketchFeature/sketchFeature(...): a parametric sketch as a step of a feature history that re-solves on
FeatureRebuilder.rebuild, through the new open interfaceExternalRootFeature(andExternalFeatureException).- Several separate outer contours in one sketch become several bodies in one shape:
SolvedSketch.toRegions(),
OcctKernel.extrudeRegions/revolveRegions,ExtrudeRegionsFeature/RevolveRegionsFeature, native
nativeMakeCompound(at most 32 bodies); STEP export writes them as one representation with several
MANIFOLD_SOLID_BREP;kstep importreports them per body (ImportedPart.bodies, JSON fieldbodies). OcctKernel.solidSummaries,groupLoopsIntoRegions,requireValidDisjoint.- Example scripts and
scripts/interop/verify-sketch-extensions.sh. - Persistent naming of generated edges (ADR-0033, Welle N).
GeneratedEdges(featureIndex, sources, role, expected, within)addresses the edges an extrude or revolve generated from profile sources (ProfileVertex,ProfileEdge,
RegionVertex,RegionEdge,PointAt,SegmentAt, and for sketchesSketchCorner/SketchEdgeOfby point
name), so a parameter change keeps hitting the same logical edges. Kernel API:OcctKernel.extrudeProfileNamed,
revolveProfileNamed,extrudeRegionNamed,revolveRegionNamed,generatedEdges, and fillet/chamfer overloads
on aNamedShape;SolvedSketch.extrudeNamed/revolveNamed;EdgeNamingException(KSTEP-S-011in scripts);
SketchBuilder.rectangle(..., names = ...). Four new native entry points, no new OCCT toolkit. - Undo/redo:
FeatureHistorywithAddFeature,RemoveFeature,ReplaceFeature,MoveFeatureover a
FeatureSequence(immutable snapshots, index remapping, no shapes held),FeatureHistoryException. - Example scripts for both and
scripts/interop/verify-persistent-naming.sh. - Naming of edges generated by derived features (ADR-0034, Welle N2).
GeneratedEdgesnow also accepts a fillet,
chamfer, boolean or hole as generator, with the new sourcesBlendedEdges,OperandEdges(operand, selector),
OperandFaces(operand, faceSelector),BooleanSectionandHoleWalland the new rolesBOUNDARY,SECTION,
RIM_ENTRY,RIM_EXIT. Kernel API:OcctKernel.filletNamed,chamferNamed,booleanNamed,holeNamed,
generatedEdges(DerivedNamedShape, ...),DerivedNamedShape,MAX_DERIVED_QUERIES. Strict like ADR-0033: a blind
hole has noRIM_EXIT, a source without an image or a wrong count is anEdgeNamingException(KSTEP-S-011). Three
new native entry points (nativeFilletEdgesNamed,nativeChamferEdgesNamed,nativeBooleanOpNamed), no new OCCT
toolkit, OCCT 7.9 APIs only. The source/role/generator combinations are validated before any native call. - Example scripts for the hole rim, a union section and an unresolved name, and
scripts/interop/verify-derived-naming.sh(with--spikefor the standalone OCCT history spike). - Placement-aware render, preview and GLB (ADR-0035, Welle O).
kstep render,kstep asciidocand the preview
pipeline now draw every instance of a placed assembly at its composed place (SVG, PNG and GLB; the GLB is one
merged mesh). New publicAssemblyInstanceExpanderandRigidPlacement.toGeometryPlacement()inkstep-shape
(limits: 4096 instances, 16384 visited nodes, depth 64); each distinct part is triangulated once. The JSON output
gainsgeometry.instanceCountandgeometry.distinctShapeCount, the text summary saysassembly: N instance(s) of M part(s), and an invalid placement degrades into aplacement_invalidnotice card. A model with several
shapes but no assembly usage still previews shape 1 only, with a reworded warning. - Mirror and scale as shape operations (ADR-0036, Welle P).
OcctKernel.mirror(shape, plane)andscale(shape, factor, about)return a mirrored or uniformly scaled COPY (alsomirrorWithHistory/scaleWithHistory), new
MirrorPlane, script-levelmirror(...)/scale(...),MirrorFeature/ScaleFeaturein the feature history
(persistent edge names set before the step are followed through it). Scale factor within [1e-6, 1e6]; solid or
compound of solids as input, every result solid checked. Four new native entry points (nativeMirrorShape,
nativeScaleShapeand theirTrackedvariants), no new OCCT toolkit.OcctKernel.compound(shapes)combines
separate bodies into one shape for one product definition (at most 32). Six example scripts plus
hello-scale-invalid, andscripts/interop/verify-mirror-scale.sh(with--spike). - Face and vertex selection,
nearest(point)and shell (ADR-0037, Welle Q).Edges.nearest(point, within),
Faces.nearestandVertices.nearestpick the sub-shape(s) with the smallest GEOMETRIC distance to a point
(BRepExtrema_DistShapeShape, ties are all returned); newFaces.all(), faceand/or/minus, the
VertexSelectorfamily (Vertices.all/atMax/atMin/nearest/ofEdge),Edges.atVertex,OcctKernel.selectFaces/
selectVertices,OcctShape.vertices(VertexInfo),TopologySelectionExceptionas common base of the three
selection failures (KSTEP-S-011in scripts; the constant keeps its name). One selector-tree validator now bounds
depth 32 / 256 nodes over all cross-nested hierarchies, iteratively and before any hashing.OcctKernel.shell(face
indices or a face selector, a positive thickness andShellDirection.INWARD/OUTWARD),shellWithHistory, the
script functionshell(...)andShellFeaturewithSelectFaces/FaceIndicesin the feature history: an edge
named before an INWARD shell is followed through it, an OUTWARD shell cannot be tracked through (refused with the
reason). The wall must be thinner than half the smallest extent, the input at most 200 faces. Five new native entry
points (nativeShapeVertexInfo,nativeShapeVertexEdges,nativeShapeDistances,nativeShellShape,
nativeShellShapeTracked) and ONE new OCCT toolkit,TKOffset(the CI jobs check for it; on Ubuntu it is expected in
libocct-modeling-algorithms-dev, proven only by the CI Linux job). Eight example scripts and
scripts/interop/verify-face-ops.sh(with--spike). Not included: a pocket or hole from a face, draft and thickening
(planned as Welle Q2), naming of the inner wall of a shell,TrackedFaces; see ADR-0037. - Import of colours, layers and units (ADR-0038, Welle R).
kstep importnow reports the colour (sRGB, as written in the
file) and layers of each part, each body of a multi-solid part and each styled face (colour,layers,faceStyles),
the file's declared length unit (sourceLengthUnit:declared,missingormixed, with the factor to mm) and a
presentationsummary; face numbers are OCCT's 0-based face order. New errorKSTEP-I-013(unit_unresolved) for a
length unit that cannot be resolved (for example a conversion factor of 0, for which OCCT otherwise returns a bounding
box of 1e100). A new pre-transfer check bounds the product-structure depth (32) and detects cycles on the typed
entities.OcctKernel.surfaceTypeCountsand the part keysurfaceTypescount faces per surface kind (a B-spline face
staysFaceKind.OTHER). New JNI entry pointsnativeImportColors,nativeImportLayerRefs,nativeImportLayerNames,
nativeImportStyleStats,nativeImportUnitInfo,nativeImportUnitNames,nativeShapeSurfaceTypeCounts. Fixtures for
styled, multi-body, inch, centimetre, metre, unit-less, unresolved-unit, structure-only and a FreeCAD B-spline loft,
scripts/interop/make_import_extras_fixtures.pyandscripts/interop/verify-import-extras.sh. Not included: instance
colours and layers, edge colours, imported colours in--render, colour export. - Export: colours and layers (ADR-0039, Welle S).
shape(pd, shape, name, colour, layer),style(pd, colour, layer)and
styleFaces(pd, selector, colour, layer, expected)give a part or single faces an sRGB colour (StepColour.rgb,
StepColour.hex,StepColours) and a layer name. A styled part is written throughSTEPCAFControl_Writer(new JNI
entry pointnativeWriteStepStyled), and the style entities (STYLED_ITEM,PRESENTATION_LAYER_ASSIGNMENT, colours)
are merged into the Part 21 file with a fail-closed allow-list. Parts without a style are written by the unchanged
path and stay byte-identical (golden files generated before the change pin this down).kstep importreads the colours and
layers back;kstep rendershows the part colour (SVG, PNG, GLBCOLOR_0). New codesKSTEP-S-012(invalid colour),
KSTEP-S-013(invalid layer name),KSTEP-S-014(second colour or layer for one target),KSTEP-S-015(unknown target).
Layer names are printable ASCII (1 to 128 characters, no backslash); transparency is not supported. scripts/interop/verify-export-colours-layers.shandfreecad_read_styles.py;spike_export_styles.cppholds the
measurements behind ADR-0039.
Changed
kstep importreads with OCCT's colour and layer modes on (measured: no import-time difference on the placed-assembly
fixture). The warning "ignored (not imported)" now names onlypmi;ignored.coloursandignored.layerskeep counting
occurrences in the file.DIMENSIONAL_EXPONENTS(a unit entity) is no longer counted as PMI. A representation without
any B-Rep isno_content(KSTEP-I-011) instead of a part with volume 0.- The messages of
Placement.fromRowMajor3x4,Rotation.fromAxes, the nativenativeTransformShapeand the
exporter/preview refusal of two shapes on one product definition now name the way out (mirror(...),scale(...),
OcctKernel.compound(...)); the old wording is kept as a prefix. A placement stays rigid. - BREAKING (source):
GeneratedRolegained the valuesSECTION,BOUNDARY,RIM_ENTRYandRIM_EXIT; an exhaustive
whenoverGeneratedRoleorGenerationSourcein third-party code no longer compiles and needs the new
branches.GenerationMapcan carry images of derived sources (images()answers them by role). SolveResultgained ascalarsfield (default empty): source compatible, not binary compatible.- Arcs now bind their end points with a point-on-circle constraint on the radius unknown instead of two distance
constraints; labels and degrees of freedom are unchanged for fixed radii. - BREAKING (source):
SolvedSketch.extrudeFeature/revolveFeaturenow returnFeatureinstead of
ExtrudeRegionFeature/RevolveRegionFeature, callers using the concrete type must adapt;toRegion()fails withINVALID_PROFILEwhen the
sketch has several separate outer contours (usetoRegions()). fillet/chamfer(index, selector and history variants) refuse a shape with more than one solid with a clear
message instead of failing inside OCCT.FeatureRebuildercloses all built shapes when an external feature fails with any runtime exception.ExternalRootFeaturegainedsupportsGeneratedNamingandbuildNamedShapewith default bodies (source
compatible, not binary compatible without-Xjvm-default=all);FeatureRebuilder.validateStructureis public.kstep importno longer fails for a part with more than 1024 solids: the per-body summary is omitted with a
warning. Computing it for up to 1024 solids adds noticeable import time.- Documentation: the README was split into focused documents under
docs/(status, modules, building, releasing,
usage, roadmap); the README itself is now a short entry point.
Fixed
kstep import: a product-structure chain of thousands of levels (a few hundred kilobytes) could exhaust OCCT's
recursive transfer and crash the JVM; depth and cycles are now checked on the typed entities before the transfer and end
inlimit_exceeded(KSTEP-I-010). A length unit with conversion factor 0 no longer yields geometry of size 1e100.- Documentation: ADR-0031, ADR-0032 and ADR-0030 no longer claim OCCT 7.8 compatibility or a Linux CI on 7.8; the
Linux CI uses 7.9.2 and 7.8 is not tested. - Export: a part colour together with a face colour no longer aborts with "unexpected entity OVER_RIDING_STYLED_ITEM ...
refusing to merge it". The overriding item is merged fail-closed: simple instance with four arguments, attached to a
face, overriding a styled item of the style closure through an acyclic chain of at most 16 that ends at a styled solid
containing that face; unknown entities are still refused (ADR-0039 S2). Two single-style golden files guard the
unchanged output. - Import: the new colour and layer mode made the OCCT transfer quadratic in the number of layer assignments and distinct
colours (80k layers took 41 s under the global OCCT lock). A pre-transfer typed count now rejects more than 4096 layer
assignments or 10000 colour definitions withlimit_exceeded(KSTEP-I-010). The count also covers
SURFACE_STYLE_TRANSPARENTandSURFACE_STYLE_RENDERING_WITH_PROPERTIES(10000 each), because OCCT's colour table is keyed
by RGBA and distinct colour x transparency pairs were still quadratic (80k styled items took 67 s). These caps bound
only the size of the colour table, not the work, because everySTYLED_ITEMscans that table once (a full table plus
300k styled items took 116 s). The count therefore also coversSTYLED_ITEM/OVER_RIDING_STYLED_ITEM(at most
200000) and bounds styled items x (colour definitions + rendering records) to 100000000. The style lists of
PRESENTATION_STYLE_ASSIGNMENT,SURFACE_SIDE_STYLEandSTYLED_ITEMare walked once per styled item too and could
repeat one reference cheaply (10k styled items x 200k entries took 53 s); lists longer than 64 entries are rejected. - Import: capped style lists still multiplied, because the colour reader walks styled item -> presentation style
assignment -> surface side style -> fill area style as nested loops (four lists of 64 = 16.7M steps per styled item;
100 such items in a 71 kB file took 15 s). The pre-transfer check now sums the weighted expansion cost of all styled
items (memoised per entity, linear in the file) and rejects more than 10000000 withlimit_exceeded(KSTEP-I-010);
real files cost 1-3 per styled item. The fill styles ofFILL_AREA_STYLEand the properties of
SURFACE_STYLE_RENDERING_WITH_PROPERTIESare capped at 64 as well. New constant
StepImportLimits.MAX_STYLE_EXPANSION_WORK. - Import: an assembly "diamond" (each level using the same sub-assembly twice) has a small depth but 2^levels
occurrences, and OCCT expanded it during the transfer before the Kotlin occurrence limit fired (28 levels, 56 kB: 69 s).
The pre-transfer structure check now also counts the part occurrences after expansion on the usage graph and rejects
more than 10000 (StepImportLimits.MAX_EXPANDED_OCCURRENCES, now also checked natively) withlimit_exceeded
(KSTEP-I-010) in well under a second. kstep importruns the import in a worker subprocess (ADR-0038). Four audit rounds kept finding new loops inside OCCT
(a self-overridingOVER_RIDING_STYLED_ITEM, deep override chains andMAPPED_ITEMchains or cycles ended the process
with exit 132 and no output at all; override chains,MAPPED_ITEMdiamonds and shells repeating one face ran into or
past the 60 s bound). The command now starts a second JVM (same runtime and class path,-Xmx2g, no JVM crash banner)
and only supervises it: a regular end (exit 0 or 1 with one complete report) is passed through unchanged; a timeout
(60 s, can only be lowered via-Dkstep.import.timeoutMillis/KSTEP_IMPORT_TIMEOUT_MILLIS; the worker and its
children are killed), an OutOfMemoryError or an output overflow becomelimit_exceeded(KSTEP-I-010), a crash or an
incomplete report becomesread_failed(KSTEP-I-009), as text or--output json. With--output jsonstdout is
always exactly one JSON document. The previous in-process watchdog (Runtime.halt) printed a JVM fatal-error banner on
stdout when it ended a native call; it now only bounds an orphaned worker, silently. Cost: one extra JVM start per
import (about 0.08 s, see ADR-0038). A 100000-deep override chain still crashes OCCT's reader before any pre-scan
runs; it now ends as oneread_faileddocument instead of a silent exit 132. Library callers ofStepImporter/OcctKernel.readStepstill run in-process without a time
or memory bound, andkstep-mcphas no import tool.- Import: three more pre-transfer checks give the known worst cases a structured error in under a second (the worker is
the guarantee, these are the fast path):OVER_RIDING_STYLED_ITEMchains deeper than 16 or cyclic,MAPPED_ITEM
nesting deeper than 32 or cyclic and more than 10000 mapped-item expansions, and more than 250000 face references
summed over all shells are rejected withlimit_exceeded(KSTEP-I-010). New constants
StepImportLimits.MAX_OVERRIDE_DEPTHandMAX_MAPPED_ITEM_EXPANSIONS. - Tests: a native handle-hygiene test compared the global shape counter exactly and failed once in a full build
(the cleaner frees shapes of earlier tests asynchronously); it now allows a small growth. A test name was aligned
with the CI skip guard's marker. The wall-clock bounds of the import limit tests were relaxed to 30 s for slower
CI runners; the structured limit error is still asserted.
Notes
- Not included: PMI (
kstep importcounts it and reports it as ignored,kstep exportwrites none); a pocket or hole
from a face, draft and thickening (planned as Welle Q2); names for the inner wall of a shell and for edges of
multi-body sketches; a persisted feature history (undo/redo lives in memory); booleans with several bodies; tangency
at arc ends; contours touching each other; non-uniform scale; transparency, colours and layers on assembly
instances, edge colours, face colours in the preview and imported colours inkstep import --render. - Platforms: the native bridges are built and tested on Linux x86-64 and macOS arm64 only. Windows and Intel Macs are
not supported and not tested (the bridges reportUnavailablethere); the JVM-only zip has not been tried on Windows. - Interoperability: exports and imports are checked with OpenCascade-based readers only (OCCT's typed and XCAF readers,
FreeCAD 1.1.4 on OCCT). FreeCAD's headless reader was used for geometry; colours were checked with kSTEP and OCCT.
The multi-body STEP layout is verified on OCCT 7.9.3 and by the CLI round-trip test on the Linux CI. Other CAD/PLM
systems and a lossless write-back round trip are unverified. - Import bounds: only the
kstep importcommand runs the reader in a supervised worker process with a time and memory
bound. Library callers ofStepImporter/OcctKernel.readStepstill run in-process without such a bound, and
kstep-mcphas no import tool. - Gate (2026-10-24, macOS arm64, OCCT 7.9.3):
clean check -Pkstep.occt.require=true -Pkstep.planegcs.require=true --no-build-cache, 2121 tests, 0 failures, 0 errors, 14 skipped (12 "native bridge unavailable" negative tests, two
gltf-validator tests); release-style build without natives:verify-dist.shgreen, import, sketch solving and
geometry export report the bridge as unavailable,kstep mcpreports version 0.3.0.
Verify the download with the attached .sha256 file (sha256sum -c).