Class Cylinder

java.lang.Object
eu.mihosoft.vrl.v3d.Cylinder
All Implemented Interfaces:
Primitive

public class Cylinder extends Object implements Primitive
A solid cylinder. The tessellation can be controlled via the numSlices parameter.
Author:
Michael Hoffer <info@michaelhoffer.de>
  • Constructor Details Link icon

    • Cylinder Link icon

      public Cylinder()
      Constructor. Creates a new cylinder with center [0,0,0] and ranging from [0,-0.5,0] to [0,0.5,0], i.e. size = 1.
    • Cylinder Link icon

      public Cylinder(Vector3d start, Vector3d end, double radius, int numSlices)
      Constructor. Creates a cylinder ranging from start to end with the specified radius. The resolution of the tessellation can be controlled with numSlices.
      Parameters:
      start - cylinder start
      end - cylinder end
      radius - cylinder radius
      numSlices - number of slices (used for tessellation)
    • Cylinder Link icon

      public Cylinder(Vector3d start, Vector3d end, double startRadius, double endRadius, int numSlices)
      Constructor. Creates a cylinder ranging from start to end with the specified radius. The resolution of the tessellation can be controlled with numSlices.
      Parameters:
      start - cylinder start
      end - cylinder end
      startRadius - cylinder start radius
      endRadius - cylinder end radius
      numSlices - number of slices (used for tessellation)
    • Cylinder Link icon

      public Cylinder(double radius, double height, int numSlices)
      Constructor. Creates a cylinder ranging from [0,0,0] to [0,0,height] with the specified radius and height. The resolution of the tessellation can be controlled with numSlices.
      Parameters:
      radius - cylinder radius
      height - cylinder height
      numSlices - number of slices (used for tessellation)
    • Cylinder Link icon

      public Cylinder(double startRadius, double endRadius, double height, int numSlices)
      Constructor. Creates a cylinder ranging from [0,0,0] to [0,0,height] with the specified radius and height. The resolution of the tessellation can be controlled with numSlices.
      Parameters:
      startRadius - cylinder start radius
      endRadius - cylinder end radius
      height - cylinder height
      numSlices - number of slices (used for tessellation)
  • Method Details Link icon

    • toPolygons Link icon

      public List<Polygon> toPolygons()
      Description copied from interface: Primitive
      Returns the polygons that define this primitive. Note: this method computes the polygons each time this method is called. The polygons can be cached inside a CSG object.
      Specified by:
      toPolygons in interface Primitive
      Returns:
      a list of polygons that define this primitive
    • getStart Link icon

      public Vector3d getStart()
      Returns:
      the start
    • setStart Link icon

      public void setStart(Vector3d start)
      Parameters:
      start - the start to set
    • getEnd Link icon

      public Vector3d getEnd()
      Returns:
      the end
    • setEnd Link icon

      public void setEnd(Vector3d end)
      Parameters:
      end - the end to set
    • getStartRadius Link icon

      public double getStartRadius()
      Returns:
      the radius
    • setStartRadius Link icon

      public void setStartRadius(double radius)
      Parameters:
      radius - the radius to set
    • getEndRadius Link icon

      public double getEndRadius()
      Returns:
      the radius
    • setEndRadius Link icon

      public void setEndRadius(double radius)
      Parameters:
      radius - the radius to set
    • getNumSlices Link icon

      public int getNumSlices()
      Returns:
      the number of slices
    • setNumSlices Link icon

      public void setNumSlices(int numSlices)
      Parameters:
      numSlices - the number of slices to set
    • getProperties Link icon

      public PropertyStorage getProperties()
      Description copied from interface: Primitive
      Returns the property storage of this primitive.
      Specified by:
      getProperties in interface Primitive
      Returns:
      the property storage of this primitive