Package org.jmol.util

Class MeshCapper

java.lang.Object
org.jmol.util.MeshCapper

public class MeshCapper extends Object
A class to properly cap a convoluted, closed slice of an isosurface inspired by: Computational Geometry: Algorithms and Applications Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf Springer-Verlag, Berlin Heidelberg 1997 Chapter 3. Polygon Triangulation Thanks given to Olaf Hall-Holt for pointing me to this reference. Extensively modified: - quaternion transform from 3D plane to XY plane for best precision - using directional edges -- no angle measurements necessary - continuous splitting off of triangles - independent dynamic monotonic regions created and processed as one stream - no need for vertex typing - no push/pop stacks INPUT: stream of [a b] ordered-vertex edges such that triangle a-b-c is interior if (ab.cross.ac).dot.planeNormal > 0 (right-hand rule; counter-clockwise edge flow) Bob Hanson - Jan 11, 2015
Author:
Bob Hanson, hansonr@stolaf.edu
  • Constructor Details

    • MeshCapper

      public MeshCapper()
  • Method Details

    • set

      public MeshCapper set(MeshSlicer slicer)
      Parameters:
      slicer -
      Returns:
      this
    • triangulateFaces

      public int[][] triangulateFaces(int[][] faces, P3[] vertices, int[][] faceTriangles)
      generic entry for a set of faces
      Parameters:
      faces - array of pointers into points
      vertices -
      faceTriangles - optional return list by face
      Returns:
      array of triangles [a b c mask]
    • triangulatePolygon

      public int[][] triangulatePolygon(P3[] points, int nPoints)
      generic entry for a polygon
      Parameters:
      points -
      nPoints - number of points or -1
      Returns:
      int[][i j k mask]