OCCBrepFace
¤
Class representing a face in the BRep of a geometric shape.
Parameters:
-
occ_face(TopoDS_Face) –An OCC BRep face.
Attributes:
-
vertices(list[OCCBrepVertex]) –List of BRep vertices.
-
edges(list[OCCBrepEdge]) –List of BRep edges.
-
loops(list[OCCBrepLoop]) –List of BRep loops.
-
surface–Surface geometry from the adaptor.
Functions¤
__from_data__
classmethod
¤
__from_data__(data: dict) -> OCCBrepFace
Construct an object of this type from the provided data.
Parameters:
-
data(dict) –The data dictionary.
Returns:
-
OCCBrepFace–An instance of this object type if the data contained in the dict has the correct schema.
add_loop
¤
add_loop(loop: OCCBrepLoop, reverse: bool = False) -> None
Add an inner loop to the face.
Parameters:
-
loop(OCCBrepLoop) –The additional loop.
Returns:
-
None–
add_loops
¤
add_loops(loops: list[OCCBrepLoop], reverse: bool = False) -> None
Add an inner loop to the face.
Parameters:
-
loops(list[OCCBrepLoop]) –The additional loops.
Returns:
-
None–
from_cone
classmethod
¤
from_cone(
cone: Cone, loop: OCCBrepLoop | None = None, inside: bool = True
) -> OCCBrepFace
Construct a face from a cone.
Parameters:
-
cone(Cone) –The cone.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
optional(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
from_cylinder
classmethod
¤
from_cylinder(
cylinder: Cylinder, loop: OCCBrepLoop | None = None, inside: bool = True
) -> OCCBrepFace
Construct a face from a cylinder.
Parameters:
-
cylinder(Cylinder) –The cylinder.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
optional(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
from_plane
classmethod
¤
from_plane(
plane: Plane,
domain_u: tuple[float, float] | None = None,
domain_v: tuple[float, float] | None = None,
loop: OCCBrepLoop | None = None,
inside: bool = True,
) -> OCCBrepFace
Construct a face from a plane.
Parameters:
-
plane(Plane) –The plane.
-
domain_u(tuple[float, float], default:None) –U parameter minimum and maximum.
-
domain_v(tuple[float, float], default:None) –V parameter minimum and maximum.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
optional(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
from_polygon
classmethod
¤
from_polygon(points: Polygon) -> OCCBrepFace
from_sphere
classmethod
¤
from_sphere(
sphere: Sphere, loop: OCCBrepLoop | None = None, inside: bool = True
) -> OCCBrepFace
Construct a face from a sphere.
Parameters:
-
sphere(Sphere) –The sphere.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
optional(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
from_surface
classmethod
¤
from_surface(
surface: OCCSurface,
domain_u: tuple[float, float] | None = None,
domain_v: tuple[float, float] | None = None,
precision: float = 1e-06,
loop: OCCBrepLoop | None = None,
inside: bool = True,
) -> OCCBrepFace
Construct a face from a surface.
Parameters:
-
surface(OCCSurface) –The torus.
-
domain_u(tuple[float, float] | None, default:None) –U parameter minimum and maximum.
-
domain_v(tuple[float, float] | None, default:None) –V parameter minimum and maximum.
-
precision(float, default:1e-06) –Precision for face construction.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
from_torus
classmethod
¤
from_torus(
torus: Torus, loop: OCCBrepLoop | None = None, inside: bool = True
) -> OCCBrepFace
Construct a face from a torus.
Parameters:
-
torus(Torus) –The torus.
-
loop(OCCBrepLoop | None, default:None) –A boundary loop.
-
optional(OCCBrepLoop | None, default:None) –A boundary loop.
-
inside(bool, default:True) –If True, the face is inside the boundary loop.
Returns:
is_equal
¤
is_equal(other: OCCBrepFace) -> bool
Check if this face is equal to another face.
Two faces are equal if they have the same location and orientation.
Parameters:
-
other(OCCBrepFace) –The other face.
Returns:
-
bool–Trueif the faces are equal,Falseotherwise.
is_same
¤
is_same(other: OCCBrepFace) -> bool
Check if this face is the same as another face.
Two faces are the same if they have the same location.
Parameters:
-
other(OCCBrepFace) –The other face.
Returns:
-
bool–Trueif the faces are the same,Falseotherwise.
to_nurbs
¤
to_nurbs() -> NurbsSurface
to_polygons
¤
try_get_nurbssurface
¤
try_get_nurbssurface(
precision=0.001,
continuity_u=None,
continuity_v=None,
maxdegree_u=5,
maxdegree_v=5,
maxsegments_u=1,
maxsegments_v=1,
) -> OCCNurbsSurface
Try to convert the underlying geometry to a Nurbs surface.