@@ -16,42 +16,41 @@ namespace EPPZ.Geometry.AddOns
1616
1717
1818 using System . Linq ;
19+
1920 using ClipperLib ;
20-
21- using TriangleNet . Geometry ;
22-
23- // Clipper definitions.
2421 using Path = List < ClipperLib . IntPoint > ;
2522 using Paths = List < List < ClipperLib . IntPoint > > ;
2623
24+ using Model ;
25+
2726
2827 public static class TriangleNetAddOns
2928 {
3029
3130
3231 #region Polygon
3332
34- public static TriangleNet . Geometry . Polygon TriangleNetPolygon ( this EPPZ . Geometry . Polygon this_ )
33+ public static TriangleNet . Geometry . Polygon TriangleNetPolygon ( this Polygon this_ )
3534 {
3635 TriangleNet . Geometry . Polygon polygon = new TriangleNet . Geometry . Polygon ( ) ;
3736
3837 int boundary = 1 ;
3938 List < TriangleNet . Geometry . Vertex > vertices = new List < TriangleNet . Geometry . Vertex > ( ) ;
40- this_ . EnumeratePolygons ( ( EPPZ . Geometry . Polygon eachPolygon ) =>
39+ this_ . EnumeratePolygons ( ( Polygon eachPolygon ) =>
4140 {
4241 // Collect vertices.
4342 vertices . Clear ( ) ;
4443 eachPolygon . EnumeratePoints ( ( Vector2 eachPoint ) =>
4544 {
46- vertices . Add ( new Vertex (
45+ vertices . Add ( new TriangleNet . Geometry . Vertex (
4746 ( double ) eachPoint . x ,
4847 ( double ) eachPoint . y ,
4948 boundary
5049 ) ) ;
5150 } ) ;
5251
5352 // Add controur.
54- polygon . Add ( new Contour ( vertices . ToArray ( ) , boundary ) ) ;
53+ polygon . Add ( new TriangleNet . Geometry . Contour ( vertices . ToArray ( ) , boundary ) ) ;
5554
5655 // Track.
5756 boundary ++ ;
@@ -73,7 +72,7 @@ public static Rect Bounds(this TriangleNet.Voronoi.Legacy.SimpleVoronoi this_)
7372 float ymax = 0.0f ;
7473 foreach ( TriangleNet . Voronoi . Legacy . VoronoiRegion region in this_ . Regions )
7574 {
76- foreach ( Point eachPoint in region . Vertices )
75+ foreach ( TriangleNet . Geometry . Point eachPoint in region . Vertices )
7776 {
7877 if ( eachPoint . X > xmax ) xmax = ( float ) eachPoint . X ;
7978 if ( eachPoint . X < xmin ) xmin = ( float ) eachPoint . X ;
@@ -91,7 +90,7 @@ public static Paths ClipperPathsFromVoronoiRegions(List<TriangleNet.Voronoi.Lega
9190 foreach ( TriangleNet . Voronoi . Legacy . VoronoiRegion eachRegion in voronoiRegions )
9291 {
9392 Path eachPath = new Path ( ) ;
94- foreach ( Point eachPoint in eachRegion . Vertices )
93+ foreach ( TriangleNet . Geometry . Point eachPoint in eachRegion . Vertices )
9594 {
9695 eachPath . Add ( new IntPoint (
9796 eachPoint . X * scale ,
@@ -108,16 +107,16 @@ public static Paths ClipperPathsFromVoronoiRegions(List<TriangleNet.Voronoi.Lega
108107
109108 #region Generic
110109
111- public static Vector2 VectorFromPoint ( Point point )
110+ public static Vector2 VectorFromPoint ( TriangleNet . Geometry . Point point )
112111 {
113112 return new Vector2 ( ( float ) point . X , ( float ) point . Y ) ;
114113 }
115114
116- public static Vector2 [ ] PointsFromVertices ( ICollection < Point > vertices )
115+ public static Vector2 [ ] PointsFromVertices ( ICollection < TriangleNet . Geometry . Point > vertices )
117116 {
118117 Vector2 [ ] points = new Vector2 [ vertices . Count ] ;
119118 int pointIndex = 0 ;
120- foreach ( Point eachPoint in vertices )
119+ foreach ( TriangleNet . Geometry . Point eachPoint in vertices )
121120 {
122121 points [ pointIndex ] = VectorFromPoint ( eachPoint ) ;
123122 pointIndex ++ ;
0 commit comments