"...text-generation-inference.git" did not exist on "dd47a3dac411a3b9896bada2983f5ec7014c1922"
Commit 9df875bb authored by Jiali Duan's avatar Jiali Duan Committed by Facebook GitHub Bot
Browse files

Fix Circleci build failure: Add != operator for Marching Cubes Vertex struct

Summary: Fix Circleci error: https://app.circleci.com/pipelines/github/facebookresearch/pytorch3d/1066/workflows/94df137b-4882-4959-8fe4-738af447db23/jobs/56560.

Reviewed By: kjchalup

Differential Revision: D40185409

fbshipit-source-id: 7121b0cae66bd60f718df2a5d9ef5d2ac3bc658c
parent 73ba66e4
......@@ -86,8 +86,8 @@ std::tuple<at::Tensor, at::Tensor> MarchingCubesCpu(
}
tri.clear();
ps.clear();
}
} // endif
} // endif
} // endfor edge enumeration
} // endfor x
} // endfor y
} // endfor z
......
......@@ -310,13 +310,16 @@ struct Vertex {
Vertex operator+(const Vertex& xyz) const {
return Vertex(x + xyz.x, y + xyz.y, z + xyz.z);
}
// The == operator overrides is used for checking degenerate triangles
// The =/!= operator overrides is used for checking degenerate triangles
bool operator==(const Vertex& xyz) const {
if (std::abs(x - xyz.x) < EPS && std::abs(y - xyz.y) < EPS &&
std::abs(z - xyz.z) < EPS) {
return true;
}
return false;
return (
std::abs(x - xyz.x) < EPS && std::abs(y - xyz.y) < EPS &&
std::abs(z - xyz.z) < EPS);
}
bool operator!=(const Vertex& xyz) const {
return (
std::abs(x - xyz.x) >= EPS || std::abs(y - xyz.y) >= EPS ||
std::abs(z - xyz.z) >= EPS);
}
// vertex position
float x, y, z;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment