Repository navigation
kSTEP 0.2.0
Pre-releasekSTEP 0.2.0 — 2026-10-22 (pre-release)
Third pre-release. It turns kSTEP from a product-structure tool into one that models, exports and reads
back geometry: kstep export writes product structure and placed assembly geometry, kstep import reads
STEP files (kSTEP, OCCT, FreeCAD) back, the OCCT bridge gains booleans, holes, revolve and chamfer, and a
sketch DSL with geometric edge selectors replaces opaque edge indices. As before, the GitHub release carries
a platform-independent JVM-only kstep-cli-0.2.0.zip (about 86 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 typed reader and FreeCAD), not yet with other CAD/PLM systems.
Added
-
Sketch DSL and geometric edge selection (ADR-0031, Welle L). New module
kstep-sketch
(dev.kstep.sketch):sketch { }with points, lines, arcs, circles,horizontal/vertical/distance/length/
coincident/pointOnLine/parallel/perpendicularand the sugarrectangle/offset;Sketch.solve( requireFullyConstrained, maxIterations)analyses degrees of freedom in plain Kotlin (redundant and
contradictory constraints are named before the solver runs), solves through PlaneGCS and verifies the result;
SolvedSketch.toRegion()/extrude/revolve/extrudeFeature/revolveFeature. Structured failures:
SketchExceptionwithSketchErrorKind,SketchSolverUnavailableException. Circle/arc radii are fixed
measures in this version.kstep-geometry:Edges/Facesselectors (parallelTo,ofType,atMax,atMin,
ofFace,longest,shortest,seams, combined withand/or/minus),Direction3,Point3,
SelectionTolerance,EdgeSelection.resolve,EdgeSelectionException(candidate list,expectedcount),
OcctKernel.selectEdgesand selector overloads offillet/chamfer(the index API is unchanged),
OcctShape.edges/faces(EdgeInfo/FaceInfo),SelectedFilletFeature/SelectedChamferFeaturewith
SelectEdges/TrackedEdges(edges followed through later operations via OCCT'sModified/IsDeleted
history:filletWithHistory,chamferWithHistory,booleanWithHistory,translateWithHistory,
holeWithHistory,EdgeHistory,TrackedShape),FeatureRebuildException.selectionFailure, and regions
with arcs, circles and holes (ProfileRegion,OcctKernel.extrudeRegion/revolveRegion,
ExtrudeRegionFeature/RevolveRegionFeature). Scripts importdev.kstep.geometry.select.*and
dev.kstep.sketch.*by default. New error codesKSTEP-S-009(SKETCH_SOLVER_UNAVAILABLE),KSTEP-S-010
(SKETCH_INVALID) andKSTEP-S-011(EDGE_SELECTION_FAILED);KStepScriptOutcome.RuntimeErrorgained a
codeproperty (defaultKSTEP-S-003), and--output jsonreports it. Native: no new OCCT toolkit; new JNI
functionsnativeShapeEdgeInfo/FaceInfo/FaceEdges,native*Tracked,nativeExtrudeRegion/
nativeRevolveRegion, each limit re-checked natively. Examplesexport-sketch-plate-with-hole,
export-box-fillet-z-edges,export-box-chamfer-top-edges,export-pocket-tracked-fillet,
hello-sketch-unconstrained; interop checkscripts/interop/verify-sketch-selection.sh. Gate (2026-10-22, macOS
arm64, OCCT 7.9.3):clean check -Pkstep.occt.require=true -Pkstep.planegcs.require=true --no-build-cache, 1590
tests, 0 failures, 0 errors, 8 skipped (inverse-/property-gated); release-style build without natives: 0 failures,
verify-dist.shgreen. -
kstep import <file.step>(ADR-0030, Welle K): reads a STEP file (kSTEP, OCCT, FreeCAD) back through OCCT's
XCAF reader and reports product structure, per-part volume/faces/bounding box, the expanded placed
occurrences and totals, as text or--output json;--validatechecks the AP242 V1 entities,--render <out.svg|png|glb>renders the imported geometry. Read-only apart from--render. Kotlin API:
dev.kstep.shape.importer.StepImporter/ImportedStepModel/StepImportValidation,
OcctKernel.readStep/OcctStepDocument,OcctShape.boundingBox,BoundingBox,Placement.fromRowMajor3x4
androwMajor3x4,StepImportLimits,OcctImportLimitException,MeshPreview(the SVG/PNG/GLB encoders
ofPreviewRenderer, output unchanged). Input hardening: no symbolic links, regular files only, 50 MB cap,
extern-document references rejected, entity/node/part/face/occurrence/depth limits. Error codes
KSTEP-I-001toKSTEP-I-012. Linux CI that requires OCCT now installslibocct-ocaf-dev. New interop
tools:dump_xcaf_tree nested,freecad_make_box.py,verify-import.sh. -
kstep exportmerges the geometry ofshape(...)registrations into the exported Part 21 file
(ADR-0027).Ap242ShapeExporter.export(header, roots, assignments)/exportToFileaccept all
roots and several shapes (one per product definition, limitsMAX_SHAPESand
MAX_TOTAL_GEOMETRY_INSTANCES); the single-assignment overload is unchanged in output. -
kstep export --require-geometry: exit 1 and no file unless geometry was merged. -
Error codes
KSTEP-S-006(GEOMETRY_REQUIRED),KSTEP-S-007(GEOMETRY_UNAVAILABLE) and
KSTEP-S-008(GEOMETRY_EXPORT_FAILED);--output jsonreports ageometryobject when shapes
are involved. -
Placed assembly geometry (ADR-0028, Welle I):
place(usage, translation, rotation)in the script
DSL withvec(...),Rotation.about(...),Rotation.fromAxes(...); the exporter writes a
CONTEXT_DEPENDENT_SHAPE_REPRESENTATIONchain per geometric usage, so OCCT and FreeCAD import the
components of an assembly (previously only the root).kstep export --output jsonreports
geometry.placementCount/usageCount. New interop toolsdump_xcaf_tree.cpp,
freecad_assembly_check.py,verify-placed-assembly.sh. Gate (2026-10-22, macOS arm64, OCCT 7.9.3):
clean check -Pkstep.occt.require=true -Pkstep.planegcs.require=true --no-build-cache, 1277 tests,
0 failures, 0 errors, 6 skipped (the six known ones). -
Geometry operations on the OCCT bridge (ADR-0029, Welle J):
OcctKernel.makeCylinder,
translate/transformed,union/cut/common/boolean(single-solid results, face-limited operands),
hole,revolveProfile(about X or Y,RevolveAxis) andchamfer;OcctEmptyResultExceptionfor empty
boolean results; feature-history casesCylinderFeature,RevolveFeature,TranslateFeature,
BooleanFeature,HoleFeature,ChamferFeature; example scriptshello-plate-with-hole,
export-plate-with-hole,export-boolean-{union,common,cut},export-revolved-sleeve,
export-chamfered-prism,hello-revolve;scripts/interop/verify-geometry-operations.sh. Gate
(2026-10-22, macOS arm64, OCCT 7.9.3):clean check -Pkstep.occt.require=true -Pkstep.planegcs.require=true --no-build-cache --rerun-tasks, 1333 tests, 0 failures, 0 errors, 6 skipped
(the six known ones). The six exported STEP files read back as valid solids in OCCT's typed reader and
FreeCAD with the closed-form volumes.
Changed
OcctGeometryExceptionis nowopen(parent ofOcctEmptyResultException);FilletFeatureimplements the
newDerivedFeatureinterface (constructor andcopyunchanged); the native bridge links-lTKBO.- CI/release workflows: the
apt-getsteps first download (resumable, three attempts with per-attempt
timeouts) and then install offline, with a 40-minute step limit, after a slow mirror held the Linux OCCT job
up twice on 2026-10-22 (its dev packages pull in about 450 MB). The Linux OCCT job also caches the downloaded
packages withactions/cache(one entry per ISO week). - The MCP server now reports the project version to clients (read from the jar manifest); it reported a
hard-coded0.1.0, including in the 0.1.1 release. - Geometry exports with assembly usages now carry an identity placement for usages without
place(...); the export text line gainsand K placed usage(s). Render, preview and GLB still
ignore placements. kstep exportno longer prints "geometry merging is not wired into 'export' yet". A merge failure
(unreachable or duplicate product definition, closed shape, OCCT error) fails with exit 1 instead
of writing a structure-only file; native shape handles are closed on every path.- The OCCT bridge detaches OCCT's default message printers while writing STEP, so OCCT's
"Statistics on Transfer" banners no longer pollute stdout (and--output json).
Verify the download with the attached .sha256 file (sha256sum -c).