Package renderer.models_L
Class Ring
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Ring
-
- All Implemented Interfaces:
MeshMaker
public class Ring extends Model implements MeshMaker
Create a wireframe model of a ring (an annulus) in the xy-plane centered at the origin.- See Also:
RingSector
-
-
Field Summary
Fields Modifier and Type Field Description int
k
int
n
double
r1
double
r2
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Ring()
Create a ring (annulus) in the xy-plane with outer radius 1 and with inner radius 0.33, with 12 spokes coming out of the center, and with 5 concentric circles.Ring(double r1, double r2)
Create a ring (annulus) in the xy-plane with outer radiusr1
and with inner radiusr2
, with 12 spokes coming out of the center, and with 5 concentric circles.Ring(double r1, double r2, int n, int k)
Create a ring (annulus) in the xy-plane with outer radiusr1
and with inner radiusr2
, withk
spokes coming out of the center, and withn
concentric circles (not counting the inner most circle).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
Ring
remake(int n, int k)
Build an instance of theModel
with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.-
Methods inherited from class renderer.scene.Model
addColor, addPrimitive, addVertex, getPrimitive, toString
-
-
-
-
Constructor Detail
-
Ring
public Ring()
Create a ring (annulus) in the xy-plane with outer radius 1 and with inner radius 0.33, with 12 spokes coming out of the center, and with 5 concentric circles.
-
Ring
public Ring(double r1, double r2)
Create a ring (annulus) in the xy-plane with outer radiusr1
and with inner radiusr2
, with 12 spokes coming out of the center, and with 5 concentric circles.- Parameters:
r1
- outer radius of the ringr2
- inner radius of the ring
-
Ring
public Ring(double r1, double r2, int n, int k)
Create a ring (annulus) in the xy-plane with outer radiusr1
and with inner radiusr2
, withk
spokes coming out of the center, and withn
concentric circles (not counting the inner most circle).If there are
k
spokes, then each circle around the center will havek
line segments. If there aren
concentric circles around the center (not counting the inner most circle), then each spoke will haven
line segments.There must be at least three spokes and at least one concentric circle.
- Parameters:
r1
- outer radius of the ringr2
- inner radius of the ringn
- number of concentric circlesk
- number of spokes in the ring- Throws:
IllegalArgumentException
- ifn
is less than 1IllegalArgumentException
- ifk
is less than 3
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCount
in interfaceMeshMaker
- Returns:
- the number of lines of latitude that the
Model
contains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCount
in interfaceMeshMaker
- Returns:
- the number of lines of longitude that the
Model
contains
-
-