Skip to content

Commit

Permalink
fix triangular grid throws error because pointAtLength doesn't clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-hackin committed May 26, 2022
1 parent 6011e87 commit 89966df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export class TriangularGridDividerSavedModel extends Model({
return range(0, subs + 1).map((j) => {
const fencepostWidth = segLen / subs;
const traversal = j * fencepostWidth;
const startPt = j === 0 ? startSeg.ps.clone() : startSeg.pointAtLength(traversal);
const endPt = j === 0 ? endSeg.pe.clone() : endSeg.pointAtLength(segLen - traversal);
const startPt = j === 0 ? startSeg.ps.clone() : startSeg.pointAtLength(Math.min(traversal, startSeg.length));
const endPt = j === 0 ? endSeg.pe.clone() : endSeg.pointAtLength(Math.min(segLen - traversal, endSeg.length));
const toWallSegment = segment(startPt, endPt);
return [0, subs].includes(j)
? augmentSegmentEndpoints(toWallSegment, -1 * this.cornerFittingRetractionDistance)
Expand Down

0 comments on commit 89966df

Please sign in to comment.