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, withkspokes coming out of the center, and withnconcentric circles.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()RingSectorremake(int n, int k)Build an instance of theModelwith 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, withkspokes coming out of the center, and withnconcentric circles.If there are
kspokes, then each (partial) circle around the center will havek-1line segments. If there arenconcentric circles around the center, then each spoke will haven-1line 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- ifnis less than 2IllegalArgumentException- ifkis less than 4
-
-
Method Detail
-
getHorzCount
public int getHorzCount()
- Specified by:
getHorzCountin interfaceMeshMaker- Returns:
- the number of lines of latitude that the
Modelcontains
-
getVertCount
public int getVertCount()
- Specified by:
getVertCountin interfaceMeshMaker- Returns:
- the number of lines of longitude that the
Modelcontains
-
remake
public RingSector remake(int n, int k)
Description copied from interface:MeshMakerBuild an instance of theModelwith new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
-
-