public class SurfaceBSpline extends AbstractSurface
Modifier and Type | Field and Description |
---|---|
static int |
TESSELATE_COMPOUND_OF_COMPOUND_SHAPES |
static int |
TESSELATE_COMPOUND_OF_OCTREES |
static int |
TESSELATE_COMPOUND_SHAPE |
static int |
TESSELATE_LINEAR_OCTREE |
static int |
TESSELATE_NESTED_OCTREE |
Constructor and Description |
---|
SurfaceBSpline(java.util.ArrayList<PointND> list,
double[] uKnots,
double[] vKnots)
Constructor for a surface BSpline.
|
SurfaceBSpline(java.util.ArrayList<PointND> controlPoints,
SimpleVector uKnots,
SimpleVector vKnots)
Constructor for a surface BSpline.
|
SurfaceBSpline(java.lang.String title,
java.util.ArrayList<PointND> list,
double[] uKnots,
double[] vKnots)
Constructor for a surface BSpline.
|
SurfaceBSpline(java.lang.String title,
java.util.ArrayList<PointND> list,
SimpleVector uKnots,
SimpleVector vKnots)
Constructor for a surface BSpline.
|
SurfaceBSpline(SurfaceBSpline spline) |
Modifier and Type | Method and Description |
---|---|
void |
applyTransform(Transform t)
Applies the Transform t to the object.
|
static java.util.ArrayList<PointND> |
cloneList(java.util.List<PointND> list) |
double[] |
computeInitialUV(PointND point)
Computes approximate u, v coordinates to of the closest control point to the given point.
|
PointND |
evaluate(double u,
double v)
Returns a point on the surface at position (u, v).
|
float[] |
getBinaryRepresentation()
Binary Representation of a Surface BSpline:
|
java.util.ArrayList<PointND> |
getControlPoints() |
int |
getDimension()
Returns the external dimension of the shape.
|
int |
getNumberOfUPoints() |
int |
getNumberOfVPoints() |
PointND[] |
getRasterPoints(double samplingU,
double samplingV) |
PointND[] |
getRasterPoints(int number)
Rasters the shape with a given number of points or less.
|
java.lang.String |
getTitle() |
SimpleVector |
getUKnots() |
SimpleVector |
getVKnots() |
java.util.ArrayList<PointND> |
intersect(AbstractCurve other)
Returns the intersection points between the curve and the shape.
|
PointND[] |
intersectDeCasteljau(StraightLine line) |
boolean |
isBounded()
Returns true if the shape is of limited space
|
boolean |
isClockwise() |
static SurfaceBSpline |
readBSpline(java.io.BufferedReader reader)
Reads a BSpline from a BufferedReader and returns it.
|
static java.util.ArrayList<SurfaceBSpline> |
readSplinesFromFile(java.lang.String filename) |
void |
setClockwise(boolean in_clockwise) |
void |
setNumberOfUPoints(int numberOfUPoints) |
void |
setNumberOfVPoints(int numberOfVPoints) |
void |
setTitle(java.lang.String title) |
AbstractShape |
tessellate(double accuracy)
Creates a list of connected triangles that can be used to approximate the object.
|
AbstractShape |
tessellateMesh(double samplingU,
double samplingV)
Tesselates the BSplineSurface into a mesh of Triangles.
|
AbstractShape |
tessellateMesh(double samplingU,
double samplingV,
int mode)
Tesselates the BSplineSurface into a mesh of Triangles.
|
evaluate, getInternalDimension
getHitsOnBoundingBox_slow, getHitsOnBoundingBox, getMax, getMin, getName, setName
public static final int TESSELATE_COMPOUND_SHAPE
public static final int TESSELATE_COMPOUND_OF_COMPOUND_SHAPES
public static final int TESSELATE_COMPOUND_OF_OCTREES
public static final int TESSELATE_LINEAR_OCTREE
public static final int TESSELATE_NESTED_OCTREE
public SurfaceBSpline(java.util.ArrayList<PointND> controlPoints, SimpleVector uKnots, SimpleVector vKnots)
controlPoints
- the control pointsuKnots
- the knot vector in u directionvKnots
- the knot vector in v directionpublic SurfaceBSpline(java.util.ArrayList<PointND> list, double[] uKnots, double[] vKnots)
list
- the control pointsuKnots
- the knot vector in u directionvKnots
- the knot vector in v directionpublic SurfaceBSpline(java.lang.String title, java.util.ArrayList<PointND> list, double[] uKnots, double[] vKnots)
title
- the title of the BSplinelist
- the control pointsuKnots
- the knot vector in u directionvKnots
- the knot vector in v directionpublic SurfaceBSpline(java.lang.String title, java.util.ArrayList<PointND> list, SimpleVector uKnots, SimpleVector vKnots)
title
- the title of the BSplinelist
- the control pointsuKnots
- the knot vector in u directionvKnots
- the knot vector in v directionpublic SurfaceBSpline(SurfaceBSpline spline)
public java.util.ArrayList<PointND> getControlPoints()
public SimpleVector getUKnots()
public SimpleVector getVKnots()
public boolean isClockwise()
public void setClockwise(boolean in_clockwise)
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the title to setpublic PointND evaluate(double u, double v)
AbstractSurface
evaluate
in class AbstractSurface
u
- the internal position in u dimensionv
- the internal position in v dimensionpublic int getDimension()
AbstractShape
getDimension
in class AbstractShape
public static SurfaceBSpline readBSpline(java.io.BufferedReader reader) throws java.io.IOException
reader
- the readerjava.io.IOException
public static java.util.ArrayList<SurfaceBSpline> readSplinesFromFile(java.lang.String filename) throws java.io.IOException
java.io.IOException
public double[] computeInitialUV(PointND point)
point
- the pointpublic java.util.ArrayList<PointND> intersect(AbstractCurve other)
AbstractShape
intersect
in class AbstractShape
public PointND[] intersectDeCasteljau(StraightLine line)
public AbstractShape tessellateMesh(double samplingU, double samplingV)
samplingU
- number of points in u directionsamplingV
- number of points in v directionpublic AbstractShape tessellateMesh(double samplingU, double samplingV, int mode)
samplingU
- number of points in u directionsamplingV
- number of points in v directionmode
- the internal representation of the mesh. Possible modes are
public void applyTransform(Transform t)
Transformable
applyTransform
in interface Transformable
applyTransform
in class AbstractShape
t
- the transform to apply to the object.public boolean isBounded()
AbstractShape
isBounded
in class AbstractShape
public PointND[] getRasterPoints(int number)
AbstractShape
getRasterPoints
in class AbstractShape
number
- the number of pointspublic float[] getBinaryRepresentation()
type total size in float values ID # of u knots # of v knots # of u points # of v points u knot vector v knot vector u BSpline v BSplines
public AbstractShape tessellate(double accuracy)
AbstractSurface
tessellate
in class AbstractSurface
accuracy
- the maximal deviation in [mm]public int getNumberOfUPoints()
public void setNumberOfUPoints(int numberOfUPoints)
numberOfUPoints
- the numberOfUPoints to setpublic int getNumberOfVPoints()
public void setNumberOfVPoints(int numberOfVPoints)
numberOfVPoints
- the numberOfVPoints to setpublic PointND[] getRasterPoints(double samplingU, double samplingV)