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

Example: csg_cube

test

// Copyright © 2025-2026 The µcad authors <info@microcad.xyz>
// SPDX-License-Identifier: AGPL-3.0-or-later

use std::math::*;
use std::ops::*;
use std::geo3d::*;

part CsgCube(size: Length) {
    s = size / sqrt(2.1);
    body = Sphere(radius = s) & Cube(size);
    holes = Cylinder(size, diameter = s).orient([X, Y, Z]);
    body - holes;
}

CsgCube(50mm);

2D Output : None

3D Output : None