Hi, I have a (hopefully) simple question regarding constructing a PolyhedronsSet using the constructor PolyhedronsSet(List<Vector3D> vertices, List<int[]> facets, double tolerance). Currently I have the following code to construct a simple tetrahedron:
List<Vector3D> verts = Arrays.asList(new Vector3D(0, 0, 0), new Vector3D(0, 1, 1), new Vector3D(1, 1, 0), new Vector3D(1, 0, 1)); List<int[]> facets = Arrays.asList(new int[] {0, 3, 1}, new int[] {3, 2, 1}, new int[] {2, 1, 0}, new int[] {3, 2, 0}); PolyhedronsSet set = new PolyhedronsSet(verts, facets, 1e-10); To the best of my knowledge, according to the documentation for this constructor, the previous code should be right. However, it obviously isn't. I'm getting the following error: org.apache.commons.math3.exception.MathIllegalArgumentException: facets orientation mismatch around edge joining points (0, 0, 0) and (1, 0, 1) at org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet.successors(PolyhedronsSet.java:403) at org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet.buildBoundary(PolyhedronsSet.java:274) at org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet.<init>(PolyhedronsSet.java:131) at ... So, my question is, what am I doing wrong? If it's something more complex than can easily be explained via email, feel free to link me to some articles which might help. (Preferably articles which someone with very limited experience with BSP trees and such could understand.) Thanks for your time. -Steven