Quick Start
Render your first 3D model with @taucad/runtime in under 4 minutes.
Quick Start
Render a 3D model from TypeScript code using the Replicad kernel. You will install the package, create a runtime client, and render geometry to glTF.
Prerequisites
- Node.js 20 or later
- A package manager: npm, pnpm, or yarn
Install
pnpm add @taucad/runtimeFor framework-specific configuration (Vite, Node.js), see Installation.
Render a 3D Model
Create a file called render.ts and paste the following code:
import { createRuntimeClient, presets } from '@taucad/runtime';
const client = createRuntimeClient(presets.all());
const result = await client.render({
code: {
'main.ts': `
import { drawRoundedRectangle } from 'replicad';
export default function main() {
return drawRoundedRectangle(30, 50, 5).sketchOnPlane('XY').extrude(10);
}
`,
},
});
if (result.success) {
console.log(`Rendered ${result.data.length} geometries`);
console.log(`Format: ${result.data[0].format}`);
} else {
console.error('Render failed:', result.issues);
}
client.terminate();presets.all() includes all built-in kernels, middleware, and bundlers. For tree-shaking, configure individual plugins with createRuntimeClientOptions:
import { createRuntimeClient, createRuntimeClientOptions, fromMemoryFS } from '@taucad/runtime';
import { replicad } from '@taucad/runtime/kernels';
import { esbuild } from '@taucad/runtime/bundler';
const options = createRuntimeClientOptions({
kernels: [replicad()],
bundlers: [esbuild()],
fileSystem: fromMemoryFS(),
});
const client = createRuntimeClient(options);Expected Output
Rendered 1 geometries
Format: gltfEach entry in result.data is a Geometry object containing a glTF binary (GLB) that you can display in any 3D viewer, save to disk, or pass to a renderer like Three.js.
What's Next
- Your First Kernel -- Build parametric models with parameters and STEP export
- Choose a Kernel -- Compare Replicad, OpenCASCADE, Manifold, OpenSCAD, JSCAD, and Zoo
- API Reference: Client -- Full documentation for
createRuntimeClient