Skip to content

Commit

Permalink
Remainder Graphlite changes for use in Godot Engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Apr 21, 2022
1 parent fd72eb9 commit 18d6983
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifold/include/manifold.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <functional>
#include <memory>

#include "structs.h"
#include "../../utilities/include/structs.h"

namespace manifold {

Expand Down
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
3 changes: 1 addition & 2 deletions manifold/src/manifold.cu
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Mesh Manifold::GetMesh() const {
result.halfedgeTangent.insert(result.halfedgeTangent.end(),
pImpl_->halfedgeTangent_.begin(),
pImpl_->halfedgeTangent_.end());

result.triVerts.resize(NumTri());
thrust::for_each_n(zip(result.triVerts.begin(), countAt(0)), NumTri(),
MakeTri({pImpl_->halfedge_.cptrH()}));
Expand Down Expand Up @@ -186,7 +185,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 = std::min(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 18d6983

Please sign in to comment.