Skip to content

OCCBrepFace ¤

OCCBrepFace(occ_face: TopoDS_Face)

Class representing a face in the BRep of a geometric shape.

Parameters:

  • occ_face (TopoDS_Face) –

    An OCC BRep face.

Attributes:

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:

Returns:

  • None

add_loops ¤

add_loops(loops: list[OCCBrepLoop], reverse: bool = False) -> None

Add an inner loop to the face.

Parameters:

Returns:

  • None

fix ¤

fix() -> None

Try to fix the face.

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

Construct a BRep face from a polygon.

Parameters:

  • polygon

Returns:

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:

Returns:

  • bool

    True if the faces are equal, False otherwise.

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:

Returns:

  • bool

    True if the faces are the same, False otherwise.

is_valid ¤

is_valid() -> bool

Verify that the face is valid.

Returns:

to_cone ¤

to_cone() -> Cone

Convert the face surface geometry to a cone.

Returns:

to_cylinder ¤

to_cylinder() -> Cylinder

Convert the face surface geometry to a cylinder.

Returns:

to_nurbs ¤

to_nurbs() -> NurbsSurface

Convert the face surface geometry to a torus.

Returns:

to_plane ¤

to_plane() -> Plane

Convert the face surface geometry to a plane.

Returns:

to_polygon ¤

to_polygon() -> Polygon

Convert the face to a polygon without underlying geometry.

Returns:

to_polygons ¤

to_polygons() -> list[Polygon]

Convert the face to polygons without underlying geometry.

Returns:

to_sphere ¤

to_sphere() -> Sphere

Convert the face surface geometry to a sphere.

Returns:

to_torus ¤

to_torus() -> Torus

Convert the face surface geometry to a torus.

Returns:

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.