edu.stanford.rsl.konrad.geometry.splines
Class BSpline

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.AbstractShape
      extended by edu.stanford.rsl.konrad.geometry.AbstractCurve
          extended by edu.stanford.rsl.konrad.geometry.splines.BSpline
All Implemented Interfaces:
Transformable, java.io.Serializable

public class BSpline
extends AbstractCurve

See Also:
Serialized Form

Constructor Summary
BSpline(java.util.ArrayList<PointND> controlPoints, double... uVector)
           
BSpline(java.util.ArrayList<PointND> controlPoints, SimpleVector knotVector)
          Constructor for a BSpline using ArbitraryPoints and a weight vector as SimpleVector
 
Method Summary
 void applyTransform(Transform t)
          Applies the Transform t to the object.
 void computeBounds()
          Computes the bounding box for the curve.
 double distance(double[] planeCoefficients, double u)
           
 double distance(double[] planeCoefficients, int i)
           
 PointND evaluate(double u)
          Returns a point on the Curve at position u [0, 1];
 PointND getControlPoint(int i)
          Returns the i-th control point
 int getDegree()
          Returns the degree of the spline.
 int getDimension()
          Returns the external dimension of the shape.
 double getKnotVectorEntry(int i)
          Returns the i-th knot vector entry.
 PointND[] getRasterPoints(int number)
          Rasters the shape with a given number of points or less.
 double getWeight(double u, int i)
          Computes N iteratively.
 java.util.ArrayList<PointND> intersect(AbstractCurve other)
          Returns the intersection points between the curve and the shape.
 boolean isBounded()
          Returns true if the shape is of limited space
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractCurve
evaluate, getInternalDimension
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractShape
getHitsOnBoundingBox_slow, getHitsOnBoundingBox, getMax, getMin
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSpline

public BSpline(java.util.ArrayList<PointND> controlPoints,
               double... uVector)

BSpline

public BSpline(java.util.ArrayList<PointND> controlPoints,
               SimpleVector knotVector)
Constructor for a BSpline using ArbitraryPoints and a weight vector as SimpleVector

Parameters:
controlPoints - the control points
knotVector - the weight vector
Method Detail

evaluate

public PointND evaluate(double u)
Description copied from class: AbstractCurve
Returns a point on the Curve at position u [0, 1];

Specified by:
evaluate in class AbstractCurve
Parameters:
u - the internal position
Returns:
the curve point

getDimension

public int getDimension()
Description copied from class: AbstractShape
Returns the external dimension of the shape.

Specified by:
getDimension in class AbstractShape
Returns:
the dimension

getWeight

public double getWeight(double u,
                        int i)
Computes N iteratively.

Parameters:
u - the point on the curve
i - the control point
Returns:
the weight

computeBounds

public void computeBounds()
Computes the bounding box for the curve.


getControlPoint

public PointND getControlPoint(int i)
Returns the i-th control point

Parameters:
i - the index
Returns:
the control point

getKnotVectorEntry

public double getKnotVectorEntry(int i)
Returns the i-th knot vector entry.

Parameters:
i -
Returns:
the knot vector entry

getDegree

public int getDegree()
Returns the degree of the spline.

Returns:
the degree

intersect

public java.util.ArrayList<PointND> intersect(AbstractCurve other)
Description copied from class: AbstractShape
Returns the intersection points between the curve and the shape. Returns null, if the intersection is empty.

Specified by:
intersect in class AbstractShape
Returns:
the intersection points.

isBounded

public boolean isBounded()
Description copied from class: AbstractShape
Returns true if the shape is of limited space

Specified by:
isBounded in class AbstractShape
Returns:
Boundedness of this shape.

distance

public double distance(double[] planeCoefficients,
                       double u)

distance

public double distance(double[] planeCoefficients,
                       int i)

applyTransform

public void applyTransform(Transform t)
Description copied from interface: Transformable
Applies the Transform t to the object.

Specified by:
applyTransform in interface Transformable
Specified by:
applyTransform in class AbstractShape
Parameters:
t - the transform to apply to the object.

getRasterPoints

public PointND[] getRasterPoints(int number)
Description copied from class: AbstractShape
Rasters the shape with a given number of points or less. If the shape is not bounded null is returned.

Specified by:
getRasterPoints in class AbstractShape
Parameters:
number - the number of points
Returns:
the raster points