DisplayClip2
from OpenCAD2D import DisplayClip2
class DisplayClip2(System.Object) ยท DisplayClip2 in the .NET reference
The outline of a clipped viewport (VPCLIP): a closed ring of vertices in paper units, an edge going from a vertex to the next, an arc where the bulge of the first is not nought, as a polyline's bulge says. A circle of radius 30 is two vertices 60 apart, each with the bulge 1; an L-shape six vertices, every bulge nought. A region with a hole or of several faces adds its other rings (DisplayClip2.Others), and a point is inside where it is inside an odd number of rings, so that a ring inside the first is a hole.
Constructors
__init__
def __init__(
self,
xy: Sequence[float] | System.Array[float],
bulges: Sequence[float] | System.Array[float],
) -> None
Makes an outline.
def __init__(
self,
xy: Sequence[float] | System.Array[float],
bulges: Sequence[float] | System.Array[float],
others: System.Collections.Generic.IReadOnlyList[DisplayClip2],
) -> None
Makes an outline of several rings, as a region with a hole or of several faces has.
Properties and fields
Count
@property
def Count(self) -> int
Gets the number of vertices of the first ring.
Others
@property
def Others(self) -> System.Collections.Generic.IReadOnlyList[DisplayClip2]
Gets the rings after the first, a hole or another face of the region the outline is of; none for an outline of one ring.
Methods
Bulge
def Bulge(self, index: int) -> float
Gets the bulge of the edge leaving a vertex.
Contains
def Contains(self, x: float, y: float) -> bool
Gets whether a point lies inside the outline, inside an odd number of its rings; a point on an edge may fall either side.
DistanceToEdge
def DistanceToEdge(self, x: float, y: float) -> float
Gets the distance from a point to the nearest edge of the outline, inside it or out.
Flatten
def Flatten(self, tolerance: float) -> System.Array[float]
Gets the outline as a ring of straight edges, an arc cut into pieces whose chords lie no farther from it than a tolerance, so that a circle of radius 100 cut to 0.01 is a ring of about 220 points. The vertices of the outline are among the points.
FlattenAll
def FlattenAll(self, tolerance: float) -> System.Collections.Generic.IReadOnlyList[System.Array[float]]
Gets every ring as a ring of straight edges, as DisplayClip2.Flatten gives the first, the first ring first and then the others in order: the rings to fill even-odd, so that a ring inside another is a hole.
X
def X(self, index: int) -> float
Gets the x of a vertex.
Y
def Y(self, index: int) -> float
Gets the y of a vertex.