Skip to content

OCCBrepEdge ¤

OCCBrepEdge(occ_edge: TopoDS_Edge)

Class representing an edge in the BRep of a geometric shape.

Parameters:

  • occ_edge (TopoDS_Edge) –

    An OCC BRep edge.

Attributes:

  • curve (Curve) –

    Curve geometry from the edge adaptor.

  • first_vertex (OCCBrepVertex) –

    The first vertex with forward orientation.

  • is_line (bool) –

    True if the underlying curve is a line.

  • is_circle (bool) –

    True if the underlying curve is a circle.

  • is_ellipse (bool) –

    True if the underlying curve is an ellipse.

  • is_hyperbola (bool) –

    True if the underlying curve is a hyperbola.

  • is_parabola (bool) –

    True if the underlying curve is a parabola.

  • is_bezier (bool) –

    True if the underlying curve is a bezier curve.

  • is_bspline (bool) –

    True if the underlying curve is a bspline curve.

  • is_other (bool) –

    True if the underlying curve is an other type of curve.

  • last_vertex (OCCBrepVertex) –

    The first vertex with reversed orientation.

  • vertices (list[OCCBrepVertex]) –

    The topological vertices of the edge.

  • type (int) –

    The type of the geometric curve underlying the topological edge.

Functions¤

from_circle classmethod ¤

from_circle(
    circle: Circle,
    params: tuple[float, float] | None = None,
    points: tuple[Point, Point] | None = None,
    vertices: tuple[OCCBrepVertex, OCCBrepVertex] | None = None,
) -> OCCBrepEdge

Construct an edge from a circle.

Parameters:

Returns:

from_curve classmethod ¤

from_curve(
    curve: OCCCurve,
    params: tuple[float, float] | None = None,
    points: tuple[Point, Point] | None = None,
    vertices: tuple[OCCBrepVertex, OCCBrepVertex] | None = None,
) -> OCCBrepEdge

Construct an edge from a curve.

Parameters:

Returns:

from_curve2d_and_surface classmethod ¤

from_curve2d_and_surface(
    curve2d: OCCCurve2d,
    surface: OCCSurface,
    params: tuple[float, float] | None = None,
    points: tuple[Point, Point] | None = None,
    vertices: tuple[OCCBrepVertex, OCCBrepVertex] | None = None,
) -> OCCBrepEdge

Construct an edge from an embedded 2d curve and its embedding surface.

Parameters:

Returns:

from_curve_and_surface classmethod ¤

from_curve_and_surface(
    curve: OCCCurve,
    surface: OCCSurface,
    params: tuple[float, float] | None = None,
    points: tuple[Point, Point] | None = None,
    vertices: tuple[OCCBrepVertex, OCCBrepVertex] | None = None,
) -> OCCBrepEdge

Construct an edge from a curve and a surface.

The curve will be projected onto the surface and embedded into its parameter space automatically.

Parameters:

Returns:

from_ellipse classmethod ¤

from_ellipse(ellipse: Ellipse) -> OCCBrepEdge

Construct an edge from an ellipse.

Parameters:

  • ellipse (Ellipse) –

    The ellipse.

Returns:

from_line classmethod ¤

from_line(
    line: Line,
    params: tuple[float, float] | None = None,
    points: tuple[Point, Point] | None = None,
    vertices: tuple[OCCBrepVertex, OCCBrepVertex] | None = None,
) -> OCCBrepEdge

Construct an edge from a line.

Parameters:

Returns:

from_point_point classmethod ¤

from_point_point(a: Point, b: Point) -> OCCBrepEdge

Construct an edge from two points.

Parameters:

  • a (Point) –

    The first point.

  • b (Point) –

    The second point.

Returns:

from_vertex_vertex classmethod ¤

from_vertex_vertex(a: OCCBrepVertex, b: OCCBrepVertex) -> OCCBrepEdge

Construct an edge from two vertices.

Parameters:

Returns:

is_equal ¤

is_equal(other: OCCBrepEdge) -> bool

Check if this edge is equal to another edge.

Two edges are equal if they have the same location and orientation.

Parameters:

Returns:

  • bool

    True if the edges are equal, False otherwise.

is_same ¤

is_same(other: OCCBrepEdge) -> bool

Check if this edge is the same as another edge.

Two edges are the same if they have the same location.

Parameters:

Returns:

  • bool

    True if the edges are the same, False otherwise.

to_bezier ¤

to_bezier() -> Bezier

Convert the edge geometry to a bezier curve.

Returns:

  • Bezier

    A COMPAS bezier curve.

Raises:

  • ValueError

    If the underlying geometry is not a bezier curve.

to_bspline ¤

to_bspline() -> NurbsCurve

Convert the edge geometry to a bspline.

Returns:

  • NursbCurve

    A COMPAS bspline curve.

Raises:

  • ValueError

    If the underlying geometry is not a bspline.

to_circle ¤

to_circle() -> Circle

Convert the edge geometry to a circle.

Returns:

Raises:

  • ValueError

    If the underlying geometry is not a circle.

to_ellipse ¤

to_ellipse() -> Ellipse

Convert the edge geometry to an ellipse.

Returns:

Raises:

  • ValueError

    If the underlying geometry is not an ellipse.

to_hyperbola ¤

to_hyperbola() -> Hyperbola

Convert the edge geometry to a hyperbola.

Returns:

Raises:

  • ValueError

    If the underlying geometry is not a hyperbola.

to_line ¤

to_line() -> Line

Convert the edge geometry to a line.

Returns:

  • Line

    A COMPAS line.

Raises:

  • ValueError

    If the underlying geometry is not a line.

to_parabola ¤

to_parabola() -> Parabola

Convert the edge geometry to a parabola.

Returns:

Raises:

  • ValueError

    If the underlying geometry is not a parabola.