Skip to content

Commit 7418f52

Browse files
committed
fix urquhartFaces() for unconstrained tins
1 parent 256dac5 commit 7418f52

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
* `PGS_Morphology.rounding()` no longer gives invalid results.
2222
* `PGS_ShapePredicates.elongation()` now correctly measures shape elongation (previously inverted, now returns 1 for highly elongated shapes).
2323
* `PGS_Conversion.toGraph()` now processes `LINES` shapes correctly.
24+
* `PGS_Meshing.urquhartFaces()` no longer errors on triangulation inputs with no constraints.
2425

2526
### Removed
2627

src/main/java/micycle/pgs/PGS_Meshing.java

+3
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@ public static PShape centroidQuadrangulation(final IIncrementalTin triangulation
511511
*/
512512
private static PShape removeHoles(PShape faces, IIncrementalTin triangulation) {
513513
List<IConstraint> holes = new ArrayList<>(triangulation.getConstraints()); // copy list
514+
if (holes.size() <= 1) {
515+
return faces;
516+
}
514517
holes = holes.subList(1, holes.size()); // slice off perimeter constraint (not a hole)
515518

516519
STRtree tree = new STRtree();

0 commit comments

Comments
 (0)