Skip to content

Commit 5f23f4c

Browse files
committed
Update README.md
1 parent 1cc427d commit 5f23f4c

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
# eppz.Geometry
22
> part of [**Unity.Library.eppz**](https://github.com/eppz/Unity.Library.eppz)
33
4-
📐 2D geometry for Unity.
4+
**📐 2D geometry for Unity.**
55

6-
Polygon triangulation, Delunay triangulation, Voronoi, polygon offset, polygon outline, union of polygons, substraction of polygons. polygon clipping, polygon winding direction, polygon area, polygon centroid, centroid of multiple polygons, line intersection, point-line distance, segment intersection, polygon-point containment, and more.
6+
Polygon triangulation, Voronoi diagram, polygon offset, polygon outline, union of polygons, substraction of polygons. polygon clipping, polygon winding direction, polygon area, polygon centroid, centroid of multiple polygons, line intersection, point-line distance, segment intersection, polygon-point containment, and more.
77

8-
The library is **being used in production**. However, it comes with the disclaimed liability and warranty of [MIT License](https://en.wikipedia.org/wiki/MIT_License)).
8+
The library is **being used in production**. However, it comes with the disclaimed liability and warranty of [MIT License](https://en.wikipedia.org/wiki/MIT_License).
9+
10+
## Examples
11+
12+
If you prefer to read example code immediately, you can find example scenes in [`Scenes`](Scenes) folder.
13+
14+
## Model classes
15+
16+
* [`Vertex.cs`](Model/Vertex.cs)
17+
+ Basically a `Vector2` point, but is aware of the polygon context it resides (neighbours, segments, edges, polygon, bisector, normal).
18+
* [`Segment.cs`](Model/Segment.cs)
19+
+ Segment of two `Vector2` point. Carries out basic geometry features (point distance, point containment, segment intersection).
20+
* [`Edge.cs`](Model/Edge.cs)
21+
+ Edge of two `Vertex` in a polygon (a special `Segment` subclass). Likewise vertices, this model is also aware of the polygon context it resides (neighbours, segments, edges, polygon, perpendicular, normal).
22+
* [`Polygon.cs`](Model/Edge.cs)
23+
+ The role player, it really **embodies mostly every feature of this library**. Basically a polygon made of vertices.
24+
+ Can be created with point array, transforms, [`PolygonSource`](Components/PolygonSource.cs). Further polygons can be embedded into recursively. Vertices, edges, polygons can be enumerated (recursively).
25+
+ Area, winding direction, centroid are being calculated. Also carries the basic geometry features (point containment, line-, segment-, polygon intersection and more).
26+
+ Using library modules, it implements polygon offset (outline), union polygon (polygon clipping), basic mesh triangulation. It implements conversion to both [Clipper](https://github.com/eppz/Clipper) and [Triangle.NET](https://github.com/eppz/Triangle.NET), so you can implement further integration with those (awesome) libraries.
927

1028
## [`Geometry.cs`](Geometry.cs)
1129

12-
The basic 2D geometry algorithm collection is implemented in this static base class.
30+
Most of the basic 2D geometry algorithm collection is implemented in this static base class. You can (mostly) **use them with Unity `Vector2` types directly**, so (almost entirely) without the model classes introduced above.
1331

1432
* **Point**
1533
+ `bool ArePointsEqualWithAccuracy(Vector2 a, Vector2 b, float accuracy)`

Scenes/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# eppz.Geometry/Scenes
2+
> part of [**Unity.Library.eppz**](https://github.com/eppz/Unity.Library.eppz)
3+
4+
Soon.
5+
6+
## License
7+
8+
> Licensed under the [**MIT License**](https://en.wikipedia.org/wiki/MIT_License).

0 commit comments

Comments
 (0)