de.jreality.geometry
Class BezierPatchMesh
java.lang.Object
de.jreality.geometry.BezierPatchMesh
public class BezierPatchMesh
- extends java.lang.Object
This class implements Bezier tensor product surfaces of arbitrary dimension. The
underlying Bezier curves can be arbitrary degree, and must not be the same. For example,
it is possible to have quadratic curves in the u parameter direction and cubics in the
v direction.
Instances are immutable. The only available constructor (see BezierPatchMesh(int, int, double[][][])
specifies the two degrees (u and v respectively) and an array of control points. Each row
of control points specifies one u-curve; each column specifies a v-curve. The control points
can be n-dimensional. The
control points must be consistent with the degree specification. That is, the number of
control points in the u-direction must be 1 more than a multiple of the u-degree; and similarly
for v. The simplest case is a single patch; for a cubic Bezier, this is a 4x4 array of
control points.
Currently the only operations supported on the mesh is binary refinement: refineU()
,
refineV()
, and refine()
.
TODO: add a tessellate method which creates an nxn QuadMesh from each set of control points
in the mesh.
TODO: implement adaptive refinement. This will require a new data structure probably a quad-tree
to store the differently-refined levels of the original patch mesh.
- Author:
- Charles Gunn
Constructor Summary |
BezierPatchMesh(int uDegree,
int vDegree,
double[][][] cp)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BezierPatchMesh
public BezierPatchMesh(int uDegree,
int vDegree,
double[][][] cp)
refineU
public void refineU()
refineV
public void refineV()
refine
public void refine()
getControlPoints
public double[][][] getControlPoints()
- Returns:
- Returns the controlPoints.
getUDegree
public int getUDegree()
- Returns:
- Returns the uDegree.
getVDegree
public int getVDegree()
- Returns:
- Returns the vDegree.
representBezierPatchMeshAsQuadMesh
public static IndexedFaceSet representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm)
representBezierPatchMeshAsQuadMesh
public static QuadMeshFactory representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm,
int metric)
representBezierPatchMeshAsQuadMeshFactory
public static QuadMeshFactory representBezierPatchMeshAsQuadMeshFactory(QuadMeshFactory qmf,
BezierPatchMesh bpm,
int metric)