Skip to content

cad-kitchen/ncad-examples

Repository files navigation

nCAD Stirrup IFC Demo

Interactive demo for building a reinforcing stirrup with nCAD, exporting an IFC representation, and previewing it in the browser.

The app asks the nCAD server to build the analytic stirrup axis and swept solid. The client then creates an IFC IfcIndexedPolyCurve + IfcSweptDiskSolid preview and renders it with ThatOpen Components.

Requirements

  • Bun 1.2+
  • A running nCAD server
  • The sibling ncad repository checked out next to this repository

The local SDK dependency is intentionally resolved as file:../ncad/sdk, so the expected directory layout is:

cadki/
|-- ncad/
|   `-- sdk/
`-- ncad-demo/

Development

Start the nCAD server:

cd ../ncad
make server-dev

Start the demo:

bun install
bun run dev

Open http://127.0.0.1:5177/.

The demo proxies /api and /health to NCAD_URL. The default is http://127.0.0.1:8080.

Use another nCAD server URL when needed:

NCAD_URL=http://127.0.0.1:8082 bun run dev

Build

bun run build

Serve the built dist/ output:

bun run start

Test

The integration test requires a running nCAD server:

bun run test

Docker

Build from inside ncad-demo with the parent directory as Docker context, so the image build can read the sibling ncad/sdk package:

docker build --platform=linux/amd64 -f ./Dockerfile -t kuzmo/ncad-demo:0.0.1-alpha ..

Push:

docker push kuzmo/ncad-demo:0.0.1-alpha

Run locally against a host nCAD server:

docker run --rm -p 5177:5177 \
  -e NCAD_URL=http://host.docker.internal:8080 \
  kuzmo/ncad-demo:0.0.1-alpha

Configuration

Variable Default Purpose
NCAD_URL http://127.0.0.1:8080 Base URL for the nCAD server.
NCAD_SERVER_URL unset Backward-compatible fallback for tests and scripts.
HOST 127.0.0.1 in local runtime, 0.0.0.0 in Docker HTTP bind host.
PORT 5177 HTTP bind port.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages