Skip to content

compas_brep.edge ¤

Classes¤

BrepEdge ¤

BrepEdge(
    start: BrepVertex,
    end: BrepVertex,
    curve: Line | Circle | Ellipse | NurbsCurve | None = None,
    domain: tuple[float, float] | None = None,
)

A Brep edge defined by start/end vertices and a 3D curve.

The curve is a Line, a Circle, an Ellipse, or a NurbsCurve.

An analytic curve (Circle / Ellipse) is an unbounded closed conic, so the edge also carries domain -- the parameter interval it actually runs over, in the parameter space :func:compas_brep.exchange.analytic_curve_point defines. A quarter-circle fillet edge and a full circular seam are the same Circle with different domains. Line and NurbsCurve carry their own extent, so their domain is None.

Attributes¤

centroid property ¤
centroid: Point

The length-weighted centroid of the edge curve.

curve_type property ¤
curve_type: str

This edge's tag in the exchange format's edge curve tag set.

domain property writable ¤
domain: tuple[float, float] | None

The parameter interval this edge runs over, for an analytic curve.

end_vertex property ¤
end_vertex: BrepVertex

Alias of :attr:last_vertex, for compatibility with compas_rhino.

is_arc property ¤
is_arc: bool

True for an edge running along part of a circle, not the whole of it.

is_circle property ¤
is_circle: bool

True for a full circular edge. A partial one is an arc -- see :attr:is_arc.

start_vertex property ¤
start_vertex: BrepVertex

Alias of :attr:first_vertex, for compatibility with compas_rhino.

type property ¤
type: int

One of the :class:compas.geometry.CurveType constants.

Methods:¤

sample_points ¤
sample_points(n: int = 64) -> list[Point]

Sample points along this edge for visualization.

For NurbsCurve edges, samples at n+1 parameter values (n segments). For Line edges, returns just the two endpoints.

Parameters:

  • n (int, default: 64 ) –

    Number of segments for curved edges. Defaults to 64.

to_line ¤
to_line() -> Line

The edge as a line between its two vertices.

For a non-linear edge this is the chord, not the curve. Matches the behaviour of compas_occ.