Skip to content

OCCsurface ¤

OCCSurface(native_surface: Geom_Surface, name: str | None = None)

Class representing a general surface object.

Parameters:

  • native_surface (Geom_Surface) –

    The native OCC surface.

  • name (str | None, default: None ) –

    The name of the surface.

Attributes:

  • continuity

    The degree of continuity of the surface.

  • degree_u

    The degree of the surface in the U direction.

  • degree_v

    The degree of the surface in the V direction.

  • domain_u (tuple[float, float]) –

    The parameter domain of the surface in the U direction.

  • domain_v (tuple[float, float]) –

    The parameter domain of the surface in the V direction.

  • is_periodic_u (bool) –

    Flag indicating if the surface is periodic in the U direction.

  • is_periodic_v (bool) –

    Flag indicating if the surface is periodic in the V direction.

Functions¤

aabb ¤

aabb(precision: float = 0.0, optimal: bool = False) -> Box

Compute the axis aligned bounding box of the surface.

Parameters:

  • precision (float, default: 0.0 ) –

    The precision for the bounding box computation.

  • optimal (bool, default: False ) –

    Whether to compute an optimal bounding box.

Returns:

boundary ¤

boundary() -> list[OCCCurve]

Compute the boundary curves of the surface.

Returns:

closest_point ¤

closest_point(
    point: Point, return_parameters: bool = False
) -> Point | tuple[Point, tuple[float, float]]

Compute the closest point on the curve to a given point.

Parameters:

  • point (Point) –

    The point to project to the surface.

  • return_parameters (bool, default: False ) –

    If True, return the surface UV parameters in addition to the closest point.

Returns:

  • Point | tuple[Point, tuple[float, float]]

    If return_parameters is False, the nearest point on the surface. If return_parameters is True, the UV parameters in addition to the nearest point on the surface.

copy ¤

copy() -> OCCSurface

Make an independent copy of the current surface.

Returns:

curvature_at ¤

curvature_at(u: float, v: float) -> Vector

Compute the curvature at a point on the surface.

Parameters:

  • u (float) –

    The U parameter.

  • v (float) –

    The V parameter.

Returns:

frame_at ¤

frame_at(u: float, v: float) -> Frame

Compute the local frame at a point on the curve.

Parameters:

  • u (float) –

    The U parameter.

  • v (float) –

    The V parameter.

Returns:

from_face classmethod ¤

from_face(face: TopoDS_Face) -> OCCSurface

Construct a surface from an existing OCC TopoDS_Face.

Parameters:

  • face (TopoDS_Face) –

    An OCC face in wich the surface is embedded.

Returns:

from_native classmethod ¤

from_native(native_surface: Geom_Surface) -> OCCSurface

Construct a surface from an existing OCC Surface.

Parameters:

  • native_surface (Geom_Surface) –

    An OCC surface.

Returns:

from_occ classmethod ¤

from_occ(native_surface: Geom_Surface) -> OCCSurface

Construct a surface from an existing OCC Surface.

Parameters:

  • native_surface (Geom_Surface) –

    An OCC surface.

Returns:

Warnings

.. deprecated:: 1.3 Use from_native instead

gaussian_curvature_at ¤

gaussian_curvature_at(u: float, v: float) -> float

Compute the Gaussian curvature at a point on the surface.

Parameters:

  • u (float) –

    The U parameter.

  • v (float) –

    The V parameter.

Returns:

intersections_with_curve ¤

intersections_with_curve(curve: OCCCurve) -> list[Point]

Compute the intersections with a curve.

Parameters:

  • curve (OCCCurve) –

    The intersecting curve.

Returns:

intersections_with_line ¤

intersections_with_line(line: Line) -> list[Point]

Compute the intersections with a line.

Parameters:

  • line (Line) –

    The intersecting line.

Returns:

isocurve_u ¤

isocurve_u(u: float) -> OCCCurve

Compute the isoparametric curve at parameter u.

Parameters:

  • u (float) –

    The parameter value.

Returns:

isocurve_v ¤

isocurve_v(v: float) -> OCCCurve

Compute the isoparametric curve at parameter v.

Parameters:

  • v (float) –

    The parameter value.

Returns:

mean_curvature_at ¤

mean_curvature_at(u: float, v: float) -> float

Compute the mean curvature at a point on the surface.

Parameters:

  • u (float) –

    The U parameter.

  • v (float) –

    The V parameter.

Returns:

obb ¤

obb(precision: float = 0.0) -> Box

Compute the oriented bounding box of the surface.

Parameters:

  • precision (float, default: 0.0 ) –

    The precision for the bounding box computation.

Returns:

point_at ¤

point_at(u: float, v: float) -> Point

Compute a point on the surface.

Parameters:

Returns:

to_step ¤

to_step(filepath: str, schema: str = 'AP203') -> None

Write the surface geometry to a STP file.

Parameters:

  • filepath (str) –

    The path to the output file.

  • schema (str, default: 'AP203' ) –

    The STEP schema to use.

Returns:

  • None

to_tesselation ¤

to_tesselation() -> Mesh

Convert the surface to a triangle mesh.

Returns:

  • Mesh

    The tesselated surface as a triangle mesh.

transform ¤

transform(T: Transformation) -> None

Transform this surface.

Parameters:

Returns:

  • None