Brep
- class compas.geometry.Brep(*args, **kwargs)[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
vertices (list[
BrepVertex
], read-only) – The vertices of the Brep.edges (list[
BrepEdge
], read-only) – The edges of the Brep.trims (list[
BrepTrim
], read-only) – The trims of the Brep.loops (list[
BrepLoop
], read-only) – The loops of the Brep.faces (list[
BrepFace
], read-only) – The faces of the Brep.frame (
Frame
, read-only) – The local coordinate system of the Brep.area (float, read-only) – The surface area of the Brep.
volume (float, read-only) – The volume of the regions contained by the Brep.
solids (list[
Brep
], read-only) – The solids of this brep.shells (list[
Brep
], read-only) – The shells of this brep.points (list[
Point
], read-only) – The points of this brep.centroid (
Point
, read-only) – The centroid of this brep.is_valid (bool, read-only) – True if this brep is valid, False otherwise
is_solid (bool, read-only) – True if this brep is a solid, False otherwise.
is_compound (bool, read-only) – True if this brep’s type is a compound, False otherwise.
is_compoundsolid (bool, read-only) – True if this brep’s type is a compoundsolid, False otherwise.
is_orientable (bool, read-only) – True if this brep is orientable, False otherwise.
is_closed (bool, read-only) – True if this brep is closed, False otherwise.
is_infinite (bool, read-only) – True if this brep is infinite, False otherwise.
is_convex (bool, read-only) – True if this brep is convex, False otherwise.
is_manifold (bool, read-only) – True if this brep is a manifold, False otherwise.
is_surface (bool, read-only) – True if this brep is a surface, False otherwise.
- Other Attributes
native_brep – The underlying instance of the backend brep.
type (
BrepType
, read-only) – The type of Brep shape.orientation (
BrepOrientation
, read-obly) – Orientation of the shape.
Methods
Generate contour lines by slicing the Brep shape with a series of planes.
Remove all unused edges.
Remove all unused faces.
Remove all unused loops.
Remove all unused vertices.
Fix the shell.
Construct a Brep from the boolean difference of two other Breps.
Construct a BRep from the boolean intersection of two other Breps.
Construct a Brep from the boolean union of two other Breps.
Construct a Brep from a COMPAS box.
Make a Brep from a list of Brep faces forming an open or closed shell.
Construct a Brep from a COMPAS cone.
Construct a Brep from a set of curves.
Construct a Brep from a COMPAS cylinder.
Construct a Brep by extruding a closed curve along a direction vector.
Construct a Brep from a COMPAS mesh.
Creates a Brep from an instance of a native backend Brep type.
Construct a Brep from a set of polygons.
Construct a Brep from a COMPAS sphere.
Conctruct a Brep from the data contained in a STEP file.
Construct a BRep by sweeping a profile along a path.
Construct a Brep from a COMPAS torus.
Convert the current shape to a solid if it is a shell.
Compute the overlap between this BRep and another.
Sew together the individual parts of the shape.
Slice through the BRep with a plane.
Slice through the BRep with a plane.
Export the BRep to a JSON file.
Convert the faces of this Brep shape to meshes.
Write the BRep shape to a STEP file.
Create a tesselation of the shape for visualisation.
Convert this Brep to a view mesh.
Trim this Brep using the given trimming plane.
Identify the edges connected to a given vertex.
Identify the faces connected to a vertex.
Identify the neighbouring vertices of a given vertex.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from the provided data.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON string.
Transform the geometry.
Returns a transformed copy of this geometry.
Validate the object's data against its data schema.
Validate the object's data against its json schema.