Package com.luciad.format.object3d
Class TLcd3DMeshBuilder
java.lang.Object
com.luciad.format.object3d.TLcd3DMeshBuilder
A builder class for creating 3D meshes corresponding to a set of common shapes, namely:
- arrow: a 3D arrow, composed by a conic tip and a cylindrical stick
- box: a parallelepiped shape
- cone: a conic frustum shape (a cylinder is obtainable as a sub-case)
- cross: a set of three axis-aligned segments
- ellipsoid: an ellipsoidal shape
- pyramid: a pyramidal frustum shape with squared base
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.- Since:
- 10.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum representing the possible orientations of the axis of symmetry of a mesh. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarrow
(double aInnerRadius, double aOuterRadius, double aTipLength, double aTotalLength) Sets the builder so to create a 3D arrow mesh with the given dimensional parameters.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.build()
Builds a styled 3D mesh based on the current set of parameters.cone
(double aBaseRadius, double aTopRadius, double aHeight) Sets the builder so to create a cone mesh with given base and top radius and height.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.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.orientation
(TLcd3DMeshBuilder.AxisOrientation aOrientation) Sets the orientation of the main axis (axis of symmetry) of the mesh to be built.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.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.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.style
(ILcd3DMeshStyle aStyle) Sets the style for the mesh to be built.
-
Constructor Details
-
TLcd3DMeshBuilder
public TLcd3DMeshBuilder()
-
-
Method Details
-
build
Builds a styled 3D mesh based on the current set of parameters.- Returns:
- a styled 3D mesh
-
sliceCount
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. Note: this is only applicable to arrow, cone and ellipsoid meshes; for all other meshes, setting this parameter has no effect.- Parameters:
aSliceCount
- the number of side subdivisions of the mesh surface- Returns:
- this builder
-
stackCount
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. Note: this is only applicable to the ellipsoid meshes; for all other meshes, setting this parameter has no effect.- Parameters:
aStackCount
- the number of vertical subdivisions of the mesh surface- Returns:
- this builder
-
orientation
Sets the orientation of the main axis (axis of symmetry) of the mesh to be built. Note: this is only applicable to arrow, cone and pyramid meshes; for all other meshes, setting this parameter has no effect.- Parameters:
aOrientation
- the main axis orientation- Returns:
- this builder
-
style
Sets the style for the mesh to be built.- Parameters:
aStyle
- a mesh style- Returns:
- this builder
-
arrow
public 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. A 3D arrow is composed of two parts, i.e. a stick (cylindrical shape) and a tip (conic shape). Note: a higher number of subdivisions will ensure a smoother appearance of the arrow surface.- Parameters:
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)- Returns:
- this builder
-
box
Sets the builder so to create a 3D box (parallelepiped) of given dimensions along X, Y, and Z axis.- Parameters:
aSizeX
- the length in the X directionaSizeY
- the length in the Y directionaSizeZ
- the length in the Z direction- Returns:
- this builder
-
cone
Sets the builder so to create a cone mesh with given base and top radius and height.- Parameters:
aBaseRadius
- the base radius of the coneaTopRadius
- the top radius of the coneaHeight
- the cone height- Returns:
- this builder
-
ellipsoid
Sets the builder so to create an ellipsoid with given radial dimensions in X, Y, and Z axis.- Parameters:
aRadiusX
- the radial dimension along the X axisaRadiusY
- the radial dimension along the Y axisaRadiusZ
- the radial dimension along the Z axis- Returns:
- this builder
-
pyramid
Sets the builder so to create a 3D pyramidal frustrum with given dimensional parameters, i.e. base width, top width and height.- Parameters:
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 frustrum- Returns:
- this builder
-
cross
Sets the builder so to create a 3D cross, i.e. a shape consisting of three axis-aligned (X,Y,Z) segments.- Parameters:
aSizeX
- the length of the X-aligned segmentaSizeY
- the length of the Y-aligned segmentaSizeZ
- the length of the Z-aligned segment- Returns:
- this builder
-