I am trying to implement a convex decomposition and I need to find the convex vertex on a mesh. Is there a algorithm that I can use to find the convex vertex on a mesh.
\$\begingroup\$
\$\endgroup\$
1
-
\$\begingroup\$ If you want to draw attention, I recommend editing the question to include more information about what you've researched and tried so far. For example, just doing a Google search for "find concave edges of mesh" turns up several descriptions of how to do this on the front page. Have you tried following these steps? If so, where did you get stuck, and what can we help explain or solve? \$\endgroup\$– DMGregory ♦Commented May 21, 2018 at 11:04
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
0
Here is some code that I used.
private static boolean isReflex(Vector3f p0, Vector3f p, Vector3f p1) {
// TODO Auto-generated method stub
return right(p1,p0,p);
}
private static boolean right(Vector3f a, Vector3f b, Vector3f p) {
return Segment.getLocation(p,a,b) < 0;
}
public static float getLocation(Vector3f point, Vector3f linePoint1, Vector3f linePoint2) {
Vector3f l = Vector3f.add(linePoint2, linePoint1, null);
Vector3f p = Vector3f.sub(point, linePoint1, null);
return Vector3f.angle(l, p);
}