public class BezierPatchMesh extends Object
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.
Constructor and Description |
---|
BezierPatchMesh(int uDegree,
int vDegree,
double[][][] cp) |
Modifier and Type | Method and Description |
---|---|
double[][][] |
getControlPoints() |
int |
getUDegree() |
int |
getVDegree() |
void |
refine() |
void |
refineU() |
void |
refineV() |
static IndexedFaceSet |
representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm) |
static QuadMeshFactory |
representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm,
int metric) |
static QuadMeshFactory |
representBezierPatchMeshAsQuadMeshFactory(QuadMeshFactory qmf,
BezierPatchMesh bpm,
int metric) |
public BezierPatchMesh(int uDegree, int vDegree, double[][][] cp)
public void refineU()
public void refineV()
public void refine()
public double[][][] getControlPoints()
public int getUDegree()
public int getVDegree()
public static IndexedFaceSet representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm)
public static QuadMeshFactory representBezierPatchMeshAsQuadMesh(BezierPatchMesh bpm, int metric)
public static QuadMeshFactory representBezierPatchMeshAsQuadMeshFactory(QuadMeshFactory qmf, BezierPatchMesh bpm, int metric)