public class TLcd3DMeshBuilder extends Object
Here a snippet to create the 3D mesh of a red arrow aligned on the X axis.
ILcd3DMeshStyle red = new TLcd3DMeshStyleBuilder()
.diffuse(Color.red)
.build();
ILcdStyled3DMesh arrow = new TLcd3DMeshBuilder()
.arrow(1.0, 2.0, 1.0, 4.0)
.orientation(TLcd3DMeshBuilder.AxisOrientation.X_ALIGNED)
.style(red)
.build();
All lengths are expressed in meters.Modifier and Type | Class and Description |
---|---|
static class |
TLcd3DMeshBuilder.AxisOrientation
Enum representing the possible orientations of the axis of symmetry of a mesh.
|
Constructor and Description |
---|
TLcd3DMeshBuilder() |
Modifier and Type | Method and Description |
---|---|
TLcd3DMeshBuilder |
arrow(double aInnerRadius,
double aOuterRadius,
double aTipLength,
double aTotalLength)
Sets the builder so to create a 3D arrow mesh with the given dimensional parameters.
|
TLcd3DMeshBuilder |
box(double aSizeX,
double aSizeY,
double aSizeZ)
Sets the builder so to create a 3D box (parallelepiped) of given dimensions along X, Y, and Z axis.
|
ILcdStyled3DMesh |
build()
Builds a styled 3D mesh based on the current set of parameters.
|
TLcd3DMeshBuilder |
cone(double aBaseRadius,
double aTopRadius,
double aHeight)
Sets the builder so to create a cone mesh with given base and top radius and height.
|
TLcd3DMeshBuilder |
cross(double aSizeX,
double aSizeY,
double aSizeZ)
Sets the builder so to create a 3D cross, i.e. a shape consisting of three axis-aligned (X,Y,Z) segments.
|
TLcd3DMeshBuilder |
ellipsoid(double aRadiusX,
double aRadiusY,
double aRadiusZ)
Sets the builder so to create an ellipsoid with given radial dimensions in X, Y, and Z axis.
|
TLcd3DMeshBuilder |
orientation(TLcd3DMeshBuilder.AxisOrientation aOrientation)
Sets the orientation of the main axis (axis of symmetry) of the mesh to be built.
|
TLcd3DMeshBuilder |
pyramid(double aBaseWidth,
double aTopWidth,
double aHeight)
Sets the builder so to create a 3D pyramidal frustrum with given dimensional parameters,
i.e. base width, top width and height.
|
TLcd3DMeshBuilder |
sliceCount(int aSliceCount)
Sets the slice count, i.e. the number of side surface subdivisions for the mesh to be built;
a higher number of subdivisions will ensure a smoother appearance of the side surface.
|
TLcd3DMeshBuilder |
stackCount(int aStackCount)
Sets the stack count, i.e. the number of vertical surface subdivisions for the mesh to be built;
a higher number of subdivisions will ensure a smoother appearance of the surface.
|
TLcd3DMeshBuilder |
style(ILcd3DMeshStyle aStyle)
Sets the style for the mesh to be built.
|
public ILcdStyled3DMesh build()
public TLcd3DMeshBuilder sliceCount(int aSliceCount)
aSliceCount
- the number of side subdivisions of the mesh surfacepublic TLcd3DMeshBuilder stackCount(int aStackCount)
aStackCount
- the number of vertical subdivisions of the mesh surfacepublic TLcd3DMeshBuilder orientation(TLcd3DMeshBuilder.AxisOrientation aOrientation)
aOrientation
- the main axis orientationpublic TLcd3DMeshBuilder style(ILcd3DMeshStyle aStyle)
aStyle
- a mesh stylepublic TLcd3DMeshBuilder arrow(double aInnerRadius, double aOuterRadius, double aTipLength, double aTotalLength)
aInnerRadius
- the radius of the arrow stickaOuterRadius
- the base radius if the arrow conic tipaTipLength
- the length of the arrow conic tipaTotalLength
- the total arrow length (i.e. tip length + stick length)public TLcd3DMeshBuilder box(double aSizeX, double aSizeY, double aSizeZ)
aSizeX
- the length in the X directionaSizeY
- the length in the Y directionaSizeZ
- the length in the Z directionpublic TLcd3DMeshBuilder cone(double aBaseRadius, double aTopRadius, double aHeight)
aBaseRadius
- the base radius of the coneaTopRadius
- the top radius of the coneaHeight
- the cone heightpublic TLcd3DMeshBuilder ellipsoid(double aRadiusX, double aRadiusY, double aRadiusZ)
aRadiusX
- the radial dimension along the X axisaRadiusY
- the radial dimension along the Y axisaRadiusZ
- the radial dimension along the Z axispublic TLcd3DMeshBuilder pyramid(double aBaseWidth, double aTopWidth, double aHeight)
aBaseWidth
- the width of the base surface of the pyramid frustrumaTopWidth
- the width of the top surface of the pyramid frustrumaHeight
- the height (length along the pyramid axis) of the pyramid frustrumpublic TLcd3DMeshBuilder cross(double aSizeX, double aSizeY, double aSizeZ)
aSizeX
- the length of the X-aligned segmentaSizeY
- the length of the Y-aligned segmentaSizeZ
- the length of the Z-aligned segment