OCCBrepEdge
¤
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:
-
circle(Circle) –The circle.
-
params(tuple[float, float] | None, default:None) –The parameters of the circle.
-
points(tuple[Point, Point] | None, default:None) –The start and end points of the circle.
-
vertices(tuple[OCCBrepVertex, OCCBrepVertex] | None, default:None) –The start and end vertices of the circle.
Returns:
-
BrepEdge–The constructed edge.
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:
-
curve(OCCCurve) –The curve.
-
params(tuple[float, float] | None, default:None) –The parameters of the curve.
-
points(tuple[Point, Point] | None, default:None) –The start and end points of the curve.
-
vertices(tuple[OCCBrepVertex, OCCBrepVertex] | None, default:None) –The start and end vertices of the curve.
Returns:
-
BrepEdge–The constructed edge.
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:
-
curve2d(OCCCurve2d) –The 2D curve.
-
surface(OCCSurface) –The surface.
-
params(tuple[float, float] | None, default:None) –The parameters of the curve.
-
points(tuple[Point, Point] | None, default:None) –The start and end points of the curve.
-
vertices(tuple[OCCBrepVertex, OCCBrepVertex] | None, default:None) –The start and end vertices of the curve.
Returns:
-
BrepEdge–The constructed edge.
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:
-
curve(OCCCurve) –The curve.
-
surface(OCCSurface) –The surface.
-
params(tuple[float, float] | None, default:None) –The parameters of the curve.
-
points(tuple[Point, Point] | None, default:None) –The start and end points of the curve.
-
vertices(tuple[OCCBrepVertex, OCCBrepVertex] | None, default:None) –The start and end vertices of the curve.
Returns:
-
BrepEdge–The constructed edge.
from_ellipse
classmethod
¤
from_ellipse(ellipse: Ellipse) -> OCCBrepEdge
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:
-
line(Line) –The line.
-
params(tuple[float, float] | None, default:None) –The parameters of the line.
-
points(tuple[Point, Point] | None, default:None) –The start and end points of the line.
-
vertices(tuple[OCCBrepVertex, OCCBrepVertex] | None, default:None) –The start and end vertices of the line.
Returns:
-
BrepEdge–The constructed edge.
from_point_point
classmethod
¤
from_point_point(a: Point, b: Point) -> OCCBrepEdge
from_vertex_vertex
classmethod
¤
from_vertex_vertex(a: OCCBrepVertex, b: OCCBrepVertex) -> OCCBrepEdge
Construct an edge from two vertices.
Parameters:
-
a(OCCBrepVertex) –The first vertex.
-
b(OCCBrepVertex) –The second vertex.
Returns:
-
BrepEdge–The constructed edge.
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:
-
other(OCCBrepEdge) –The other edge.
Returns:
-
bool–Trueif the edges are equal,Falseotherwise.
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:
-
other(OCCBrepEdge) –The other edge.
Returns:
-
bool–Trueif the edges are the same,Falseotherwise.
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:
-
Circle–A COMPAS circle.
Raises:
-
ValueError–If the underlying geometry is not a circle.
to_ellipse
¤
to_ellipse() -> Ellipse
Convert the edge geometry to an ellipse.
Returns:
-
Ellipse–A COMPAS ellipse.
Raises:
-
ValueError–If the underlying geometry is not an ellipse.
to_hyperbola
¤
to_hyperbola() -> Hyperbola
Convert the edge geometry to a hyperbola.
Returns:
-
Hyperbola–A COMPAS hyperbola.
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:
-
Parabola–A COMPAS parabola.
Raises:
-
ValueError–If the underlying geometry is not a parabola.