Package renderer.models_L
Class TriangularPrism
- java.lang.Object
-
- renderer.scene.Model
-
- renderer.models_L.TriangularPrism
-
public class TriangularPrism extends Model
Create a wireframe model of a right equilateral triangular prism with the y-axis as its central axis.See https://en.wikipedia.org/wiki/Triangular_prism
See https://en.wikipedia.org/wiki/Prism_(geometry)
Attach to each triangular end of the prism a tetrahedron.
-
-
Field Summary
-
Fields inherited from class renderer.scene.Model
colorList, name, primitiveList, vertexList, visible
-
-
Constructor Summary
Constructors Constructor Description TriangularPrism()
Create a right equilateral triangular prism with a regular tetrahedrons attached to each end so that the total length runs from -1 to 1 along the y-axis.TriangularPrism(double s, double h)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, has triangle side lengths
, and has a regular tetrahedron attached to each end.TriangularPrism(double r, double h, double theta, int n)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, with the triangle inscribed in a circle of radiusr
, has a tetrahedron attached to each end where the face-edge-face angle of each tetrahedron istheta
(with theta in radians!), and hasn
lines of latitude around the body of the prism.TriangularPrism(double r, double h, double h2, int n, boolean bothHalves)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, with the triangle inscribed in a circle of radiusr
, has a tetrahedron attached to each end where the height of each tetrahedron ish2
, and hasn
lines of latitude around the body of the prism.TriangularPrism(double s, double h, int n)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, has triangle side lengths
, has a regular tetrahedron attached to each end, and hasn
lines of latitude around the body of the prism.
-
-
-
Constructor Detail
-
TriangularPrism
public TriangularPrism()
Create a right equilateral triangular prism with a regular tetrahedrons attached to each end so that the total length runs from -1 to 1 along the y-axis.
-
TriangularPrism
public TriangularPrism(double s, double h)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, has triangle side lengths
, and has a regular tetrahedron attached to each end.- Parameters:
s
- the length of the triangle's sidesh
- the body of the prism runs from -h to h along the y-axis
-
TriangularPrism
public TriangularPrism(double s, double h, int n)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, has triangle side lengths
, has a regular tetrahedron attached to each end, and hasn
lines of latitude around the body of the prism.- Parameters:
s
- the length of the triangle's sidesh
- the body of the prism runs from -h to h along the y-axisn
- number of lines of latitude around the body of the prism- Throws:
IllegalArgumentException
- ifn
is less than 0
-
TriangularPrism
public TriangularPrism(double r, double h, double theta, int n)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, with the triangle inscribed in a circle of radiusr
, has a tetrahedron attached to each end where the face-edge-face angle of each tetrahedron istheta
(with theta in radians!), and hasn
lines of latitude around the body of the prism.If
theta = 0
, then there are no tetrahedrons at the ends of the prism.If
theta = arctan(sqrt(2)) = 54.736°
, then the tetrahedrons are regular.- Parameters:
r
- radius of circle in xz-plane that the equilateral triangle is inscribed inh
- the body of the prism runs from -h to h along the y-axistheta
- slant angle of each tetrahedron at the ends of the prismn
- number of lines of latitude around the body of the prism- Throws:
IllegalArgumentException
- ifn
is less than 0
-
TriangularPrism
public TriangularPrism(double r, double h, double h2, int n, boolean bothHalves)
Create an equilateral triangular prism that runs from-h
toh
along the y-axis, with the triangle inscribed in a circle of radiusr
, has a tetrahedron attached to each end where the height of each tetrahedron ish2
, and hasn
lines of latitude around the body of the prism.So the total height is
2*(h + h2)
.- Parameters:
r
- radius of circle in xz-plane that the equilateral triangle is inscribed inh
- the body of the prism runs from h to -h in the y-directionh2
- height of each tetrahedron at the ends of the prismn
- number of lines of latitude around the body of the prismbothHalves
- determines if both halves or only the top half gets created- Throws:
IllegalArgumentException
- ifn
is less than 0
-
-