maspack.geometry
Class CSG

java.lang.Object
  extended by maspack.geometry.CSG

public class CSG
extends java.lang.Object

Constructive Solid Geometry tools

Author:
Antonio

Constructor Summary
CSG()
           
 
Method Summary
static PolygonalMesh cheapIntersection(PolygonalMesh mesh1, BVTree bvt1, PolygonalMesh mesh2, BVTree bvt2, double tol, int maxRayCasts, PolygonalMesh out)
           
static PolygonalMesh cheapIntersection(PolygonalMesh mesh1, PolygonalMesh mesh2, double tol, int maxRayCasts, PolygonalMesh mesh)
          "Cheap" in that the resulting mesh is not closed or manifold, currently for display purposes for debugging intersection
static double computeDice(PolygonalMesh mesh1, BVTree tree1, PolygonalMesh mesh2, BVTree tree2, double tol, int maxRayCasts)
          Computes Dice coefficient between two meshes.
 double computeDice(PolygonalMesh mesh1, PolygonalMesh mesh2)
          Computes Dice coefficient between two meshes
static double computeDice(PolygonalMesh mesh1, PolygonalMesh mesh2, double tol, int maxRayCasts)
          Computes Dice coefficient between two meshes.
static double computeIntersectionVolume(PolygonalMesh mesh1, BVTree tree1, PolygonalMesh mesh2, BVTree tree2, double tol, int maxRayCasts)
          Computes the intersection volume contained by two meshes
 double computeIntersectionVolume(PolygonalMesh mesh1, PolygonalMesh mesh2)
          Computes the intersection volume between two meshes
static double computeIntersectionVolume(PolygonalMesh mesh1, PolygonalMesh mesh2, double tol, int maxRayCasts)
          Computes the intersection volume contained by two meshes
 int getMaxRayCasts()
           
 double getTolerance()
           
static void main(java.lang.String[] args)
           
 void setMaxRayCasts(int max)
           
 void setTolerance(double tol)
           
static void sliceMeshes(PolygonalMesh mesh1, PolygonalMesh mesh2, double tol, int maxRayCasts, PolygonalMesh outMesh1, PolygonalMesh outMesh2)
          Slices one mesh by the other, using a fast plane-cutting based technique Currently used for debugging intersection code
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSG

public CSG()
Method Detail

setTolerance

public void setTolerance(double tol)

getTolerance

public double getTolerance()

getMaxRayCasts

public int getMaxRayCasts()

setMaxRayCasts

public void setMaxRayCasts(int max)

cheapIntersection

public static PolygonalMesh cheapIntersection(PolygonalMesh mesh1,
                                              PolygonalMesh mesh2,
                                              double tol,
                                              int maxRayCasts,
                                              PolygonalMesh mesh)
"Cheap" in that the resulting mesh is not closed or manifold, currently for display purposes for debugging intersection


sliceMeshes

public static void sliceMeshes(PolygonalMesh mesh1,
                               PolygonalMesh mesh2,
                               double tol,
                               int maxRayCasts,
                               PolygonalMesh outMesh1,
                               PolygonalMesh outMesh2)
Slices one mesh by the other, using a fast plane-cutting based technique Currently used for debugging intersection code


cheapIntersection

public static PolygonalMesh cheapIntersection(PolygonalMesh mesh1,
                                              BVTree bvt1,
                                              PolygonalMesh mesh2,
                                              BVTree bvt2,
                                              double tol,
                                              int maxRayCasts,
                                              PolygonalMesh out)

computeIntersectionVolume

public static double computeIntersectionVolume(PolygonalMesh mesh1,
                                               PolygonalMesh mesh2,
                                               double tol,
                                               int maxRayCasts)
Computes the intersection volume contained by two meshes


computeIntersectionVolume

public static double computeIntersectionVolume(PolygonalMesh mesh1,
                                               BVTree tree1,
                                               PolygonalMesh mesh2,
                                               BVTree tree2,
                                               double tol,
                                               int maxRayCasts)
Computes the intersection volume contained by two meshes


computeDice

public static double computeDice(PolygonalMesh mesh1,
                                 PolygonalMesh mesh2,
                                 double tol,
                                 int maxRayCasts)
Computes Dice coefficient between two meshes. The tolerance and maxRayCasts terms are used for robustness in "isInside" tests


computeDice

public static double computeDice(PolygonalMesh mesh1,
                                 BVTree tree1,
                                 PolygonalMesh mesh2,
                                 BVTree tree2,
                                 double tol,
                                 int maxRayCasts)
Computes Dice coefficient between two meshes. The tolerance and maxRayCasts terms are used for robustness in "isInside" tests


computeIntersectionVolume

public double computeIntersectionVolume(PolygonalMesh mesh1,
                                        PolygonalMesh mesh2)
Computes the intersection volume between two meshes


computeDice

public double computeDice(PolygonalMesh mesh1,
                          PolygonalMesh mesh2)
Computes Dice coefficient between two meshes


main

public static void main(java.lang.String[] args)