Geometry & modeling
CSG
Constructive solid geometry
Definition
CSG builds a shape by combining simple solids, such as cubes, cylinders, and spheres, with boolean union, difference, and intersection. OpenSCAD models are written this way, which makes them easy for people and language models to express as code.
Also known as: constructive solid geometry, boolean modeling
Updated
How CSG reads#
A plate with a hole in CSG is one operation: the difference between a cube and a cylinder. The OpenSCAD manual covers the three core operations: union, difference, and intersection. OpenSCAD combines CSG with extrusion of 2D outlines as its two main modeling techniques.
The limit is that CSG describes shapes, not engineering intent. Fillets on arbitrary edges, drafts, and shelled bodies are hard to express, and OpenSCAD exports meshes such as STL rather than B-Rep STEP.
Sources
Related terms
OpenSCAD
OpenSCAD is free, open-source CAD software where models are written as code using constructive solid geometry and extrusion of 2D outlines. Because the whole model is text, it is one of the easiest CAD targets for LLMs to generate and edit.
B-Rep
B-Rep is the way professional CAD kernels describe a solid: by its boundary, made of exact surfaces (faces), the curves where they meet (edges), and the points where edges end (vertices). Because the geometry is exact and the topology is explicit, B-Rep models can be measured, filleted, dimensioned, and manufactured precisely.
CadQuery
CadQuery is an open-source Python library for building parametric CAD models in code on top of the Open CASCADE kernel. It can export STEP as well as STL and 3MF, which makes it a common target when LLMs are asked to write CAD scripts.