primitives-3D

Methods

Antiprism(parameters) → {Solid}

Creates an antiprism based on the specified parameters. An antiprism is a polyhedron with two parallel polygonal bases connected by alternating triangular faces.

Parameters:
NameTypeDescription
parametersObject

The parameters for the antiprism.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the antiprism is constructed.

centerVector<optional>
Vector.ZERO

The center of the antiprism.

radiusnumber

The radius of the circumscribed circle of the base polygons.

verticesnumber

The number of vertices for the base polygons.

Returns:

A Solid object representing the constructed antiprism.

Type: 
Solid

Cone(parameters) → {Solid}

Creates a cone based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the cone.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the cone is constructed.

centerVector<optional>
Vector.ZERO

The center of the cone.

topRadiusnumber

The radius of the cone's top face.

bottomRadiusnumber

The radius of the cone's bottom face.

heightnumber

The height of the cone.

Returns:

A Solid object representing the constructed cone.

Type: 
Solid

Cube(parameters) → {Solid}

Creates a cube based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the cube.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the cube is constructed.

centerVector<optional>
Vector.ZERO

The center of the cube.

sizenumber

The size of the cube.

Returns:

A Solid object representing the constructed cube.

Type: 
Solid

Cuboid(parameters) → {Solid}

Creates a cuboid based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the cuboid.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the cuboid is constructed.

centerVector<optional>
Vector.ZERO

The center of the cuboid.

widthnumber

The width of the cuboid (along the X-axis).

heightnumber

The height of the cuboid (along the Y-axis).

depthnumber

The depth of the cuboid (along the Z-axis).

Returns:

A Solid object representing the constructed cuboid.

Type: 
Solid

Cylinder(parameters) → {Solid}

Creates a cylinder based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the cylinder.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the cylinder is constructed.

centerVector<optional>
Vector.ZERO

The center of the cylinder.

radiusnumber

The radius of the cylinder's base.

heightnumber

The height of the cylinder.

Returns:

A Solid object representing the constructed cylinder.

Type: 
Solid

Sphere(parameters) → {Solid}

Creates a sphere based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the sphere.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the sphere is constructed.

centerVector<optional>
Vector.ZERO

The center of the sphere.

radiusnumber

The radius of the sphere.

Returns:

A Solid object representing the constructed sphere.

Type: 
Solid

Torus(parameters) → {Solid}

Creates a 3D torus solid based on the specified parameters.

Parameters:
NameTypeDescription
parametersObject

The parameters for the torus.

Properties
NameTypeAttributesDefaultDescription
planePlane<optional>
Plane.XY

The plane in which the torus is constructed.

centerVector<optional>
Vector.ZERO

The center of the torus.

majorRadiusnumber

The major radius of the torus (distance from the center to the middle of the tube).

minorRadiusnumber

The minor radius of the torus (radius of the tube).

Returns:

A Solid object representing the constructed torus.

Type: 
Solid