MCPcopy Create free account
hub / github.com/SarahWeiii/CoACD / ComputeVCH

Method ComputeVCH

src/model_obj.cpp:175–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173 }
174
175 void Model::ComputeVCH(Model &convex)
176 {
177 btConvexHullComputer ch;
178 ch.compute(points, -1.0, -1.0);
179 for (int32_t v = 0; v < ch.vertices.size(); v++)
180 {
181 convex.points.push_back({ch.vertices[v].getX(), ch.vertices[v].getY(), ch.vertices[v].getZ()});
182 }
183 const int32_t nt = ch.faces.size();
184 for (int32_t t = 0; t < nt; ++t)
185 {
186 const btConvexHullComputer::Edge *sourceEdge = &(ch.edges[ch.faces[t]]);
187 int32_t a = sourceEdge->getSourceVertex();
188 int32_t b = sourceEdge->getTargetVertex();
189 const btConvexHullComputer::Edge *edge = sourceEdge->getNextEdgeOfFace();
190 int32_t c = edge->getTargetVertex();
191 while (c != a)
192 {
193 convex.triangles.push_back({(int)a, (int)b, (int)c});
194 edge = edge->getNextEdgeOfFace();
195 b = c;
196 c = edge->getTargetVertex();
197 }
198 }
199 }
200
201 void Model::GetEigenValues(array<array<double, 3>, 3> eigen_values)
202 {

Callers

nothing calls this directly

Calls 6

computeMethod · 0.80
push_backMethod · 0.80
getSourceVertexMethod · 0.80
getTargetVertexMethod · 0.80
getNextEdgeOfFaceMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected