Quick Start
Welcome to the tscad documentation!
Introduction
tscad is a CAD modeller for programmers. It is designed to provide a modern developer experience with a focus on TypeScript and JavaScript, allowing users to create parametric CAD models using familiar programming languages and modern tools.
Jump right in:
Playground
Go ahead and try out the tscad playground to get a feel for how it works.
Usage
Learn how to get started with tscad, including installation and basic usage.
Want to learn more?
Check out the more detailed What is tscad? introduction.
tscad models
A model usually consists of a single TypeScript or JavaScript module, which exports a model:
import { } from '@tscad/modeling';
export default ({
// model definition goes here
});The model function
Each model needs a model function that returns the CAD geometry. You can use the built-in primitives and operations from tscad to create your model.
import { } from '@tscad/modeling';
import { } from '@tscad/modeling/primitives';
/** A simple model that renders as a cube */
export default ({
: () => ({ : 10 }),
});Previewing models
The simplest way to preview your model is to use the online playground. Just copy-paste your code into the editor and see the result immediately.
Define model parameters
You can define parameters for your model using the defineModel function. This allows you to create parametric models that can be easily adjusted.
export default ({
: {
: { : 'number', : 10, : 1, : 100, : 1 },
},
: ...
});Use model parameters
As soon as parameters are defined, you can use them in your model function:
export default ({
: {
: { : 'number', : 10, : 1, : 100, : 1 },
},
: ({ }) => ({ : }),
});Next steps
🎉 Congratulations! You're ready to dive deeper into tscad!