Class Arrangement2d
Arrangement2d constructs a planar arrangement of a set of 2D line segments.
When a segment is inserted, existing edges are split, and the inserted
segment becomes multiple graph edges. So, the resulting DGraph2 should
not have any edges that intersect.
Calculations are performed in double-precision, so there is no guarantee
of correctness.
[TODO] multi-level segment has to accelerate find_intersecting_edges()
[TODO] maybe smarter handling
Inheritance
Arrangement2d
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class Arrangement2d
Constructors
Arrangement2d(AxisAlignedBox2d)
Declaration
public Arrangement2d(AxisAlignedBox2d boundsHint)
Parameters
Fields
Graph
Declaration
Field Value
PointHash
Declaration
public PointHashGrid2d<int> PointHash
Field Value
VertexSnapTol
Declaration
public double VertexSnapTol
Field Value
Methods
ConnectOpenBoundaries(Double)
connect open boundary vertices within distThresh, by inserting new segments
Declaration
public void ConnectOpenBoundaries(double distThresh)
Parameters
Type |
Name |
Description |
Double |
distThresh |
|
find_existing_vertex(Vector2d)
find existing vertex at point, if it exists
Declaration
protected int find_existing_vertex(Vector2d pt)
Parameters
Returns
find_intersecting_edges(ref Vector2d, ref Vector2d, List<Arrangement2d.Intersection>, Double)
find set of edges in graph that intersect with edge [a,b]
Declaration
protected bool find_intersecting_edges(ref Vector2d a, ref Vector2d b, List<Arrangement2d.Intersection> hits, double tol = 0)
Parameters
Returns
find_nearest_boundary_vertex(Vector2d, Double, Int32)
find nearest boundary vertex, within searchRadius
Declaration
protected int find_nearest_boundary_vertex(Vector2d pt, double searchRadius, int ignore_vid = -1)
Parameters
Returns
find_nearest_vertex(Vector2d, Double, Int32)
find closest vertex, within searchRadius
Declaration
protected int find_nearest_vertex(Vector2d pt, double searchRadius, int ignore_vid = -1)
Parameters
Returns
Insert(Polygon2d, Int32)
sequentially insert segments of polygon
Declaration
public void Insert(Polygon2d poly, int gid = -1)
Parameters
Insert(PolyLine2d, Int32)
sequentially insert segments of polyline
Declaration
public void Insert(PolyLine2d pline, int gid = -1)
Parameters
Insert(Segment2d, Int32)
insert segment into the arrangement
Declaration
public void Insert(Segment2d segment, int gid = -1)
Parameters
Insert(Vector2d, Vector2d, Int32)
insert segment [a,b] into the arrangement
Declaration
public void Insert(Vector2d a, Vector2d b, int gid = -1)
Parameters
insert_segment(Vector2d, Vector2d, Int32, Double)
Declaration
protected bool insert_segment(Vector2d a, Vector2d b, int gid = -1, double tol = 0)
Parameters
Returns
insert_segment(ref Vector2d, ref Vector2d, Int32, Double)
insert edge [a,b] into the arrangement, splitting existing edges as necessary
Declaration
protected bool insert_segment(ref Vector2d a, ref Vector2d b, int gid = -1, double tol = 0)
Parameters
Returns
split_segment_at_t(Int32, Double, Double)
insert new point into segment eid at parameter value t
If t is within tol of endpoint of segment, we use that instead.
Declaration
protected Index2i split_segment_at_t(int eid, double t, double tol)
Parameters
Returns