Class TLcd3DMeshBuilder

java.lang.Object
com.luciad.format.object3d.TLcd3DMeshBuilder

public class TLcd3DMeshBuilder extends Object
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

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum representing the possible orientations of the axis of symmetry of a mesh.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    arrow(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.
    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.
    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.
    Sets the style for the mesh to be built.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcd3DMeshBuilder

      public TLcd3DMeshBuilder()
  • Method Details

    • build

      public ILcdStyled3DMesh build()
      Builds a styled 3D mesh based on the current set of parameters.
      Returns:
      a styled 3D mesh
    • sliceCount

      public 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. 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

      public 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. 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

      public TLcd3DMeshBuilder orientation(TLcd3DMeshBuilder.AxisOrientation aOrientation)
      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

      public TLcd3DMeshBuilder style(ILcd3DMeshStyle aStyle)
      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 stick
      aOuterRadius - the base radius if the arrow conic tip
      aTipLength - the length of the arrow conic tip
      aTotalLength - the total arrow length (i.e. tip length + stick length)
      Returns:
      this builder
    • box

      public 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.
      Parameters:
      aSizeX - the length in the X direction
      aSizeY - the length in the Y direction
      aSizeZ - the length in the Z direction
      Returns:
      this builder
    • cone

      public 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.
      Parameters:
      aBaseRadius - the base radius of the cone
      aTopRadius - the top radius of the cone
      aHeight - the cone height
      Returns:
      this builder
    • ellipsoid

      public 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.
      Parameters:
      aRadiusX - the radial dimension along the X axis
      aRadiusY - the radial dimension along the Y axis
      aRadiusZ - the radial dimension along the Z axis
      Returns:
      this builder
    • pyramid

      public 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.
      Parameters:
      aBaseWidth - the width of the base surface of the pyramid frustrum
      aTopWidth - the width of the top surface of the pyramid frustrum
      aHeight - the height (length along the pyramid axis) of the pyramid frustrum
      Returns:
      this builder
    • cross

      public 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.
      Parameters:
      aSizeX - the length of the X-aligned segment
      aSizeY - the length of the Y-aligned segment
      aSizeZ - the length of the Z-aligned segment
      Returns:
      this builder