Class GraphCells2d
This class extracts the set of loops bounding the "cells" of a DGraph2, ie
each cell is a connected region with a polygonal boundary.
Precondition: the graph has no self-intersections.
Precondition: at any vertex, the edges are sortable by angle (ie no outgoing edges overlap)
** numerically this may not be 100% reliable....
Both "sides" of each edge are included in some cell boundary, ie so for a simple
polygon, there are two cells, one infinitely large. The "inside" cells will be
oriented clockwise, if converted to a Polygon2d.
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class GraphCells2d
Constructors
GraphCells2d(DGraph2)
Declaration
public GraphCells2d(DGraph2 graph)
Parameters
Type |
Name |
Description |
DGraph2 |
graph |
|
Fields
CellLoops
Declaration
public List<int[]> CellLoops
Field Value
Graph
Declaration
Field Value
Methods
CellsToPolygons(Func<Polygon2d, Boolean>)
Convert cells to polygons, with optional filter.
If filter returns false, polygon is not included in output
Declaration
public List<Polygon2d> CellsToPolygons(Func<Polygon2d, bool> FilterF = null)
Parameters
Returns
ContainedCells(GeneralPolygon2d)
Find cells that are "inside" the container polygon.
Currently based on finding a point inside the cell and then
checking that it is also inside the container.
This is perhaps not ideal!!
Declaration
public List<Polygon2d> ContainedCells(GeneralPolygon2d container)
Parameters
Returns
FindCells()
Declaration