Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot patches #93

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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