Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sketches

Sketches are similar to parts but in two dimensions only. They may be extruded into three-dimensional parts by using operations. Sketches are named in PascalCase:

test

sketch MySketch(radius: Length) {
    use std::geo2d::*;
    Circle(radius) - Rect(size = radius);
}

MySketch(1cm);

The output is a 2D sketch:

test

Restrictions

Sketches cannot generate 3D models

You will get an error if you generate a 3D model with a sketch:

test

sketch MySketch(radius: Length) {
    use std::geo3d::*;
    Sphere(radius) - Cube(size = radius); // error: Sphere and Cube are 3D
}

MySketch(1cm);