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, withkspokes coming out of the center, and withnconcentric circles around the disk.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()DiskSectorremake(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
-
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, withkspokes coming out of the center, and withnconcentric circles around the disk.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 havenline 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- ifnis less than 1IllegalArgumentException- 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 DiskSector 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.
-
-