Skip to content

Commit 8f1ccc3

Browse files
committed
Update README.md
1 parent 424ee31 commit 8f1ccc3

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,33 @@ If you prefer to read example code immediately, you can find example scenes in [
4242
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.
4343

4444
* **Point**
45-
+ `bool ArePointsEqualWithAccuracy(Vector2 a, Vector2 b, float accuracy)`
45+
+ [**`ArePointsEqualWithAccuracy()`**](Geometry.cs#L24)
4646
+ Determine if points are equal with a given accuracy.
47-
+ `bool ArePointsCCW(Vector2 a, Vector2 b, Vector2 c)`
47+
+ [**`ArePointsCCW()`**](Geometry.cs#L30)
4848
+ Determine winding direction of three points.
4949
* **Rect / Bounds**
50-
+ `bool IsRectContainsRectSizeWithAccuracy(Rect rect1, Rect rect2, float accuracy)`
50+
+ [**`IsRectContainsRectSizeWithAccuracy()`**](Geometry.cs#L41)
5151
+ Determine if `rect2.size` fits into `rect1` (compare sizes only).
52-
+ `bool IsRectContainsRectWithAccuracy(Rect rect1, Rect rect2, float accuracy)`
52+
+ [**`IsRectContainsRectWithAccuracy()`**](Geometry.cs#L56)
5353
+ Determine if `rect2` is contained by `rect1` (even if permiters are touching) with a given accuracy.
5454
* **Line**
55-
+ `Vector2 IntersectionPointOfLines(Vector2 segment1_a, Vector2 segment1_b, Vector2 segment2_a, Vector2 segment2_b)`
55+
+ [**`IntersectionPointOfLines()`**](Geometry.cs#L78)
5656
+ Returns intersection point of two lines (defined by segment endpoints). Returns zero, when segments have common points, or when a segment point lies on other.
57-
+ `float PointDistanceFromLine(Vector2 point, Vector2 segment_a, Vector2 segment_b)`
57+
+ [**`PointDistanceFromLine()`**](Geometry.cs#L97)
5858
+ Determine point distance from line (defined by segment endpoints).
5959
* **Segment**
60-
+ `bool PointIsLeftOfSegment(Vector2 point, Vector2 segment_a, Vector2 segment_b)`
60+
+ [**`PointIsLeftOfSegment()`**](Geometry.cs#L109)
6161
+ Determine if a given point lies on the left side of a segment (line beneath).
62-
+ `bool AreSegmentsEqualWithAccuracy(Vector2 segment1_a, Vector2 segment1_b, Vector2 segment2_a, Vector2 segment2_b, float accuracy)`
62+
+ [**`AreSegmentsEqualWithAccuracy()`**](Geometry.cs#L116)
6363
+ Determine if segments (defined by endpoints) are equal with a given accuracy.
64-
+ `bool HaveSegmentsCommonPointsWithAccuracy(Vector2 segment1_a, Vector2 segment1_b, Vector2 segment2_a, Vector2 segment2_b, float accuracy)`
64+
+ [**`HaveSegmentsCommonPointsWithAccuracy()`**](Geometry.cs#L125)
6565
+ Determine if segments (defined by endpoints) have common points with a given accuracy.
66-
+ `bool AreSegmentsIntersecting(Vector2 segment1_a, Vector2 segment1_b, Vector2 segment2_a, Vector2 segment2_b)`
66+
+ [**`AreSegmentsIntersecting()`**](Geometry.cs#L141)
6767
+ Determine if two segments defined by endpoints are intersecting (defined by points). True when the two segments are intersecting. Not true when endpoints are equal, nor when a point is contained by other segment. Credits to [Bryce Boe](https://github.com/bboe) (@bboe) for his writeup [Line Segment Intersection Algorithm](http://bryceboe.com/2006/10/23/line-segment-intersection-algorithm).
6868
* **Polygon** (using `EPPZ.Geometry.Polygon`)
69-
+ `bool IsPolygonContainsPoint(Polygon polygon, Vector2 point)`
69+
+ [**`IsPolygonContainsPoint()`**](Geometry.cs#L159)
7070
+ Test if a polygon contains the given point (checks for sub-polygons recursive). Uses the same Bryce boe algorithm above, so considerations are the same. See [Point in polygon](https://en.wikipedia.org/wiki/Point_in_polygon#Ray_casting_algorithm) for more.
71-
+ `Vector2 CentroidOfPolygons(Polygon[] polygons)`
71+
+ [**`CentroidOfPolygons()`**](Geometry.cs#L177)
7272
+ Returns the compound centroid of multiple polygon using [Geometric decomposition](https://en.wikipedia.org/wiki/Centroid#By_geometric_decomposition).
7373

7474
## Modules
@@ -86,7 +86,8 @@ For clipping, offsetting, triangulating the library use these brilliant third pa
8686
## Add-ons
8787

8888
* [`ClipperAddOns`](AddOns/ClipperAddOns.cs)
89-
+ Mainly `Polygon` extensions for easy conversion between **eppz! Geometry** and [Clipper](https://github.com/eppz/Clipper). It has a method to convert from generic `Vector2[]` array. **[Clipper](https://github.com/eppz/Clipper) works with integers**. So conversion involves a scale up (and a scale down), thus you'll need to pass a scale value to Clipper. (`Polygon` internals use `10e+5f`).
89+
90+
+ Mainly `Polygon` extensions for easy conversion between **eppz! Geometry** and [Clipper](https://github.com/eppz/Clipper). It has a method to convert from generic `Vector2[]` array. **[Clipper](https://github.com/eppz/Clipper) works with integers**. So conversion involves a scale up (and a scale down), thus you'll need to pass a scale value to Clipper. (for example **eppz! Geometry** internals use `10e+5f` by default).
9091
+ `Polygon PolygonFromClipperPaths(Paths paths, float scale)`
9192
+ `Polygon PolygonFromClipperPath(Path path, float scale)`
9293
+ `Paths ClipperPaths(this Polygon this_, float scale)`

0 commit comments

Comments
 (0)