# CSGRegion

CSGRegion["op",{reg1,reg2,}]

represents the solid region corresponding to the Boolean combination "op" of regions reg1,reg2,.

CSGRegion["op",{,wi[regi],}]

represents the solid region defined by regions regi transformed by a geometric transformation wi.

# Details and Options    • CSGRegion is also known as constructive solid geometry (CSG) object.
• CSGRegion is typically used to construct solid geometric regions by using nested combinations of union, intersection and subtraction of simple geometric primitives.
• • CSGRegion[] displays in a notebook as a plot of a solid region in 2D and 3D.
• In CSGRegion["op",{reg1,reg2,}], "op" are Boolean operations and regions regi are other CSGRegion objects or geometric regions.
• The following Boolean operators "op" can be used:
• "Intersection" smallest solid containing the intersection of two regions "Difference" smallest solid containing the difference of two regions "Union" smallest solid containing the union of two regions
• The following 2D solids regions regi are supported:
• Disk disk Ellipsoid ellipsoid Parallelogram parallelogram Rectangle rectangle Triangle triangle Simplex simplex
• The following 3D solid regions regi are supported:
• Ball ball Cone cone Cube cube Cuboid cuboid Cylinder cylinder Dodecahedron dodecahedron Ellipsoid ellipsoid Icosahedron icosahedron Octahedron octahedron Parallelepiped parallelepiped Prism prism Pyramid pyramid Simplex simplex Tetrahedron tetrahedron
• The following ndimensional solid regions regi are supported:
• Ball ball Cuboid axis-aligned cuboid Ellipsoid ellipsoid Parallelepiped parallelotope Simplex simplex
• In CSGRegion["op",{,wi[regi],}], wi are geometric transformations or wrappers for regions regi.
• The following geometric transformations wi can be used:
•  GeometricTransformation[regi,…] geometric affine transformation Rotate[regi,…] rotation Scale[regi,…] scaling Translate[regi,…] translation
• CSGRegion takes the same options as Region.
• CSGRegion can be used with functions such as RegionMember, RegionDistance, RegionMeasure and NIntegrate.

# Examples

open allclose all

## Basic Examples(2)

Intersection of two solid regions in 2D:

Its area:

Intersection of two solid regions in 3D:

Its volume:

## Scope(3)

CSG regions Union:

Difference:

Intersection:

One-level CSG region:

Nested CSG region:

Union with more than two regions:

CSG regions in 2D:

3D:

nD:

## Applications(7)

### Basic Applications(4)

Construct a nested annulus:

CSGRegion using multiple operations:

Create polyhedron with rounded corners:

Model complex objects: Construct a rail support:

Construct a pipe guide bracket:

Construct a universal joint:

## Properties & Relations(4)

Compute the union of two regions:

CSG regions can be represented as Boolean regions:

A CSGRegion object is solid:

The embedding dimension of a CSG region is the same as its geometry dimension:

## Interactive Examples(3)

Create an interactive CSG region to visualize the intersection of multiple draggable disks:

Create an interactive CSG region with draggable points. Click the region to add and remove draggable points:

Separate an object into multiple chunks:

## Neat Examples(2)

Create polyhedron shells:

Separate an object into chunks: