Package renderer.models_L
Class ConeFrustum
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.ConeFrustum
-
- All Implemented Interfaces:
MeshMaker
public class ConeFrustum extends Model implements MeshMaker
Create a wireframe model of a frustum of a right circular cone with its base in the xz-plane.- See Also:
Cone
,ConeSector
-
-
Constructor Summary
Constructors Constructor Description ConeFrustum()
Create a frustum of a right circular cone with its base in the xz-plane, a base radius of 1, top radius of 1/2, and height 1/2.ConeFrustum(double r1, double h, double r2, int n, int k)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr1
, top radius ofr2
, and heighth
.ConeFrustum(int n, int k, double r, double h, double a)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr
, top of the frustum at heighth
, and with the cone's apex on the y-axis at heighta
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
ConeFrustum
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
-
ConeFrustum
public ConeFrustum()
Create a frustum of a right circular cone with its base in the xz-plane, a base radius of 1, top radius of 1/2, and height 1/2.
-
ConeFrustum
public ConeFrustum(int n, int k, double r, double h, double a)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr
, top of the frustum at heighth
, and with the cone's apex on the y-axis at heighta
.There must be at least three lines of longitude and at least two circles of latitude.
- Parameters:
n
- number of circles of latitudek
- number of lines of longituder
- radius of the base in the xz-planeh
- height of the frustuma
- height of the apex of the cone- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 3
-
ConeFrustum
public ConeFrustum(double r1, double h, double r2, int n, int k)
Create a frustum of a right circular cone with its base in the xz-plane, a base radius ofr1
, top radius ofr2
, and heighth
.This model works with either
r1 > r2
orr1 < r2
. In other words, the frustum can have its "apex" either above or below the xz-plane.There must be at least three lines of longitude and at least two circles of latitude.
- Parameters:
r1
- radius of the base of the frustumh
- height of the frustumr2
- radius of the top of the frustumn
- number of circles of latitudek
- number of lines of longitude- Throws:
IllegalArgumentException
- ifn
is less than 2IllegalArgumentException
- ifk
is less than 3
-
-
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 ConeFrustum 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.
-
-