Skip to content

Commit

Permalink
Make circularSegments match the behavior of the original PR
Browse files Browse the repository at this point in the history
  • Loading branch information
zalo committed Dec 21, 2023
1 parent 7a23d17 commit d615ecf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/manifold/src/manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,12 @@ Manifold Manifold::Offset(float delta, int circularSegments) const {
glm::dot(normal0, normal1)),
glm::two_pi<float>());

int numSegments = abs((int)((normal0Tonormal1Angle / glm::two_pi<float>()) * (n * 4)));

std::vector<glm::vec3> wedgePointsStart;
std::vector<glm::vec3> 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);
Expand Down

0 comments on commit d615ecf

Please sign in to comment.