Skip to content

Commit e2e1ef6

Browse files
committed
improve PolygonScanning.MD
1 parent df263a9 commit e2e1ef6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/ImageSharp.Drawing/Shapes/Rasterization/PoygonScanning.MD renamed to src/ImageSharp.Drawing/Shapes/Rasterization/PolygonScanning.MD

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SCANLINE 1 >>>> | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | (1) >>>>>>>>>
2020
| |
2121
| A C |
2222
| |
23-
| (2) | (1)
23+
| (2) X | (1)
2424
SCANLINE 2 >>>> | >>>>>>>>>>>>>> + - - - - - - - - - - + >>>>>>>>>
2525
| |
2626
| |
@@ -32,22 +32,22 @@ SCANLINE 2 >>>> | >>>>>>>>>>>>>> + - - - - - - - - - - + >>>>>>>>>
3232
```
3333

3434

35-
#### Scanning SCANLINE 1
35+
#### Intersections at SCANLINE 1
3636

37-
- Intersection with edge A is trivial, since it's being intersected on an internal point
37+
- Intersection with edge A is trivial, since it's being intersected on an internal point of the edge
3838
- The second intersection is more tricky: the intersection point is at the connection (vertex) between edges B and C, but we do not want to emit the intersection 2 times.
39-
- To avoid this, when checking the collision with edge B we emit 0 intersections for edge B, when checking against edge C we emit 1 point
39+
- To avoid this, when checking the scanline's collision against edge B we emit 0 intersections for edge B at it's endpoint (Y1), when checking against edge C we emit 1 point at its start point (Y0)
4040

41-
#### Scanning SCANLINE 2
41+
#### Intersections at SCANLINE 2
4242

4343
- Intersection with edge A is trivial, since it's being intersected on an internal point
44-
- However the rest is tricky: We want to to emulate the intersection with the collinear edge not being listed in `ScanEdgeCollection`.
45-
- The easies we want to do so is to emit a point pair for the line part between A-D and a second point pair for D-C
44+
- However the rest is tricky: We want to to emulate the intersection with the collinear edge X not being listed in `ScanEdgeCollection`.
45+
- The easiest way is to emit a point pair for the line part between A-D and a second point pair for D-C (to emulate the intersection with X)
4646
- To achieve this, we should emit the start point (Y0) intersection of the D edge 2 times!
4747

4848
### Edge emit rules
4949

50-
The emit rules are here to provide a consistent way for intersecting stuff as described in the previous "Illustration" part.
50+
The emit rules are there to provide a consistent way for intersecting scanlines as described in the previous "Illustration" part, handling all corner cases.
5151
These rules only work well, when:
5252
- The outline polygons are Clockwise in screen-space (= "has positive orientation" according to the terminlogy used in the repository)
5353
- Holes have Counter-Clockwise ("negative") orientation.

0 commit comments

Comments
 (0)