Package quickhull3d

Examples of quickhull3d.QuickHull3D


  /**
   * Create a convex hull geometry, based on the points given
   * @param input
   */
  public ConvexHull(List<Vector3> input) { 
    final QuickHull3D dualhull = new QuickHull3D();
    final QuickHull3D hull = new QuickHull3D();

    // convert points  
    int i=0; double[] vectors = new double[3*input.size()];
    for (Vector3 v: input) {
      vectors[i+0] = v.x;
      vectors[i+1] = v.y;
      vectors[i+2] = v.z;
      i = i+3;
    }
   
    // build the hull
    hull.build(vectors);
       
    // extract faces from the QuickHull3D implementation
    Point3d[] points = hull.getVertices();
    int[][] faceIndices = hull.getFaces();
   
    // get hull vertices
    for ( Point3d p: points)
      vertices.add(new Vector3( p.x, p.y, p.z));
 
View Full Code Here

TOP

Related Classes of quickhull3d.QuickHull3D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.