Open pgodman opened 2 years ago
Probably related? https://github.com/alexbol99/flatten-js/issues/124
Possible workaround? https://github.com/alexbol99/flatten-js/issues/125#issuecomment-1781792539
Ah, what worked for me was to check the Face orientation at (my base Polygon is of course made with Faces with ORIENTATION.CCW
... so your situation may be different than mine):
// ...
const face = polygon.addFace([seg_left, cap1, seg_right, cap2]);
if (face.orientation() !== ORIENTATION.CCW) {
face.reverse();
}
Thanks for sharing this work!
Please see this notebook for a repro: https://observablehq.com/@pgodman/unit-square-offset-bug
offsetting a unit square by one creates a wrong result.
Relevant code (I based this on your tutorial):