Package renderer.models_L
Class DiskSector
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.DiskSector
-
- All Implemented Interfaces:
MeshMaker
public class DiskSector extends Model implements MeshMaker
Create a wireframe model of a sector of a disk in the xy-plane centered at the origin.- See Also:
Disk
,CircleSector
,RingSector
,ConeSector
,CylinderSector
,SphereSector
,TorusSector
-
-
Constructor Summary
Constructors Constructor Description DiskSector()
Create half a disk in the xy-plane with radius 1, with 8 spokes coming out of the center, and with 6 concentric circles around the disk.DiskSector(double r, double theta1, double theta2, int n, int k)
Create a sector of a disk in the xy-plane with radiusr
, starting angletheta1
, ending angletheta2
, withk
spokes coming out of the center, and withn
concentric circles around the disk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
DiskSector
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
-
DiskSector
public DiskSector()
Create half a disk in the xy-plane with radius 1, with 8 spokes coming out of the center, and with 6 concentric circles around the disk.
-
DiskSector
public DiskSector(double r, double theta1, double theta2, int n, int k)
Create a sector of a disk in the xy-plane with radiusr
, starting angletheta1
, ending angletheta2
, withk
spokes coming out of the center, and withn
concentric circles around the disk.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
line segments.There must be at least four spokes and at least one concentric circle.
- Parameters:
r
- radius of the disktheta1
- 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 disk- Throws:
IllegalArgumentException
- ifn
is less than 1IllegalArgumentException
- 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 DiskSector 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.
-
-