Skip to content
Draft
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ced5a26
Add Sutherland-Hodgman algorithm documentation
peterstace Mar 27, 2026
6374c8c
Add exhaustive ClipByRect unit test case inventory
peterstace Mar 31, 2026
182d374
sutherland_hodgman.md: tweak test cases
peterstace Apr 1, 2026
1a07156
sutherland_hodgman.md: tweak test cases and rules
peterstace Apr 2, 2026
d2cecf9
sutherland_hodgman.md: tweaks
peterstace Apr 2, 2026
7bf04e6
alg_sutherland_hodgman.go: add stubs and dispatch for ClipByRect
peterstace Apr 2, 2026
1a32f86
Implement for Point
peterstace Apr 2, 2026
e7e56f3
MultiPoint
peterstace Apr 2, 2026
22cb4c5
LineString
peterstace Apr 3, 2026
e1c5957
MultiLineString
peterstace Apr 3, 2026
2f014f6
Implement polygon clipping
peterstace Apr 4, 2026
3e2f6fe
MultiPolygon
peterstace Apr 4, 2026
f9c03e6
polygonClipper refactor
peterstace Apr 4, 2026
18c63dd
GeometryCollection
peterstace Apr 7, 2026
35a9117
Add DR, NE, and CD test cases for ClipByRect
peterstace Apr 7, 2026
488fb3b
Fix Z/M values lost when polygon fully contains clipping rect
peterstace Apr 8, 2026
9353ebe
Replace []Coordinates with mutableSequence in polygon clipping
peterstace Apr 8, 2026
1fac7c7
Revert "Replace []Coordinates with mutableSequence in polygon clipping"
peterstace Apr 9, 2026
4e8582a
alg_clip_by_rect_sutherland_hodgman.go: Alt way to handle coordinates
peterstace Apr 9, 2026
71bc5cf
Revert back to using []Coordinates
peterstace Apr 10, 2026
f35ddea
Pass around raw []float64
peterstace Apr 10, 2026
8447c1e
Rename ClipByRect to ClipByRect2D with 2D-only output
peterstace May 22, 2026
7a6674b
Update ClipByRect tests to use consolidated test helpers
peterstace May 22, 2026
100ab7c
Fix lint failures from CI
peterstace May 23, 2026
cb7b00a
Use sort package instead of slices/cmp
peterstace May 23, 2026
fdfd0cb
Remove clip-by-rect algorithm docs
peterstace May 24, 2026
c4b3d3b
Rename Sutherland-Hodgman test file to match source
peterstace May 24, 2026
c5e97f0
Remove redundant endpoint short-circuits in lerpXY
peterstace May 24, 2026
4dbf7b5
Remove vertical whitespace
peterstace May 25, 2026
034e5a1
Trim lerpXY doc comment to its core contract
peterstace May 25, 2026
b3702d3
Move xysToSeq next to its inverse asXYs in type_sequence.go
peterstace May 25, 2026
cc7075d
Remove redundant empty-sequence guard in clipLineStringByRect
peterstace May 25, 2026
8252bbb
Remove clipping docs
peterstace Jun 5, 2026
3e354d1
Merge branch 'clip-by-rect-doc' of github.com:peterstace/simplefeatur…
peterstace Jun 5, 2026
398cc5e
Snap line-clip endpoints exactly onto rect edges
peterstace Jun 5, 2026
34d3895
Return ok from findNextStart instead of a bogus index
peterstace Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
- Add `NewEnvelopeXY` constructor for building an `Envelope` from variadic x/y
coordinate pairs, following the existing `New*XY` constructor pattern.

- Add `ClipByRect2D` function that clips a geometry to a 2D axis-aligned
rectangle (defined by an `Envelope`). It uses the Sutherland-Hodgman
algorithm for polygons and the Liang-Barsky algorithm for line strings. The
result is always 2D: any Z or M values on the input are discarded, avoiding
the ambiguity of synthesising Z/M values at rectangle corners introduced by
the clip.


Comment thread
peterstace marked this conversation as resolved.
Outdated
## v0.59.0

2026-03-27
Expand Down
Loading
Loading