Skip to content

Commit 0742ee4

Browse files
committed
Fix readme
1 parent ec64e56 commit 0742ee4

1 file changed

Lines changed: 10 additions & 18 deletions

File tree

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ A Rust library for computing the No Fit Polygon (Minkowski sum) of two convex po
1010

1111
The No Fit Polygon defines the forbidden region where one polygon cannot be placed relative to another without collision. When polygon B's origin is **outside** the NFP, the polygons do **not** overlap. When it's **inside**, they **do** collide.
1212

13-
## Features
14-
15-
-**Convex polygon support** with Minkowski sum via vertex combinations and convex hull
16-
-**Fast computation** using Graham scan algorithm
17-
-**Validated output** - CCW orientation, convex, no self-intersections
18-
-**Automatic orientation correction** - handles CCW/CW input
19-
-**Zero-copy collision detection** - use point-in-polygon test on NFP
20-
2113
## Installation
2214

2315
Add this to your `Cargo.toml`:
@@ -97,30 +89,30 @@ if point_in_polygon(test_position, &nfp) {
9789

9890
- Both input polygons **must be convex**
9991
- Both polygons must have **at least 3 vertices**
100-
- Polygons should be in **counter-clockwise (CCW) orientation** (auto-corrected if needed)
92+
- Polygons should be in **counter-clockwise (CCW) orientation**
10193
- Polygons must be **closed** (last point connects to first conceptually)
10294

10395
## API Reference
10496

105-
### `NFPConvex::nfp(poly_a, poly_b) -> Result<Vec<Point>, NfpError>`
97+
`NFPConvex::nfp(poly_a, poly_b) -> Result<Vec<Point>, NfpError>`
10698

10799
Computes the No Fit Polygon for two convex polygons using Minkowski sum.
108100

109-
**Arguments:**
101+
Arguments:
110102
- `poly_a` - First convex polygon as slice of points
111103
- `poly_b` - Second convex polygon as slice of points
112104

113-
**Returns:**
105+
Returns:
114106
- `Ok(Vec<Point>)` - NFP as counter-clockwise convex polygon
115107
- `Err(NfpError)` - If input validation fails
116108

117-
**Time Complexity:** O(n·m log(n·m)) where n = |A| vertices, m = |B| vertices
109+
Time Complexity: O(n·m log(n·m)) where n = |A| vertices, m = |B| vertices
118110

119-
### `NfpError`
111+
`NfpError`
120112

121113
Error enumeration for NFP operations.
122114

123-
**Variants:**
115+
Variants:
124116
- `EmptyPolygon` - One or both input polygons are empty
125117
- `InsufficientVertices` - One or both polygons have fewer than 3 vertices
126118

@@ -135,15 +127,15 @@ match NFPConvex::nfp(&a, &b) {
135127
}
136128
```
137129

138-
### `Point`
130+
`Point`
139131

140132
2D coordinate point from the `togo` geometry library.
141133

142-
**Fields:**
134+
Fields:
143135
- `x: f64` - X coordinate
144136
- `y: f64` - Y coordinate
145137

146-
### `point(x, y) -> Point`
138+
`point(x, y) -> Point`
147139

148140
Helper function to create a new Point.
149141

0 commit comments

Comments
 (0)