Package renderer.models_L
Class RingSector
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.RingSector
-
- All Implemented Interfaces:
MeshMaker
public class RingSector extends Model implements MeshMaker
Create a wireframe model of a sector of a ring (an annulus) in the xy-plane centered at the origin.- See Also:
Ring
-
-
Constructor Summary
Constructors Constructor Description RingSector()
Create half a ring (annulus) in the xy-plane with outer radius 1, inner radius 0.33, with 7 spokes coming out of the center, and with 5 concentric circles.RingSector(double r1, double r2, double theta1, double theta2, int n, int k)
Create a sector of a ring (annulus) in the xy-plane with outer radiusr1
, inner radiusr2
, starting angletheta1
, ending angletheta2
, withk
spokes coming out of the center, and withn
concentric circles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
RingSector
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
-
RingSector
public RingSector()
Create half a ring (annulus) in the xy-plane with outer radius 1, inner radius 0.33, with 7 spokes coming out of the center, and with 5 concentric circles.
-
RingSector
public RingSector(double r1, double r2, double theta1, double theta2, int n, int k)
Create a sector of a ring (annulus) in the xy-plane with outer radiusr1
, inner radiusr2
, starting angletheta1
, ending angletheta2
, withk
spokes coming out of the center, and withn
concentric circles.If there are
k
spokes, then each (partial) circle around the center will havek-1
line segments. If there aren
concentric circles around the center, then each spoke will haven-1
line segments.There must be at least four spokes and at least two concentric circle.
- Parameters:
r1
- outer radius of the ringr2
- inner radius of the ringtheta1
- beginning angle of the sector (in radians)theta2
- ending angle of the sector (in radians)n
- number of concentric circlesk
- number of spokes in the ring- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 4
-
-
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
-
remake
public RingSector remake(int n, int k)
Description copied from interface:MeshMaker
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.
-
-