From d615ecf507a3392d517843b939a662024fff99f3 Mon Sep 17 00:00:00 2001 From: Johnathon Selstad Date: Wed, 20 Dec 2023 23:58:07 -0800 Subject: [PATCH] Make circularSegments match the behavior of the original PR --- src/manifold/src/manifold.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/manifold/src/manifold.cpp b/src/manifold/src/manifold.cpp index 7641364bb..d54b9f968 100644 --- a/src/manifold/src/manifold.cpp +++ b/src/manifold/src/manifold.cpp @@ -643,10 +643,12 @@ Manifold Manifold::Offset(float delta, int circularSegments) const { glm::dot(normal0, normal1)), glm::two_pi()); + int numSegments = abs((int)((normal0Tonormal1Angle / glm::two_pi()) * (n * 4))); + std::vector wedgePointsStart; std::vector wedgePointsEnd; - for (int seg = 0; seg <= (4*n); seg++) { - float wdgAlpha = (float)seg / (4*n); + for (int seg = 0; seg <= numSegments; seg++) { + float wdgAlpha = (float)seg / numSegments; glm::qua rotation = glm::angleAxis(wdgAlpha * normal0Tonormal1Angle, glm::normalize(edgeVec)); glm::vec3 wedgePt = rotation * (normal0 * delta);