tscad is in early development
DocsIntroductionQuick Start

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:

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:

A simple tscad 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.

A simple tscad 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.

TODO: Add playground screenshot

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.

A parametric tscad model
export default ({
  : { 
    : { : 'number', : 10, : 1, : 100, : 1 },
  },
  : ...
});

Use model parameters

As soon as parameters are defined, you can use them in your model function:

A parametric tscad model
export default ({
  : {
    : { : 'number', : 10, : 1, : 100, : 1 },
  },
  : ({  }) => ({ :  }), 
});

Next steps

🎉 Congratulations! You're ready to dive deeper into tscad!