Shapes of the constructive geometries

A csg geometry is a tree of shapes: primitives combined by booleans, moved by transforms and copied by arrays. The flat domain of a surface and the profile of an extrusion or a revolution are 2D trees of the same kind. The sides (2D) and faces (3D) are the names used by the edges and faces selections.

rectangle (2D)

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

Lower corner

min

numbers or expressions of parameters, one per coordinate, or a vector parameter

Upper corner

max

numbers or expressions of parameters, one per coordinate, or a vector parameter

Sides: xmin, xmax, ymin, ymax.

ball (2D): disk

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

Center

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Radius

radius

number or expression of parameters

Sides: circle.

ellipse

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

Center

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Semi-axes

radii

numbers or expressions of parameters, one per coordinate, or a vector parameter

Angle (degrees)

angle

number or expression of parameters. Angle of the first semi-axis with the x axis

Sides: ellipse.

polygon

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

Vertices

points

table of the vertices: x, y. Vertices in order (either direction); values or expressions. In the view, drag a vertex, the middle of a side (adds a vertex) or the center.

Sides: side1, side2, ....

Constraints of a polygon

The constraints of a polygon (sides and vertices numbered from 1; the values may be expressions of parameters):

Type

Constraint

Keys

horizontal

horizontal side

side

vertical

vertical side

side

length

length of a side

side, value

angle

angle at a vertex

vertex, value (degrees)

parallel

parallel sides

side, other

perpendicular

perpendicular sides

side, other

equal

sides of equal length

side, other

fixed

fixed vertex

vertex, at ([x, y])

coincident

vertex on a vertex of another polygon

vertex, shape (path of the other polygon), other (its vertex)

rectangle (3D): box

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

Lower corner

min

numbers or expressions of parameters, one per coordinate, or a vector parameter

Upper corner

max

numbers or expressions of parameters, one per coordinate, or a vector parameter

Faces: xmin, xmax, ymin, ymax, zmin, zmax.

ball (3D)

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

Center

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Radius

radius

number or expression of parameters

Faces: sphere.

ellipsoid

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

Center

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Semi-axes

radii

numbers or expressions of parameters, one per coordinate, or a vector parameter. along x, y and z (to turn it: Transform)

Faces: surface.

cylinder

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

Origin

origin

numbers or expressions of parameters, one per coordinate, or a vector parameter

Axis

axis

numbers or expressions of parameters, one per coordinate, or a vector parameter

Length

length

number or expression of parameters

Radius

radius

number or expression of parameters

Faces: side, start, end.

extrusion

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

From z to z

z

numbers or expressions of parameters, one per coordinate, or a vector parameter

Work plane

placement

one of xy (the (x, y) plane at the origin), custom (an origin and two axes). The plane of the profile: its x and y axes (r and z for a revolution); z is their cross product

The profile (2D shape below) is extruded along the normal of its plane.

Faces: bottom, top, and the faces swept by the sides of the profile (side with the reference of the side of the profile).

revolution

Field

Key

Value

Type

type

one of rectangle (box), ball, ellipsoid, cylinder, extrusion, revolution, union, intersection, difference

Work plane

placement

one of xy (the (x, y) plane at the origin), custom (an origin and two axes). The plane of the profile: its x and y axes (r and z for a revolution); z is their cross product

The profile (2D shape below) turns about the z axis of its plane (the profile is in the (r, z) plane).

Faces: the faces swept by the sides of the profile (side with the reference of the side of the profile).

union

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

The first shape is combined with the following ones.

intersection

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

The first shape is combined with the following ones.

difference

Field

Key

Value

Type

type

one of rectangle, ball (disk), ellipse, polygon, union, intersection, difference

The first shape is combined with the following ones.

transform (2D)

Field

Key

Value

Translation

translate

numbers or expressions of parameters, one per coordinate, or a vector parameter

Rotation (degrees)

angle

number or expression of parameters. Counterclockwise

Center of rotation

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

The shape below, turned about the center, then translated. Its sides and faces keep their selections.

transform (3D)

Field

Key

Value

Translation

translate

numbers or expressions of parameters, one per coordinate, or a vector parameter

Rotation (degrees)

angle

number or expression of parameters. Counterclockwise about the axis (right-hand rule)

Center of rotation

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Axis of rotation

axis

numbers or expressions of parameters, one per coordinate, or a vector parameter. The rotation is about the line through the center along this axis

The shape below, turned about the center, then translated. Its sides and faces keep their selections.

array: linear (2D)

Field

Key

Value

Kind

kind

one of linear (linear: translated by a step), circular (circular: turned by an angle)

Number of copies

count

number or expression of parameters. The shape itself included

Step

step

numbers or expressions of parameters, one per coordinate, or a vector parameter. From a copy to the next one

The union of copies of the shape below; a selection of a side or a face of the shape holds it on every copy.

array: circular (3D)

Field

Key

Value

Kind

kind

one of linear (linear: translated by a step), circular (circular: turned by an angle)

Number of copies

count

number or expression of parameters. The shape itself included

Center

center

numbers or expressions of parameters, one per coordinate, or a vector parameter

Angle between copies (degrees)

angle

number or expression of parameters. 360 / number of copies for a full turn

Axis of rotation

axis

numbers or expressions of parameters, one per coordinate, or a vector parameter. The rotation is about the line through the center along this axis

The union of copies of the shape below; a selection of a side or a face of the shape holds it on every copy.