Contents
Class Sphere
java.lang.Object
eu.mihosoft.vrl.v3d.Sphere
- All Implemented Interfaces:
Primitive
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
Returns the property storage of this primitive.double
void
void
setNumSlices
(int numSlices) void
setNumStacks
(int numStacks) void
setRadius
(double radius) Returns the polygons that define this primitive.
-
Constructor Details
-
Sphere
public Sphere()Constructor. Creates a sphere with radius 1, 16 slices and 8 stacks and center [0,0,0]. -
Sphere
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
public Sphere(double radius, int numSlices, int numStacks) Constructor. Creates a sphere with the specified radius, number of slices and stacks.- Parameters:
radius
- sphare radiusnumSlices
- number of slicesnumStacks
- number of stacks
-
Sphere
Constructor. Creates a sphere with the specified center, radius, number of slices and stacks.- Parameters:
center
- center of the sphereradius
- sphere radiusnumSlices
- number of slicesnumStacks
- number of stacks
-
-
Method Details
-
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 aCSG
object.- Specified by:
toPolygons
in interfacePrimitive
- Returns:
- a list of polygons that define this primitive
-
getCenter
- Returns:
- the center
-
setCenter
- Parameters:
center
- the center to set
-
getRadius
public double getRadius()- Returns:
- the radius
-
setRadius
public void setRadius(double radius) - Parameters:
radius
- the radius to set
-
getNumSlices
public int getNumSlices()- Returns:
- the numSlices
-
setNumSlices
public void setNumSlices(int numSlices) - Parameters:
numSlices
- the numSlices to set
-
getNumStacks
public int getNumStacks()- Returns:
- the numStacks
-
setNumStacks
public void setNumStacks(int numStacks) - Parameters:
numStacks
- the numStacks to set
-
getProperties
Description copied from interface:Primitive
Returns the property storage of this primitive.- Specified by:
getProperties
in interfacePrimitive
- Returns:
- the property storage of this primitive
-