Skip to content

Commit

Permalink
Merge pull request elalish#93 from fire/godot-patches
Browse files Browse the repository at this point in the history
Godot patches
  • Loading branch information
elalish committed Apr 21, 2022
2 parents 15f6e02 + dbe1fff commit 75066eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions manifold/src/constructors.cu
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Manifold Manifold::Cube(glm::vec3 size, bool center) {
Manifold Manifold::Cylinder(float height, float radiusLow, float radiusHigh,
int circularSegments, bool center) {
float scale = radiusHigh >= 0.0f ? radiusHigh / radiusLow : 1.0f;
float radius = max(radiusLow, radiusHigh);
float radius = fmax(radiusLow, radiusHigh);
int n = circularSegments > 2 ? circularSegments : GetCircularSegments(radius);
Polygons circle(1);
float dPhi = 360.0f / n;
Expand Down Expand Up @@ -283,7 +283,7 @@ Manifold Manifold::Revolve(const Polygons& crossSection, int circularSegments) {
float radius = 0.0f;
for (const auto& poly : crossSection) {
for (const auto& vert : poly) {
radius = max(radius, vert.pos.x);
radius = fmax(radius, vert.pos.x);
}
}
int nDivisions =
Expand Down
2 changes: 1 addition & 1 deletion manifold/src/manifold.cu
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int Manifold::GetCircularSegments(float radius) {
if (Manifold::circularSegments_ > 0) return Manifold::circularSegments_;
int nSegA = 360.0f / Manifold::circularAngle_;
int nSegL = 2.0f * radius * glm::pi<float>() / Manifold::circularEdgeLength_;
int nSeg = min(nSegA, nSegL) + 3;
int nSeg = fmin(nSegA, nSegL) + 3;
nSeg -= nSeg % 4;
return nSeg;
}
Expand Down
2 changes: 2 additions & 0 deletions utilities/include/sparse.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "utils.cuh"
#include "vec_dh.cuh"

#include <math.h>

namespace manifold {

/** @ingroup Private */
Expand Down

0 comments on commit 75066eb

Please sign in to comment.