Constructive geometry of solids
With its name derived from the English CSG (Constructive Solid Geometry), constructive geometry of solids or GCS is a technique used for solid modeling, which consists of creating complex bodies from geometries elements (cubes, spheres, cones) combining them with Boolean operations such as union and intersection. The generation of elementary geometries and their combination with Boolean operations is often expressed as code in a programming language. There are ad hoc languages for this technique, and also numerous libraries for using GCS with popular languages.
Primitives
The elementary geometries available for this type of modeling are called primitives, which usually includeː
- cubes and parallels
- circular and polygonal cylinders
- spheres and ellipsoids
- polygonal base cones, optionally truncated
Primitives are the initial solids, predefined objects in the GCS application and parametric (initial dimensions are set to them when they are created). The user models from the available primitives and combining them to create complex models.
In the conception of constructive geometry the primitives form a closed set and the user cannot create new primitives, but only model by combining the available primitives. In practice, GCS applications often provide the user with means to express other initial geometries. The most common case is the extrusion of a 2D figure, the user generates an arbitrary 2D polygon with segments, and uses it as a template to generate a solid, giving it thickness in a third dimension.
Parameters
The user incorporates a primitive into his model by creating an instance of it, with a series of parameters, some general and others specific to the primitive, for exampleː
- Scale
- size of the primitive
- starts being of unit size, the final size is expressed as a composite climbing in each of the three dimensions
- usually represented as the scale on Cartesian axles x, y, z
- Translation (part 3D of the body)
- each primitive has an anchor point used to define its position
- this point is usually a vertex, in other cases it is the baricentro of the primitive
- Rotation (3D orientation)
- usually represented as a succession of 3 rotations around the Cartesian axles x, and, z
- Primitives are created in the canonical coordinates, and they need to be moved and rotated to achieve the right pose in the model
- Specific parameters of the primitive
- For example, a cone and a cylinder require determining the number of sides of the regular polygon that will serve as a base
Build Operations
Modeling is done by combining primitives. Some operations on bodiesː
- Unarias, on a body
- Translating
- Rotation
- Scale
- Binaries, over two bodies
- Union
- Intersection
- Variance
Applications
This modeling technique finds its niche in mechanical modeling, specifically in parametric design, where parts with precise dimensions and technical specifications are designed. This type of design contrasts with artistic design, which is more intuitive and spontaneous. For this reason this modeling technique is rarely used outside of engineering.