Extrusion

class compas_ifc.representations.Extrusion(profile, direction, depth, frame=None, name=None)

Bases: Geometry

A solid defined by sweeping a 2D profile along a direction.

Directly corresponds to IfcExtrudedAreaSolid. Preserves the parametric data that is lost when ifcopenshell evaluates the shape into tessellated or OCC geometry.

Parameters:
profilePolygon | Circle | tuple[Polygon, list[Polygon]]

The swept 2D profile. A Polygon for simple closed profiles, a Circle for circular profiles, or a (outer, [inner, ...]) tuple for profiles with voids.

directionVector

Unit direction of the extrusion (in local frame coordinates).

depthfloat

Length of the extrusion along direction.

frameFrame, optional

Local placement of the extrusion solid. Corresponds to IfcExtrudedAreaSolid.Position.

namestr, optional

Optional name for the extrusion.

Attributes:
profilePolygon | Circle | tuple[Polygon, list[Polygon]]

The swept 2D profile.

directionVector

Extrusion direction.

depthfloat

Extrusion depth.

frameFrame

Local coordinate frame.

namestr or None

Optional name.

Methods

__init__

compute_aabb

Compute the axis-aligned bounding box of the geometry.

copy

Return a deep copy of this extrusion.

surface_area

Compute the exact surface area of the extrusion.

to_mesh

Convert the extrusion to a compas.datastructures.Mesh.

to_vertices_and_faces

Discretise the extrusion into vertices and faces.

transform

Transform the extrusion by transforming its frame.

volume

Compute the exact volume of the extrusion.

Inherited Methods

ToString

Converts the instance to a string.

compute_obb

Compute the oriented bounding box of the geometry.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

rotate

Rotate the geometry.

rotated

Returns a rotated copy of this geometry.

scale

Scale the geometry.

scaled

Returns a scaled copy of this geometry.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

transformed

Returns a transformed copy of this geometry.

translate

Translate the geometry.

translated

Returns a translated copy of this geometry.

validate_data

Validate the data against the object's data schema.