Class JavaModel3D


  • public class JavaModel3D
    extends Object

    Class which represents any 3D model given by a mesh of 3D polygons

    The model only contains an internal state for the properties (width, length, height, roll, pitch, yaw). For the actual state use e.g. VolumeBox3D#getBox from service-core using points

    Since:
    1.0
    Author:
    Christoph Praschl
    • Constructor Detail

      • JavaModel3D

        public JavaModel3D()
    • Method Detail

      • getWidth

        public double getWidth()
        gets value of field width which represents the internal state. For the actual state use VolumeBox3D#getBox from service-core using points
        Returns:
        value of field width
        See Also:
        width
      • getLength

        public double getLength()
        gets value of field length which represents the internal state. For the actual state use VolumeBox3D#getBox from service-core using points
        Returns:
        value of field length
        See Also:
        length
      • getHeight

        public double getHeight()
        gets value of field height which represents the internal state. For the actual state use VolumeBox3D#getBox from service-core using points
        Returns:
        value of field height
        See Also:
        height
      • transformParallel

        public JavaModel3D transformParallel​(UnaryOperator<JavaPolygon3D> function)
        Method for applying a unary operator to polygons of the mesh
        Parameters:
        function - unary operator which is applied to every polygon in the mesh
        Returns:
        a new instance holding the transformed model 3D (Attention: internal status is lost)
      • move

        public JavaModel3D move​(JavaPoint3D vector)
        Moves the model3D by the given vector
        Parameters:
        vector - the vector used for moving the model
        Returns:
        A new instance holding the moved result
      • rotate

        public JavaModel3D rotate​(double roll,
                                  double pitch,
                                  double yaw)
        Rotates the model 3D around the origin (0,0,0)
        Parameters:
        roll - Rotation around x-axis (in degrees)
        pitch - Rotation around y-axis (in degrees)
        yaw - Rotation around z-axis (in degrees)
        Returns:
        Returns a new, rotated instance
      • rotateAroundCenter

        public JavaModel3D rotateAroundCenter​(double roll,
                                              double pitch,
                                              double yaw)
        Rotates the Model3D around it's center centerPoint
        Parameters:
        roll - Rotation around x-axis (in degrees)
        pitch - Rotation around y-axis (in degrees)
        yaw - Rotation around z-axis (in degrees)
        Returns:
        Returns a new, rotated instance
      • rotate

        public JavaModel3D rotate​(JavaPoint3D origin,
                                  double roll,
                                  double pitch,
                                  double yaw)
        Rotates the model 3D around the given origin
        Parameters:
        origin - origin point around which will be rotated.
        roll - Rotation around x-axis (in degrees)
        pitch - Rotation around y-axis (in degrees)
        yaw - Rotation around z-axis (in degrees)
        Returns:
        Returns a new, rotated instance
      • scale

        public JavaModel3D scale​(double scaleFactor)
        Scales the given Model3D
        Parameters:
        scaleFactor - unified scale factor used for scaling the cloud
        Returns:
        new scaled instance
      • scale

        public JavaModel3D scale​(JavaPoint3D scaleFactors)
        Scales the given Model3D
        Parameters:
        scaleFactors - vector containing the scale values
        Returns:
        new scaled instance