MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / coplanar_analysis

Function coplanar_analysis

scripts/meshstat.py:259–275  ·  view source on GitHub ↗
(mesh, intersecting_faces)

Source from the content-addressed store, hash-verified

257 info["euler_characteristic"] = euler;
258
259def coplanar_analysis(mesh, intersecting_faces):
260 intersect_and_coplanar = set();
261 vertices = mesh.vertices;
262 faces = mesh.faces;
263 for fi, fj in intersecting_faces:
264 p0 = vertices[faces[fi, 0]];
265 p1 = vertices[faces[fi, 1]];
266 p2 = vertices[faces[fi, 2]];
267 q0 = vertices[faces[fj, 0]];
268 q1 = vertices[faces[fj, 1]];
269 q2 = vertices[faces[fj, 2]];
270 if pymesh.orient_3D(p0, p1, p2, q0) == 0 and \
271 pymesh.orient_3D(p0, p1, p2, q1) == 0 and \
272 pymesh.orient_3D(p0, p1, p2, q2) == 0:
273 intersect_and_coplanar.add(fi);
274 intersect_and_coplanar.add(fj);
275 return intersect_and_coplanar;
276
277def print_self_intersection_info(mesh, info):
278 if mesh.vertex_per_face == 4:

Callers 1

Calls 1

addMethod · 0.45

Tested by

no test coverage detected