Class ConeSector
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.ConeSector
-
- All Implemented Interfaces:
MeshMaker
public class ConeSector extends Model implements MeshMaker
Create a wireframe model of a partial right circular cone with its base parallel to the xz-plane and its apex on the positive y-axis.By a partial cone we mean a cone over a circular sector of the cone's base and also cutting off the top part of the cone (the part between the apex and a circle of latitude) leaving a frustum of the (partial) cone.
- See Also:
Cone
,ConeFrustum
,CircleSector
,DiskSector
,RingSector
,CylinderSector
,SphereSector
,TorusSector
-
-
Constructor Summary
Constructors Constructor Description ConeSector()
Create half of a right circular cone with its base in the xz-plane, a base radius of 1, height 1, and apex on the positive y-axis.ConeSector(double r, double h, double t, double theta1, double theta2, int n, int k)
Create a part of the cone with its base in the xz-plane, a base radius ofr
, heighth
, and apex on the y-axis.ConeSector(double r, double h, double theta1, double theta2, int n, int k)
Create a part of the cone with its base in the xz-plane, a base radius ofr
, heighth
, and apex on the y-axis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
ConeSector
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
-
ConeSector
public ConeSector()
Create half of a right circular cone with its base in the xz-plane, a base radius of 1, height 1, and apex on the positive y-axis.
-
ConeSector
public ConeSector(double r, double h, double theta1, double theta2, int n, int k)
Create a part of the cone with its base in the xz-plane, a base radius ofr
, heighth
, and apex on the y-axis.The partial cone is a cone over the circular sector from angle
theta1
to angletheta2
(in the counterclockwise direction). In other words, the (partial) circles of latitude in the model extend from angletheta1
to 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
n
circles of latitude in the model (including the bottom edge), then each line of longitude will haven
line segments. If there arek
lines of longitude, then each (partial) circle of latitude will havek-1
line segments.There must be at least four lines of longitude and at least one circle of latitude.
- Parameters:
r
- radius of the base in the xz-planeh
- height of the apex on the y-axistheta1
- 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 conek
- number of lines of longitude- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 4
-
ConeSector
public ConeSector(double r, double h, double t, double theta1, double theta2, int n, int k)
Create a part of the cone with its base in the xz-plane, a base radius ofr
, heighth
, and apex on the y-axis.If
0 < t < h
, then the partial cone is a frustum with its base in the xz-plane and the top of the frustum aty = t
.The partial cone is a cone over the circular sector from angle
theta1
to angletheta2
(in the counterclockwise direction). In other words, the (partial) circles of latitude in the model extend from angletheta1
to angletheta2
(in the counterclockwise direction).The last two parameters determine the number of lines of longitude (not counting one edge of any removed sector) and the number of (partial) circles of latitude (not counting the top edge of the frustum) in the model.
If there are
n
circles of latitude in the model (including the bottom edge but not the top edge of the frustum), then each line of longitude will haven+1
line segments. If there arek
lines of longitude (not counting one edge of any removed sector), then each (partial) circle of latitude will havek
line segments.There must be at least four lines of longitude and at least two circles of latitude.
- Parameters:
r
- radius of the base in the xz-planeh
- height of the apex on the y-axist
- top of the frustum of the cometheta1
- 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 conek
- number of lines of longitude- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 4IllegalArgumentException
- ifh
is less thant
-
-
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 ConeSector 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.
-
-