Class JavaTriangle3D
- java.lang.Object
-
- science.aist.imaging.api.domain.AbstractSurface<T,L>
-
- science.aist.imaging.api.domain.AbstractJavaPolygon<JavaPoint3D,JavaLine3D>
-
- science.aist.imaging.api.domain.threedimensional.JavaPolygon3D
-
- science.aist.imaging.api.domain.threedimensional.JavaTriangle3D
-
- All Implemented Interfaces:
Triangle<JavaPoint3D>
public class JavaTriangle3D extends JavaPolygon3D implements Triangle<JavaPoint3D>
Java representation of a 3D triangle
- Since:
- 1.0
- Author:
- Christoph Praschl
-
-
Field Summary
Fields Modifier and Type Field Description protected JavaPoint3D
a
protected JavaPoint3D
b
protected JavaPoint3D
c
-
Fields inherited from class science.aist.imaging.api.domain.AbstractJavaPolygon
points
-
-
Constructor Summary
Constructors Constructor Description JavaTriangle3D(JavaPoint3D a, JavaPoint3D b, JavaPoint3D c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JavaPoint3D
calculateNormalvector()
protected JavaLine3D
createLine(JavaPoint3D p1, JavaPoint3D p2)
boolean
equals(Object o)
Optional<JavaPoint3D>
getIntersection(JavaLine3D line)
Determines the point of intersection between this triangle and a line (source: https://stackoverflow.com/questions/5666222/3d-line-plane-intersection)int
hashCode()
-
Methods inherited from class science.aist.imaging.api.domain.threedimensional.JavaPolygon3D
createPoint
-
Methods inherited from class science.aist.imaging.api.domain.AbstractJavaPolygon
calculateContour, calculateInnerDepth, getPoints, getSize, isEmpty
-
Methods inherited from class science.aist.imaging.api.domain.AbstractSurface
getIntersection
-
-
-
-
Field Detail
-
a
protected JavaPoint3D a
-
b
protected JavaPoint3D b
-
c
protected JavaPoint3D c
-
-
Constructor Detail
-
JavaTriangle3D
public JavaTriangle3D(JavaPoint3D a, JavaPoint3D b, JavaPoint3D c)
-
-
Method Detail
-
createLine
protected JavaLine3D createLine(JavaPoint3D p1, JavaPoint3D p2)
- Overrides:
createLine
in classJavaPolygon3D
-
getIntersection
public Optional<JavaPoint3D> getIntersection(JavaLine3D line)
Determines the point of intersection between this triangle and a line (source: https://stackoverflow.com/questions/5666222/3d-line-plane-intersection)- Parameters:
line
- to intersect with- Returns:
- Optional containing intersection point or
Optional.empty()
if line is parallel to triangle
-
calculateNormalvector
protected JavaPoint3D calculateNormalvector()
- Overrides:
calculateNormalvector
in classJavaPolygon3D
- Returns:
- Calculates the normalvector of this triangle via the vectors AB and AC
-
-