org.jmol.util.Triangulator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmol Show documentation
Show all versions of jmol Show documentation
Jmol: an open-source Java viewer for chemical structures in 3D
package org.jmol.util;
import javajs.util.AU;
import javajs.util.Lst;
import javajs.util.P3;
import javajs.util.P4;
import javajs.util.T3;
import org.jmol.java.BS;
public class Triangulator extends TriangleData {
// Y
// 4 --------4--------- 5
// /| /|
// / | / |
// / | / |
// 7 8 5 |
// / | / 9
// / | / |
// 7 --------6--------- 6 |
// | | | |
// | 0 ---------0--|----- 1 X
// | / | /
// 11 / 10 /
// | 3 | 1
// | / | /
// | / | /
// 3 ---------2-------- 2
// Z
public final static int[][] fullCubePolygon = new int[][] {
{ 0, 4, 5, 3 }, { 5, 1, 0, 3 }, // back
{ 1, 5, 6, 2 }, { 6, 2, 1, 3 },
{ 2, 6, 7, 2 }, { 7, 3, 2, 3 }, // front
{ 3, 7, 4, 2 }, { 4, 0, 3, 2 },
{ 6, 5, 4, 0 }, { 4, 7, 6, 0 }, // top
{ 0, 1, 2, 0 }, { 2, 3, 0, 0 }, // bottom
};
/**
* a generic cell - plane intersector -- used for finding the plane through a
*
* not static so as to allow JavaScript to not load it as core.
*
* unit cell
*
* @param plane intersecting plane, or null for a full list of all faces
* @param vertices the vertices of the box or unit cell
* @param flags
* 0 -- polygon int[] 1 -- edges only 2 -- triangles only 3 -- both
* @return Lst of P3[3] triangles and P3[2] edge lines
*/
public Lst