public final class Polygon
extends java.lang.Object
shared property, which is shared between
all polygons that are clones of each other or where split from the same
polygon. This can be used to define per-polygon properties (such as surface
color).| Modifier and Type | Field and Description |
|---|---|
Plane |
plane
Plane defined by this polygon.
|
java.util.ArrayList<Vertex> |
vertices
Polygon vertices.
|
| Constructor and Description |
|---|
Polygon(java.util.List<Vertex> vertices)
Constructor.
|
Polygon(java.util.List<Vertex> vertices,
PropertyStorage shared)
Constructor.
|
Polygon(java.util.List<Vertex> vertices,
PropertyStorage shared,
boolean allowDegenerate)
Constructor.
|
Polygon(Vertex... vertices)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Polygon |
clone() |
boolean |
contains(Polygon p)
Contains.
|
boolean |
contains(Vector3d p)
Contains.
|
java.util.ArrayList<Edge> |
edges() |
Polygon |
flip()
Flips this polygon.
|
Polygon |
flipped()
Returns a flipped copy of this polygon.
|
static java.util.List<Polygon> |
fromConcavePoints(java.util.List<Vector3d> points)
Decomposes the specified concave polygon into convex polygons.
|
static java.util.List<Polygon> |
fromConcavePoints(Vector3d... points)
Decomposes the specified concave polygon into convex polygons.
|
static Polygon |
fromPoints(java.util.List<Vector3d> points)
Creates a polygon from the specified point list.
|
static Polygon |
fromPoints(java.util.List<Vector3d> points,
PropertyStorage shared)
Creates a polygon from the specified point list.
|
static Polygon |
fromPoints(Vector3d... points)
Creates a polygon from the specified points.
|
static Polygon |
fromPointsAllowDegenerate(java.util.List<Vector3d> vertices2) |
Bounds |
getBounds()
Returns the bounds of this polygon.
|
javafx.scene.paint.Color |
getColor() |
java.util.ArrayList<Vertex> |
getDegeneratePoints() |
Edge |
getLongEdge() |
java.util.List<Vector3d> |
getPoints() |
PropertyStorage |
getStorage()
Gets the storage.
|
boolean |
isDegenerate() |
boolean |
isValid()
Indicates whether this polyon is valid, i.e., if it
|
Polygon |
movex(java.lang.Number howFarToMove)
Movex.
|
Polygon |
movey(java.lang.Number howFarToMove)
Movey.
|
Polygon |
movez(java.lang.Number howFarToMove)
Movez.
|
static java.util.ArrayList<Vertex> |
pruneDuplicatePoints(java.util.List<Vertex> incoming) |
Polygon |
rotx(java.lang.Number degreesToRotate)
Rotx.
|
Polygon |
roty(java.lang.Number degreesToRotate)
Roty.
|
Polygon |
rotz(java.lang.Number degreesToRotate)
Rotz.
|
Polygon |
scale(java.lang.Number scaleValue)
Scale.
|
Polygon |
scalex(java.lang.Number scaleValue)
Scalex.
|
Polygon |
scaley(java.lang.Number scaleValue)
Scaley.
|
Polygon |
scalez(java.lang.Number scaleValue)
Scalez.
|
Polygon |
setColor(javafx.scene.paint.Color color) |
void |
setDegenerate(boolean degenerate) |
java.lang.String |
toStlString()
Returns this polygon in STL string format.
|
java.lang.StringBuilder |
toStlString(java.lang.StringBuilder sb)
Returns this polygon in STL string format.
|
java.lang.String |
toString() |
Polygon |
transform(Transform transform)
Applies the specified transformation to this polygon.
|
Polygon |
transformed(Transform transform)
Returns a transformed copy of this polygon.
|
Polygon |
translate(Vector3d v)
Translates this polygon.
|
Polygon |
translated(Vector3d v)
Returns a translated copy of this polygon.
|
public final java.util.ArrayList<Vertex> vertices
public Plane plane
public Polygon(java.util.List<Vertex> vertices, PropertyStorage shared, boolean allowDegenerate)
vertices - polygon verticesshared - shared propertypublic Polygon(java.util.List<Vertex> vertices, PropertyStorage shared)
vertices - polygon verticesshared - shared propertypublic Polygon(java.util.List<Vertex> vertices)
vertices - polygon verticespublic Polygon(Vertex... vertices)
vertices - polygon verticespublic static java.util.List<Polygon> fromConcavePoints(Vector3d... points)
points - the points that define the polygonpublic static java.util.List<Polygon> fromConcavePoints(java.util.List<Vector3d> points)
points - the points that define the polygonpublic static java.util.ArrayList<Vertex> pruneDuplicatePoints(java.util.List<Vertex> incoming)
public Polygon clone()
clone in class java.lang.Objectpublic Polygon flip()
public Polygon flipped()
public java.lang.String toStlString()
public java.lang.StringBuilder toStlString(java.lang.StringBuilder sb)
sb - string builderpublic Polygon translate(Vector3d v)
v - the vector that defines the translationpublic Polygon translated(Vector3d v)
v - the vector that defines the translationpublic Polygon transform(Transform transform)
transform - the transformation to applypublic Polygon transformed(Transform transform)
transform - the transformation to applypublic static Polygon fromPoints(java.util.List<Vector3d> points, PropertyStorage shared)
points - the points that define the polygonshared - shared property storagepublic static Polygon fromPoints(java.util.List<Vector3d> points)
points - the points that define the polygonpublic static Polygon fromPoints(Vector3d... points)
points - the points that define the polygonpublic static Polygon fromPointsAllowDegenerate(java.util.List<Vector3d> vertices2)
public Bounds getBounds()
public boolean contains(Vector3d p)
p - the ppublic boolean contains(Polygon p)
p - the ppublic PropertyStorage getStorage()
public java.util.List<Vector3d> getPoints()
public Polygon movey(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Polygon movez(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Polygon movex(java.lang.Number howFarToMove)
howFarToMove - the how far to movepublic Polygon rotz(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotatepublic Polygon roty(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotatepublic Polygon rotx(java.lang.Number degreesToRotate)
degreesToRotate - the degrees to rotatepublic Polygon scalez(java.lang.Number scaleValue)
scaleValue - the scale valuepublic Polygon scaley(java.lang.Number scaleValue)
scaleValue - the scale valuepublic Polygon scalex(java.lang.Number scaleValue)
scaleValue - the scale valuepublic Polygon scale(java.lang.Number scaleValue)
scaleValue - the scale valuepublic boolean isValid()
public void setDegenerate(boolean degenerate)
public boolean isDegenerate()
public java.util.ArrayList<Vertex> getDegeneratePoints()
public Edge getLongEdge()
public java.util.ArrayList<Edge> edges()
public Polygon setColor(javafx.scene.paint.Color color)
public javafx.scene.paint.Color getColor()
public java.lang.String toString()
toString in class java.lang.Object