npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cascade-core

v2.0.5

Published

Reusable CAD modeling engine built on OpenCascade WASM. Evaluate CAD code in a Web Worker and get triangle mesh data back.

Downloads

446

Readme

cascade-core

Reusable CAD modeling engine built on OpenCascade WASM. Evaluate CAD code in a Web Worker and get triangle mesh data back — no GUI dependencies.

This is the headless engine that powers Cascade Studio. Use it to embed parametric CAD modeling in any web application.

Install

npm install cascade-core

Quick Start

import { CascadeEngine } from 'cascade-core';

const engine = new CascadeEngine({ workerUrl: './cascade-worker.js' });
await engine.init();

const result = await engine.evaluate(`
  let box = Box(20, 20, 20);
  FilletEdges(box, 3, Edges(box).max([0,0,1]).indices());
`, { guiState: { 'Cache?': true } });

// result.meshData = { faces: [...], edges: [...] }
// Render with Three.js, Babylon.js, or any WebGL framework

Copy cascade-worker.js, cascadestudio.wasm, and fonts/ from node_modules/cascade-core/dist/ to your static assets directory.

Examples

These are all built with the cascade-core standard library — try them live:

API

new CascadeEngine({ workerUrl })

Create an engine instance. workerUrl is the path to the bundled worker file.

engine.init() → Promise

Load the worker and OpenCascade WASM. Resolves when ready.

engine.evaluate(code, options?) → Promise<{ meshData, sceneOptions }>

Evaluate CAD code and return triangulated mesh data.

  • code — JavaScript string using the standard library (Box, Sphere, Sketch, etc.)
  • options.guiState — slider/checkbox state object
  • options.maxDeviation — mesh resolution (default 0.1)
  • Returns { meshData: { faces, edges }, sceneOptions }

engine.meshHistoryStep(index, maxDeviation?) → Promise

Triangulate a specific modeling history step.

engine.exportSTEP() → Promise<string>

Export the current shape as STEP file text.

engine.on(event, handler) / engine.off(event, handler)

Listen for events: log, error, Progress, resetWorking, modelHistory, addSlider, addButton, addCheckbox, addTextbox, addDropdown, saveFile.

engine.isReady / engine.isWorking

Boolean status properties.

engine.dispose()

Terminate the worker and clean up.

Standard Library

The evaluated code has access to these functions:

  • Primitives: Box, Sphere, Cylinder, Cone, Circle, Polygon, Text3D, BSpline, Wedge
  • Sketch: new Sketch([x,y], plane?).LineTo().Fillet().ArcTo().BSplineTo().End().Face()
  • Transforms: Translate, Rotate, Scale, Mirror
  • Booleans: Union, Difference, Intersection
  • Operations: Extrude, Revolve, Loft, Pipe, Offset, FilletEdges, ChamferEdges
  • Selectors: Edges(shape).ofType().parallel().max().min().indices()
  • Measurement: Volume, SurfaceArea, CenterOfMass
  • GUI: Slider, Checkbox (values come from guiState)

See the full TypeScript definitions in types/StandardLibraryIntellisense.ts.

OpenSCAD

import { OpenSCADTranspiler } from 'cascade-core';

const transpiler = new OpenSCADTranspiler();
const jsCode = transpiler.transpile(`
  difference() {
    cube(20, center=true);
    sphere(r=12);
  }
`);
const result = await engine.evaluate(jsCode);

Credits

License

MIT