Class Sphere

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

public class Sphere extends Object implements Primitive
A solid sphere. Tthe tessellation along the longitude and latitude directions can be controlled via the numSlices and numStacks parameters.
Author:
Michael Hoffer <info@michaelhoffer.de>
  • Constructor Details Link icon

    • Sphere Link icon

      public Sphere()
      Constructor. Creates a sphere with radius 1, 16 slices and 8 stacks and center [0,0,0].
    • Sphere Link icon

      public Sphere(double radius)
      Constructor. Creates a sphere with the specified radius, 16 slices and 8 stacks and center [0,0,0].
      Parameters:
      radius - sphare radius
    • Sphere Link icon

      public Sphere(double radius, int numSlices, int numStacks)
      Constructor. Creates a sphere with the specified radius, number of slices and stacks.
      Parameters:
      radius - sphare radius
      numSlices - number of slices
      numStacks - number of stacks
    • Sphere Link icon

      public Sphere(Vector3d center, double radius, int numSlices, int numStacks)
      Constructor. Creates a sphere with the specified center, radius, number of slices and stacks.
      Parameters:
      center - center of the sphere
      radius - sphere radius
      numSlices - number of slices
      numStacks - number of stacks
  • 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
    • getCenter Link icon

      public Vector3d getCenter()
      Returns:
      the center
    • setCenter Link icon

      public void setCenter(Vector3d center)
      Parameters:
      center - the center to set
    • getRadius Link icon

      public double getRadius()
      Returns:
      the radius
    • setRadius Link icon

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

      public int getNumSlices()
      Returns:
      the numSlices
    • setNumSlices Link icon

      public void setNumSlices(int numSlices)
      Parameters:
      numSlices - the numSlices to set
    • getNumStacks Link icon

      public int getNumStacks()
      Returns:
      the numStacks
    • setNumStacks Link icon

      public void setNumStacks(int numStacks)
      Parameters:
      numStacks - the numStacks 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