Brep

class compas.geometry.Brep[source]

Bases: Geometry

Contains the topological and geometrical information of a Brep shape.

This class serves as an interface for a Brep and allows instantiating a Brep object depending on the available Backend. Note: this is not a full implementation of Brep and rather relies on COMPAS’s plugin system for actual implementation.

Attributes:
areafloat, read-only

The surface area of the Brep.

centroidcompas.geometry.Point, read-only

The centroid of this brep.

curveslist[Curve], read-only

The edge curves of this brep.

edgeslist[compas.geometry.BrepEdge], read-only

The edges of the Brep.

faceslist[compas.geometry.BrepFace], read-only

The faces of the Brep.

framecompas.geometry.Frame, read-only

The local coordinate system of the Brep.

is_closedbool, read-only

True if this brep is closed, False otherwise.

is_compoundbool, read-only

True if this brep’s type is a compound, False otherwise.

is_compoundsolidbool, read-only

True if this brep’s type is a compoundsolid, False otherwise.

is_convexbool, read-only

True if this brep is convex, False otherwise.

is_infinitebool, read-only

True if this brep is infinite, False otherwise.

is_manifoldbool, read-only

True if this brep is a manifold, False otherwise.

is_orientablebool, read-only

True if this brep is orientable, False otherwise.

is_shellbool, read-only

True if this brep is a shell, False otherwise.

is_solidbool, read-only

True if this brep is a solid, False otherwise.

is_surfacebool, read-only

True if this brep is a surface, False otherwise.

is_validbool, read-only

True if this brep is valid, False otherwise

loopslist[compas.geometry.BrepLoop], read-only

The loops of the Brep.

native_brepAny

The backend specific brep object.

orientationliteral(BrepOrientation)

One of [FORWARD, REVERSE, INTERNAL, EXTERNAL], read-only

pointslist[compas.geometry.Point], read-only

The points of this brep.

shellslist[compas.geometry.Brep], read-only

The shells of this brep.

solidslist[compas.geometry.Brep], read-only

The solids of this brep.

surfaceslist[Surface], read-only

The face surfaces of this brep.

trimslist[compas.geometry.BrepTrim], read-only

The trims of the Brep.

typeliteral(BrepType), read-only

One of [COMPOUND, COMPSOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE]

verticeslist[compas.geometry.BrepVertex], read-only

The vertices of the Brep.

volumefloat, read-only

The volume of the regions contained by the Brep.

Methods

contains

Check if the Brep contains a given geometric primitive.

contours

Generate contour lines by slicing the Brep shape with a series of planes.

cull_unused_edges

Remove all unused edges.

cull_unused_faces

Remove all unused faces.

cull_unused_loops

Remove all unused loops.

cull_unused_vertices

Remove all unused vertices.

edge_faces

Identify the faces connected to a given edge.

edge_loop

Identify the parent loops of the a given edge.

fillet

Fillet the edges of the Brep.

filleted

Construct a filleted copy of the Brep.

fix

Fix the shell.

from_boolean_difference

Construct a Brep from the boolean difference of two other Breps.

from_boolean_intersection

Construct a BRep from the boolean intersection of two other Breps.

from_boolean_union

Construct a Brep from the boolean union of two other Breps.

from_box

Construct a Brep from a COMPAS box.

from_brepfaces

Make a Brep from a list of Brep faces forming an open or closed shell.

from_breps

Construct one compound Brep from a list of other Breps.

from_cone

Construct a Brep from a COMPAS cone.

from_curves

Construct a Brep from a set of curves.

from_cylinder

Construct a Brep from a COMPAS cylinder.

from_extrusion

Construct a Brep by extruding a closed curve along a direction vector.

from_iges

Construct a Brep from the data contained in an IGES file.

from_loft

Construct a Brep by lofting a set of curves.

from_mesh

Construct a Brep from a COMPAS mesh.

from_native

Creates a Brep from an instance of a native backend Brep type.

from_pipe

Construct a Brep by extruding a closed curve along a path curve.

from_plane

Construct a Brep from one plane and its u and v domains.

from_planes

Construct a Brep from a set of planes.

from_polygons

Construct a Brep from a set of polygons.

from_sphere

Construct a Brep from a COMPAS sphere.

from_step

Conctruct a Brep from the data contained in a STEP file.

from_sweep

Construct a BRep by sweeping a profile along a path.

from_torus

Construct a Brep from a COMPAS torus.

heal

Heal the shape.

make_solid

Convert the current shape to a solid if it is a shell.

overlap

Compute the overlap between this BRep and another.

sew

Sew together the individual parts of the shape.

slice

Slice through the BRep with a plane.

split

Slice through the BRep with a plane.

to_iges

Write the Brep shape to an IGES file.

to_meshes

Convert the faces of this Brep shape to meshes.

to_polygons

Convert the faces of this Brep shape to polygons.

to_step

Write the Brep shape to a STEP file.

to_stl

Write the Brep shape to an STL file.

to_tesselation

Create a tesselation of the shape for visualisation.

to_viewmesh

Convert this Brep to a view mesh.

trim

Trim this Brep using the given trimming plane.

trimmed

Returns a trimmed copy of this Brep using the given trimming plane.

vertex_edges

Identify the edges connected to a given vertex.

vertex_faces

Identify the faces connected to a vertex.

vertex_neighbors

Identify the neighbouring vertices of a given vertex.

Inherited Methods

ToString

Converts the instance to a string.

compute_aabb

Compute the axis-aligned bounding box of the geometry.

compute_obb

Compute the oriented bounding box of the geometry.

copy

Make an independent copy of the data object.

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.

transform

Transform the geometry.

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.