|
|
@ -198,6 +198,12 @@ public class Curve extends Mesh { |
|
|
|
* points |
|
|
|
* points |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void createNurbMesh(int nbSubSegments) { |
|
|
|
private void createNurbMesh(int nbSubSegments) { |
|
|
|
|
|
|
|
if(spline.getControlPoints() != null && spline.getControlPoints().size() > 0) { |
|
|
|
|
|
|
|
if(nbSubSegments == 0) { |
|
|
|
|
|
|
|
nbSubSegments = spline.getControlPoints().size() + 1; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
nbSubSegments = spline.getControlPoints().size() * nbSubSegments + 1; |
|
|
|
|
|
|
|
} |
|
|
|
float minKnot = spline.getMinNurbKnot(); |
|
|
|
float minKnot = spline.getMinNurbKnot(); |
|
|
|
float maxKnot = spline.getMaxNurbKnot(); |
|
|
|
float maxKnot = spline.getMaxNurbKnot(); |
|
|
|
float deltaU = (maxKnot - minKnot) / nbSubSegments; |
|
|
|
float deltaU = (maxKnot - minKnot) / nbSubSegments; |
|
|
@ -228,6 +234,7 @@ public class Curve extends Mesh { |
|
|
|
this.updateBound(); |
|
|
|
this.updateBound(); |
|
|
|
this.updateCounts(); |
|
|
|
this.updateCounts(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void createLinearMesh() { |
|
|
|
private void createLinearMesh() { |
|
|
|
float[] array = new float[spline.getControlPoints().size() * 3]; |
|
|
|
float[] array = new float[spline.getControlPoints().size() * 3]; |
|
|
|