Package renderer.models_L
Class CylinderSector
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.CylinderSector
-
- All Implemented Interfaces:
MeshMaker
public class CylinderSector extends Model implements MeshMaker
Create a wireframe model of a partial right circular cylinder with its axis along the y-axis.By a partial cylinder we mean a cylinder over a circular sector of the cylinder's base.
- See Also:
Cylinder,CircleSector,DiskSector,RingSector,ConeSector,SphereSector,TorusSector
-
-
Constructor Summary
Constructors Constructor Description CylinderSector()Create half of a cylinder with radius 1 and its axis along the y-axis fromy = 1toy = -1.CylinderSector(double r, double h, double theta1, double theta2, int n, int k)Create a part of the cylinder with radiusrand its axis along the y-axis fromy = htoy = -h.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHorzCount()intgetVertCount()CylinderSectorremake(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
-
CylinderSector
public CylinderSector()
Create half of a cylinder with radius 1 and its axis along the y-axis fromy = 1toy = -1.
-
CylinderSector
public CylinderSector(double r, double h, double theta1, double theta2, int n, int k)
Create a part of the cylinder with radiusrand its axis along the y-axis fromy = htoy = -h.The partial cylinder is a cylinder over the circular sector from angle
theta1to angletheta2(in the counterclockwise direction).The last two parameters determine the number of lines of longitude and the number of (partial) circles of latitude in the model.
If there are
ncircles of latitude in the model, then each line of longitude will haven-1line segments. If there areklines of longitude, then each (partial) circle of latitude will havek-1line segments.There must be at least four lines of longitude and at least two circles of latitude.
- Parameters:
r- radius of the cylinderh- height of the cylinder (from h to -h along the y-axis)theta1- beginning longitude angle of the sector (in radians)theta2- ending longitude angle of the sector (in radians)n- number of circles of latitude around the cylinderk- number of lines of longitude- 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 CylinderSector 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.
-
-