Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

1.5 KB
Raw Blame

Aetheris Web SDK getting started

Install the preview package and configure Vite to copy and serve its self-contained runtime:

npm install @aetheris/cad
// vite.config.js
import { defineConfig } from "vite";
import { aetherisCad } from "@aetheris/cad/vite";
export default defineConfig({ plugins: [aetherisCad()] });
import { Aetheris } from "@aetheris/cad";

const cad = await Aetheris.create();
const source = `Model Plate {
  Units: mm
  Box Body { Size: [50mm, 40mm, 8mm] }
  Modify Body { Hole<Shaft> Mount { On: +Z Center: Point2(0mm, 0mm) Diameter: 8mm End: ThroughAll } }
}`;
const { model, diagnostics } = await cad.compile(source, { sourceName: "plate.firmament" });
if (!model) throw new Error(diagnostics.map(item => item.message).join("\n"));

console.log(model.tree, model.properties, model.mesh);
const width = model.properties.find(item => item.name === "Width")!;
await model.setProperty(width.id, { value: 80, unit: "mm" });
const step = await model.exportSTEP();
const download = URL.createObjectURL(new Blob([step], { type: "model/step" }));

Call model.dispose() and cad.dispose() when finished. Use Aetheris.create({ worker: true }) for a dedicated module Worker, as Helios does. See the API reference for the export format catalogue and multi-format ZIP downloads.

The package is AGPL-3.0-only. Contact the Aetheris project about commercial licensing; obtain legal advice for your distribution model.