Package renderer.models_L
Class Tetrahedron
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.Tetrahedron
-
- All Implemented Interfaces:
MeshMaker
public class Tetrahedron extends Model implements MeshMaker
Create a wireframe model of a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.- See Also:
Cube
,Octahedron
,Icosahedron
,Dodecahedron
-
-
Field Summary
Fields Modifier and Type Field Description int
n1
int
n2
boolean
useTwoParameterConstructor
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description Tetrahedron()
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.Tetrahedron(boolean dual)
Create a regular tetrahedron or its dual tetrahedron (the dual of a tetrahedron is another tetrahedron).Tetrahedron(int n1, int n2)
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.Tetrahedron(int m0, int m1, int m2, int m3)
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHorzCount()
int
getVertCount()
Tetrahedron
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
-
-
-
-
Field Detail
-
n1
public final int n1
-
n2
public final int n2
-
useTwoParameterConstructor
public final boolean useTwoParameterConstructor
-
-
Constructor Detail
-
Tetrahedron
public Tetrahedron()
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.
-
Tetrahedron
public Tetrahedron(boolean dual)
Create a regular tetrahedron or its dual tetrahedron (the dual of a tetrahedron is another tetrahedron).https://en.wikipedia.org/wiki/Tetrahedron#Regular_tetrahedron
The combination of these two dual tetrahedrons is a stellated octahedron.
- Parameters:
dual
- choose between the two dual tetrahedrons
-
Tetrahedron
public Tetrahedron(int n1, int n2)
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.Add line segments fanning out from each vertex to its opposite edge.
- Parameters:
n1
- number of lines fanning out from v0 and v1 towards the edge (v2, v3)n2
- number of lines fanning out from v2 and v3 towards the edge (v0, v1)- Throws:
IllegalArgumentException
- ifn1
is less than 0IllegalArgumentException
- ifn2
is less than 0
-
Tetrahedron
public Tetrahedron(int m0, int m1, int m2, int m3)
Create a regular tetrahedron with its center at the origin, having edge length2*sqrt(2)
, and with its vertices at corners of the cube with vertices(±1, ±1, ±1)
.Add line segments fanning out from each vertex onto its three adjacent sides.
- Parameters:
m0
- number of lines fanning out from v0 onto each adjacent side of the tetrahedronm1
- number of lines fanning out from v1 onto each adjacent side of the tetrahedronm2
- number of lines fanning out from v2 onto each adjacent side of the tetrahedronm3
- number of lines fanning out from v3 onto each adjacent side of the tetrahedron- Throws:
IllegalArgumentException
- ifm0
is less than 0IllegalArgumentException
- ifm1
is less than 0IllegalArgumentException
- ifm2
is less than 0IllegalArgumentException
- ifm3
is less than 0
-
-
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 Tetrahedron 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.
-
-