Class Triangle
java.lang.Object
org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject
org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
org.scilab.forge.scirenderer.implementation.g2d.motor.Triangle
- Author:
- Calixte DENIZET
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected static List<ConvexObject> Get the broken triangles in following the intersection of the planes containing t1 and t2.Abstract method Break this ConvexObject against the ConvexObject oAbstract method Break this ConvexObject against a planeprotected static List<ConvexObject> protected static List<ConvexObject> breakTriangleOnLine(Triangle t, Vector3d p, Vector3d n) Break a triangle according to its intersection with a line containing p in the plane of the triangle and orthogonal to n The triangle and the line are supposed to be coplanar.voiddraw(Graphics2D g2d) Draw this object on a Graphics2D objectprotected doubleprotected SpritedRectangleintCheck if o is behind this.protected booleanprotected booleanbooleanisIn2D()protected booleanprotected booleanisPointInside(Vector3d v, boolean checkCoplanarity) protected booleanprotected booleanprotected booleanbooleanvoidvoidreplaceSegment(Segment s, List<Segment> segs) protected voidsetSprite(SpritedRectangle sprite) toString()Methods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
addArea, areCoplanar, check, check2DIntersection, check2DTrueIntersection, drawAreasMethods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject
getColorsBarycenter, getNormal, getPrecedence, getProjectedContour, getProjectedPolyLine, getProvidedNormal, is2D, isBehind, isBehind, isDegenerate, isEqual, isGreaterOrEqual, isLowerOrEqual, isMonochromatic, isNanOrInf, isNanOrInf, isNegativeOrNull, isNull, isPlanar, isPositiveOrNull, minmax2D, minmax3D, resetDefaultPrecedence, setNormal, setPrecedence
-
Field Details
-
segments
-
-
Constructor Details
-
Triangle
public Triangle(Vector3d[] vertices, Color[] colors, Vector3d normal) throws InvalidPolygonException - Throws:
InvalidPolygonException
-
Triangle
- Throws:
InvalidPolygonException
-
Triangle
public Triangle(Vector3d[] vertices, Vector3d[] textureCoords, BufferedImage image, Texture.Filter filter) throws InvalidPolygonException - Throws:
InvalidPolygonException
-
-
Method Details
-
isBehind
Description copied from class:ConvexObjectCheck if o is behind this. Take care: the algorithms used are for convex objects (typically tri-tri, seg-seg or tri-seg)- Overrides:
isBehindin classConvexObject- Returns:
- true if o is behind this
-
isIn2D
public boolean isIn2D() -
addSegment
-
pointOnVertices
-
removeSegment
-
replaceSegment
-
breakObject
Description copied from class:ConvexObjectAbstract method Break this ConvexObject against the ConvexObject o- Specified by:
breakObjectin classConvexObject- Parameters:
o- a ConvexObject- Returns:
- a list of ConvexObject.
-
breakObject
-
breakObject
-
setSprite
-
getSprite
-
draw
Description copied from class:AbstractDrawable3DObjectDraw this object on a Graphics2D object- Specified by:
drawin classAbstractDrawable3DObject- Parameters:
g2d- the Graphics2d object where to draw
-
breakObject
Description copied from class:ConvexObjectAbstract method Break this ConvexObject against a plane- Specified by:
breakObjectin classConvexObject- Parameters:
v- plane definition- Returns:
- a list of ConvexObject.
-
isPointInside
-
isPointInside
-
isCoplanar
-
isCoplanar
-
isSegmentAcross
-
isSegmentInside
-
isSegmentIntersects
-
getSegmentIntersection
-
breakSegmentOnTriangle
-
breakTriangleOnLine
Break a triangle according to its intersection with a line containing p in the plane of the triangle and orthogonal to n The triangle and the line are supposed to be coplanar.- Parameters:
t- the triangle to breakp- a point of the linen- a vector- Returns:
- a list of triangles
-
breakIntersectingTriangles
Get the broken triangles in following the intersection of the planes containing t1 and t2. The planes containing t1 and t2 are supposed to be secant.- Parameters:
t1- the first trianglet2- the second triangle- Returns:
- an array of length 2 containing the resulting triangles for t1 and t2.
-
toString
-