edu.stanford.rsl.konrad.geometry
Class ConvexHull

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.ConvexHull

public class ConvexHull
extends java.lang.Object

super class for hull constructing algorithms Based on the gift wrapping code from Tim Lambert. Demo applets are presented here.


Constructor Summary
ConvexHull(PointND[] pts)
           
 
Method Summary
 void build()
           
 void build2D()
           
 Triangle[] getFaces()
          Returns the hull as an array of triangles
 PointND[] getHullPoints()
          returns the hull as an array of Points
 PointND[] getRasterPoints(int number)
           
 PointND[] intersect2D(StraightLine line)
          Intersects lines between subsequent hull points.
 PointND[] intersect3D(StraightLine line)
           
 boolean isInside(PointND point)
          Tests whether the point is inside the convex hull.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvexHull

public ConvexHull(PointND[] pts)
Method Detail

build

public void build()

build2D

public void build2D()

getHullPoints

public PointND[] getHullPoints()
returns the hull as an array of Points

Returns:
the array of Points

getFaces

public Triangle[] getFaces()
Returns the hull as an array of triangles

Returns:
the array of faces

isInside

public boolean isInside(PointND point)
Tests whether the point is inside the convex hull.

Parameters:
point -
Returns:
true if the point is inside

intersect2D

public PointND[] intersect2D(StraightLine line)
Intersects lines between subsequent hull points. Only applicable in 2D.

Parameters:
line - the line to intersect with the hull
Returns:
the array of intersection points.

intersect3D

public PointND[] intersect3D(StraightLine line)

getRasterPoints

public PointND[] getRasterPoints(int number)