34 package eu.mihosoft.vrl.v3d;
36 import java.util.ArrayList;
37 import java.util.Arrays;
38 import java.util.List;
40 import eu.mihosoft.vrl.v3d.parametrics.LengthParameter;
77 this.start =
new Vector3d(0, -0.5, 0);
193 parametrics.add(height);
202 parametrics.add(height);
213 throw new NumberFormatException(
"startRadius can not be negative");
215 throw new NumberFormatException(
"endRadius can not be negative");
217 throw new NumberFormatException(
"Slices can not be less than 3");
223 throw new NumberFormatException(
"Z can not be negative");
226 boolean isY = (Math.abs(axisZ.
y) > 0.5);
232 List<Polygon> polygons =
new ArrayList<>();
236 polygons.add(
new Polygon(Arrays.asList(
242 polygons.add(
new Polygon(Arrays.asList(
277 double r,
double stack,
double slice,
double normalBlend) {
278 double angle = slice * Math.PI * 2;
282 return new Vertex(pos, normal);
336 this.startRadius = radius;
354 this.endRadius = radius;
static final double MINIMUM_RADIUS
List< Polygon > toPolygons()
Cylinder(double startRadius, double endRadius, double height, int numSlices)
static int defaultNumSlices
Cylinder(double radius, double height, int numSlices)
Cylinder(double radius, double height)
Cylinder(double startRadius, double endRadius, double height)
Cylinder(LengthParameter startRadius, LengthParameter height, int numSlices)
Vertex cylPoint(Vector3d axisX, Vector3d axisY, Vector3d axisZ, Vector3d ray, Vector3d s, double r, double stack, double slice, double normalBlend)
void setStart(Vector3d start)
void setStartRadius(double radius)
void setEndRadius(double radius)
final PropertyStorage properties
Cylinder(LengthParameter startRadius, LengthParameter height)
Cylinder(Vector3d start, Vector3d end, double radius, int numSlices)
void setEnd(Vector3d end)
Cylinder(Vector3d start, Vector3d end, double startRadius, double endRadius, int numSlices)
void setNumSlices(int numSlices)
Cylinder(LengthParameter startRadius, LengthParameter endRadius, LengthParameter height)
Cylinder(LengthParameter startRadius, LengthParameter endRadius, LengthParameter height, int numSlices)
PropertyStorage getProperties()
Vector3d cross(Vector3d a)
Vector3d plus(Vector3d v)
static Vector3d y(double y)
static final Vector3d ZERO
Vector3d minus(Vector3d v)
static Vector3d z(double z)
static final Vector3d Z_ONE