BRep

class compas_occ.brep.BRep[source]

Bases: object

Class for Boundary Representation of geometric entities.

Attributes
  • shape (TopoDS_Shape) – The underlying OCC shape of the BRep.

  • type (TopAbs_ShapeEnum, read-only) – One of {TopAbs_COMPOUND, TopAbs_COMPSOLID, TopAbs_SOLID, TopAbs_SHELL, TopAbs_FACE, TopAbs_WIRE, TopAbs_EDGE, TopAbs_VERTEX, TopAbs_SHAPE}.

  • vertices (list of BRepVertex, read-only) – The vertices of the BRep.

  • edges (list of BRepEdge, read-only) – The edges of the BRep.

  • loops (list of BRepLoop, read-only) – The loops of the BRep.

  • faces (list of BRepFace, read-only) – The faces of the BRep.

  • orientation (TopAbs_Orientation, read-only) – One of {TopAbs_FORWARD, TopAbs_REVERSED, TopAbs_INTERNAL, TopAbs_EXTERNAL}.

  • 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.

Methods

contours

cull_unused_edges

cull_unused_faces

cull_unused_loops

cull_unused_vertices

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_cone

Construct a BRep from a COMPAS cone.

from_corners

Construct a BRep from 3 or 4 corner points.

from_curves

from_cylinder

Construct a BRep from a COMPAS cylinder.

from_mesh

Construct a BRep from a COMPAS mesh.

from_polygons

Construct a BRep from a set of polygons.

from_sphere

Construct a BRep from a COMPAS sphere.

from_torus

Construct a BRep from a COMPAS torus.

is_closed

Check if the shape is closed.

is_convex

Check if the shape is convex.

is_infinite

Check if the shape is infinite.

is_manifold

is_orientable

Check if the shape is orientable.

is_solid

is_surface

make_solid

to_json

Export the BRep to a JSON file.

to_meshes

Convert the faces of the BRep shape to meshes.

to_step

Write the BRep shape to a STEP file.

to_tesselation

Create a tesselation of the shape for visualisation.