Skip to content

Commit

Permalink
remove dead code and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Dec 8, 2023
1 parent 047b647 commit d755abc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/manifold/src/boolean_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ void AppendPartialEdges(Manifold::Impl &outR, Vec<char> &wholeHalfedgeP,
}

int inclusion = i03[vStart];
bool reversed = inclusion < 0;
EdgePos edgePos = {vP2R[vStart],
glm::dot(outR.vertPos_[vP2R[vStart]], edgeVec),
inclusion > 0};
Expand All @@ -295,7 +294,6 @@ void AppendPartialEdges(Manifold::Impl &outR, Vec<char> &wholeHalfedgeP,
}

inclusion = i03[vEnd];
reversed |= inclusion < 0;
edgePos = {vP2R[vEnd], glm::dot(outR.vertPos_[vP2R[vEnd]], edgeVec),
inclusion < 0};
for (int j = 0; j < glm::abs(inclusion); ++j) {
Expand Down Expand Up @@ -403,7 +401,6 @@ struct DuplicateHalfedges {
if (!thrust::get<0>(in)) return;
Halfedge halfedge = thrust::get<1>(in);
if (!halfedge.IsForward()) return;
const int edgeP = thrust::get<2>(in);

const int inclusion = i03[halfedge.startVert];
if (inclusion == 0) return;
Expand Down Expand Up @@ -744,7 +741,6 @@ Manifold::Impl Boolean3::Result(OpType op) const {
std::tie(faceEdge, facePQ2R) =
SizeOutput(outR, inP_, inQ_, i03, i30, i12, i21, p1q2_, p2q1_, invertQ);

const int numFaceR = faceEdge.size() - 1;
// This gets incremented for each halfedge that's added to a face so that the
// next one knows where to slot in.
Vec<int> facePtrR = faceEdge;
Expand Down
4 changes: 2 additions & 2 deletions src/manifold/src/manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ MeshGL Manifold::GetMeshGL(glm::ivec3 normalIdx) const {
// Duplicate verts with different props
std::vector<int> vert2idx(impl.NumVert(), -1);
std::vector<std::vector<glm::ivec2>> vertPropPair(impl.NumVert());
out.vertProperties.reserve(numVert * out.numProp);
out.vertProperties.reserve(numVert * static_cast<size_t>(out.numProp));

for (int run = 0; run < out.runOriginalID.size(); ++run) {
for (int tri = out.runIndex[run] / 3; tri < out.runIndex[run + 1] / 3;
Expand Down Expand Up @@ -486,7 +486,7 @@ int Manifold::NumOverlaps(const Manifold& other) const {

overlaps = other.GetCsgLeafNode().GetImpl()->EdgeCollisions(
*GetCsgLeafNode().GetImpl());
return num_overlaps += overlaps.size();
return num_overlaps + overlaps.size();
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/polygon/src/polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class EarClip {

area += areaCompensation;
const glm::vec2 size = bBox.Size();
const double minArea = precision_ * glm::max(size.x, size.y);
const float minArea = precision_ * glm::max(size.x, size.y);

if (glm::isfinite(maxX) && area < -minArea) {
holes_.insert(start);
Expand All @@ -622,7 +622,6 @@ class EarClip {
// incorrect due to precision, we check for polygon edges both ahead and
// behind to ensure all valid options are found.
void CutKeyhole(const VertItr start) {
const float startX = start->pos.x;
const Rect bBox = hole2BBox_[start];
const int onTop = start->pos.y >= bBox.max.y - precision_ ? 1
: start->pos.y <= bBox.min.y + precision_ ? -1
Expand Down Expand Up @@ -667,7 +666,6 @@ class EarClip {
// and returns it. It does so by finding any reflex verts inside the triangle
// containing the best connection and the initial horizontal line.
VertItr FindCloserBridge(VertItr start, VertItr edge, int onTop) {
const float p2 = precision_ * precision_;
VertItr best = edge->pos.x > edge->right->pos.x ? edge : edge->right;
const float maxX = best->pos.x;
const float above = best->pos.y > start->pos.y ? 1 : -1;
Expand Down
1 change: 0 additions & 1 deletion src/sdf/src/sdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ Mesh LevelSet(std::function<float(glm::vec3)> sdf, Box bounds, float edgeLength,
Mesh out;

const glm::vec3 dim = bounds.Size();
const float maxDim = std::max(dim[0], std::max(dim[1], dim[2]));
const glm::ivec3 gridSize(dim / edgeLength);
const glm::vec3 spacing = dim / (glm::vec3(gridSize));

Expand Down

0 comments on commit d755abc

Please sign in to comment.