Typed Domain Grounding
A statically typed Kotlin DSL plus compiler and validation feedback gives LLMs a ground truth to work against — the same principle that makes kUML reliable, applied to engineering data.
One typed source. STEP-native models. Readable for humans and AI.
kSTEP is the first AI-first, code-first, STEP-native engineering modeling DSL for Kotlin/JVM. It brings Typed Domain Grounding — the architecture proven in kUML — to physical engineering: a statically typed DSL plus compiler feedback that gives humans and LLMs a reliable ground truth, from product structure to geometry.
// product-structure.kstep.kts — shortened excerpt of the playground example
val appCtx = applicationContext { application = "configuration control" }.getOrThrow()
val prodCtx =
productContext {
name = "engineering"
frameOfReference = appCtx
disciplineType = "mechanical"
}.getOrThrow()
val housing =
product("HSG-100") {
name = "Housing"
description = "Enclosure housing"
frameOfReference = setOf(prodCtx)
}.getOrThrow()
// ... product definitions, nextAssemblyUsageOccurrence, stepFile { } -> STEP Part 21Shortened excerpt of the playground example — pre-release v0.3.0 (JVM-only CLI zip without native bridges), geometry only in a local build.
Today's CAD world offers GUI suites with proprietary formats — or code-first scripting without real AI integration. kSTEP is the deliberate third way.
A statically typed Kotlin DSL plus compiler and validation feedback gives LLMs a ground truth to work against — the same principle that makes kUML reliable, applied to engineering data.
kSTEP speaks ISO 10303 directly — AP242, Part 21 export, product structure and beyond. No binary vendor formats, no lossy conversion.
Geometry builds on OpenCascade (OCCT), accessed via JNI on the desktop first — with a WASM path already open for a later browser playground, from the same codebase. Several foundation pieces already work end to end: real B-Rep solids (boxes, extrusions, fillets, chamfers, cylinders, holes, revolve, union/difference/intersection) with a parametric feature history, a sketch DSL with PlaneGCS constraints and geometric edge selectors, geometry and placed assemblies in a single STEP file, `kstep import` to read STEP files with geometry back, glTF/GLB export, and an interactive desktop viewer (orbit, pan, zoom, per-part material colors, smooth shading on curved surfaces). Since v0.3.0 it also has persistent naming of generated edges, undo/redo, mirror, scale and shell, face and vertex selection, and colours and layers in STEP export and import; PMI, pocket or hole from a face, draft and thickening are still ahead. Geometry needs a system OpenCascade and a self-build; the release zip contains no native bridges.
LLM agents are a first-class user of the DSL — named parameters everywhere, validation loops, and an MCP server that already exposes the DSL as tool-calling tools, mirroring what kUML already ships.
CadQuery and Build123d are Python — no static types, no compiler feedback. Kotlin's type system is kSTEP's deliberate differentiator, not an accident of language preference.
Apache 2.0 for kSTEP's own code, dynamically linked against LGPL OCCT and PlaneGCS. Cleared deliberately during Discovery — no GPL traps.
The repository is real, the milestones are public, and every step lands in the open.
kSTEP on GitHub