BowlerKernel
|
Static Public Member Functions | |
static List< Polygon > | fromConcavePoints (Vector3d... points) |
static List< Polygon > | fromConcavePoints (List< Vector3d > points) |
static List< Vertex > | pruneDuplicatePoints (List< Vertex > incoming) |
static Polygon | fromPoints (List< Vector3d > points, PropertyStorage shared) |
static Polygon | fromPoints (List< Vector3d > points) |
static Polygon | fromPoints (Vector3d... points) |
static Polygon | fromPointsAllowDegenerate (List< Vector3d > vertices2) |
Public Attributes | |
final List< Vertex > | vertices |
final Plane | plane |
Private Member Functions | |
void | validateAndInit (boolean allowDegenerate) |
Static Private Member Functions | |
static Polygon | fromPoints (List< Vector3d > points, PropertyStorage shared, Plane plane, boolean allowDegenerate) |
Private Attributes | |
PropertyStorage | shared |
boolean | valid = true |
boolean | degenerate =false |
Represents a convex polygon.
Each convex polygon has a
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).
Definition at line 51 of file Polygon.java.
eu.mihosoft.vrl.v3d.Polygon.Polygon | ( | List< Vertex > | vertices, |
PropertyStorage | shared, | ||
boolean | allowDegenerate | ||
) |
Constructor. Creates a new polygon that consists of the specified vertices.
Note: the vertices used to initialize a polygon must be coplanar and form a convex loop.
vertices | polygon vertices |
shared | shared property |
Definition at line 110 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Plane.createFromPoints(), eu.mihosoft.vrl.v3d.Polygon.pruneDuplicatePoints(), eu.mihosoft.vrl.v3d.Polygon.shared, eu.mihosoft.vrl.v3d.Polygon.validateAndInit(), and eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.Polygon.clone(), and eu.mihosoft.vrl.v3d.Polygon.fromPoints().
eu.mihosoft.vrl.v3d.Polygon.Polygon | ( | List< Vertex > | vertices, |
PropertyStorage | shared | ||
) |
Constructor. Creates a new polygon that consists of the specified vertices.
Note: the vertices used to initialize a polygon must be coplanar and form a convex loop.
vertices | polygon vertices |
shared | shared property |
Definition at line 129 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.shared, and eu.mihosoft.vrl.v3d.Polygon.vertices.
eu.mihosoft.vrl.v3d.Polygon.Polygon | ( | List< Vertex > | vertices | ) |
Constructor. Creates a new polygon that consists of the specified vertices.
Note: the vertices used to initialize a polygon must be coplanar and form a convex loop.
vertices | polygon vertices |
Definition at line 141 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Plane.createFromPoints(), eu.mihosoft.vrl.v3d.Polygon.pruneDuplicatePoints(), eu.mihosoft.vrl.v3d.Polygon.validateAndInit(), and eu.mihosoft.vrl.v3d.Polygon.vertices.
eu.mihosoft.vrl.v3d.Polygon.Polygon | ( | Vertex... | vertices | ) |
Constructor. Creates a new polygon that consists of the specified vertices.
Note: the vertices used to initialize a polygon must be coplanar and form a convex loop.
vertices | polygon vertices |
Definition at line 209 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.vertices.
Polygon eu.mihosoft.vrl.v3d.Polygon.clone | ( | ) |
Definition at line 217 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.getStorage(), and eu.mihosoft.vrl.v3d.Polygon.Polygon().
Referenced by eu.mihosoft.vrl.v3d.CSG.clone(), eu.mihosoft.vrl.v3d.Polygon.flipped(), eu.mihosoft.vrl.v3d.Polygon.transformed(), and eu.mihosoft.vrl.v3d.Polygon.translated().
boolean eu.mihosoft.vrl.v3d.Polygon.contains | ( | Polygon | p | ) |
Contains.
p | the p |
Definition at line 518 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.contains(), eu.mihosoft.vrl.v3d.Vertex.pos, and eu.mihosoft.vrl.v3d.Polygon.vertices.
boolean eu.mihosoft.vrl.v3d.Polygon.contains | ( | Vector3d | p | ) |
Contains.
p | the p |
Definition at line 489 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.vertices, eu.mihosoft.vrl.v3d.Vector3d.x(), and eu.mihosoft.vrl.v3d.Vector3d.y().
Referenced by eu.mihosoft.vrl.v3d.Polygon.contains().
ArrayList<Edge> eu.mihosoft.vrl.v3d.Polygon.edges | ( | ) |
Definition at line 718 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.Polygon.getLongEdge().
Polygon eu.mihosoft.vrl.v3d.Polygon.flip | ( | ) |
Flips this polygon.
Definition at line 230 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Plane.flip(), eu.mihosoft.vrl.v3d.Polygon.plane, and eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.Polygon.flipped(), and eu.mihosoft.vrl.v3d.Polygon.transform().
Polygon eu.mihosoft.vrl.v3d.Polygon.flipped | ( | ) |
Returns a flipped copy of this polygon.
Note: this polygon is not modified.
Definition at line 248 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.clone(), and eu.mihosoft.vrl.v3d.Polygon.flip().
Referenced by eu.mihosoft.vrl.v3d.Extrude.polygons(), and eu.mihosoft.vrl.v3d.Toroid.Toroid().
|
static |
Decomposes the specified concave polygon into convex polygons.
points | the points that define the polygon |
Definition at line 94 of file Polygon.java.
References eu.mihosoft.vrl.v3d.ext.org.poly2tri.PolygonUtil.concaveToConvex(), and eu.mihosoft.vrl.v3d.Polygon.fromPoints().
|
static |
Decomposes the specified concave polygon into convex polygons.
points | the points that define the polygon |
Definition at line 82 of file Polygon.java.
References eu.mihosoft.vrl.v3d.ext.org.poly2tri.PolygonUtil.concaveToConvex(), and eu.mihosoft.vrl.v3d.Polygon.fromPoints().
Creates a polygon from the specified point list.
points | the points that define the polygon |
Definition at line 397 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.fromPoints().
|
static |
Creates a polygon from the specified point list.
points | the points that define the polygon |
shared | shared property storage |
Definition at line 386 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.shared.
Referenced by eu.mihosoft.vrl.v3d.Edge.boundaryPaths(), eu.mihosoft.vrl.v3d.Polygon.fromConcavePoints(), eu.mihosoft.vrl.v3d.Polygon.fromPoints(), eu.mihosoft.vrl.v3d.Polygon.fromPointsAllowDegenerate(), eu.mihosoft.vrl.v3d.ext.quickhull3d.HullUtil.hull(), eu.mihosoft.vrl.v3d.TextExtrude.loadPoints(), eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle(), eu.mihosoft.vrl.v3d.Extrude.polygons(), eu.mihosoft.vrl.v3d.Slice.sanatize(), eu.mihosoft.vrl.v3d.Extrude.toCCW(), eu.mihosoft.vrl.v3d.Edge.toPolygon(), eu.mihosoft.vrl.v3d.Polyhedron.toPolygons(), and eu.mihosoft.vrl.v3d.Toroid.Toroid().
|
staticprivate |
Creates a polygon from the specified point list.
points | the points that define the polygon |
shared | the shared |
plane | may be null |
Definition at line 421 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Vector3d.clone(), eu.mihosoft.vrl.v3d.Plane.normal, eu.mihosoft.vrl.v3d.Polygon.plane, eu.mihosoft.vrl.v3d.Polygon.Polygon(), eu.mihosoft.vrl.v3d.Polygon.shared, and eu.mihosoft.vrl.v3d.Polygon.vertices.
|
static |
Creates a polygon from the specified points.
points | the points that define the polygon |
Definition at line 407 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.fromPoints().
|
static |
Definition at line 410 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.fromPoints().
Referenced by eu.mihosoft.vrl.v3d.STL.file().
Bounds eu.mihosoft.vrl.v3d.Polygon.getBounds | ( | ) |
Returns the bounds of this polygon.
Definition at line 443 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Vertex.pos, eu.mihosoft.vrl.v3d.Polygon.vertices, eu.mihosoft.vrl.v3d.Vector3d.x(), eu.mihosoft.vrl.v3d.Vector3d.y(), and eu.mihosoft.vrl.v3d.Vector3d.z().
ArrayList<Vertex> eu.mihosoft.vrl.v3d.Polygon.getDegeneratePoints | ( | ) |
Definition at line 688 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.getLongEdge(), eu.mihosoft.vrl.v3d.Edge.getP1(), eu.mihosoft.vrl.v3d.Edge.getP2(), eu.mihosoft.vrl.v3d.Polygon.isDegenerate(), and eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.CSG.fixDegenerates().
Edge eu.mihosoft.vrl.v3d.Polygon.getLongEdge | ( | ) |
Definition at line 704 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.edges(), eu.mihosoft.vrl.v3d.Polygon.isDegenerate(), and eu.mihosoft.vrl.v3d.Edge.length().
Referenced by eu.mihosoft.vrl.v3d.CSG.fixDegenerates(), and eu.mihosoft.vrl.v3d.Polygon.getDegeneratePoints().
List<Vector3d> eu.mihosoft.vrl.v3d.Polygon.getPoints | ( | ) |
Definition at line 547 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.svg.SVGLoad.loadSingle(), eu.mihosoft.vrl.v3d.Slice.sanatize(), and eu.mihosoft.vrl.v3d.Extrude.toCCW().
PropertyStorage eu.mihosoft.vrl.v3d.Polygon.getStorage | ( | ) |
Gets the storage.
Definition at line 534 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.shared.
Referenced by eu.mihosoft.vrl.v3d.Polygon.clone(), eu.mihosoft.vrl.v3d.Extrude.polygons(), eu.mihosoft.vrl.v3d.Plane.splitPolygon(), and eu.mihosoft.vrl.v3d.Toroid.Toroid().
boolean eu.mihosoft.vrl.v3d.Polygon.isDegenerate | ( | ) |
Definition at line 683 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.degenerate.
Referenced by eu.mihosoft.vrl.v3d.Polygon.getDegeneratePoints(), and eu.mihosoft.vrl.v3d.Polygon.getLongEdge().
boolean eu.mihosoft.vrl.v3d.Polygon.isValid | ( | ) |
Indicates whether this polyon is valid, i.e., if it
Definition at line 672 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.valid.
Polygon eu.mihosoft.vrl.v3d.Polygon.movex | ( | Number | howFarToMove | ) |
Movex.
howFarToMove | the how far to move |
Definition at line 584 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed(), eu.mihosoft.vrl.v3d.Transform.translateX(), and eu.mihosoft.vrl.v3d.Transform.unity().
Polygon eu.mihosoft.vrl.v3d.Polygon.movey | ( | Number | howFarToMove | ) |
Movey.
howFarToMove | the how far to move |
Definition at line 562 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed(), eu.mihosoft.vrl.v3d.Transform.translateY(), and eu.mihosoft.vrl.v3d.Transform.unity().
Polygon eu.mihosoft.vrl.v3d.Polygon.movez | ( | Number | howFarToMove | ) |
Movez.
howFarToMove | the how far to move |
Definition at line 573 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed(), eu.mihosoft.vrl.v3d.Transform.translateZ(), and eu.mihosoft.vrl.v3d.Transform.unity().
|
static |
Definition at line 149 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Polygon.Polygon().
Polygon eu.mihosoft.vrl.v3d.Polygon.rotx | ( | Number | degreesToRotate | ) |
Rotx.
degreesToRotate | the degrees to rotate |
Definition at line 618 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.roty | ( | Number | degreesToRotate | ) |
Roty.
degreesToRotate | the degrees to rotate |
Definition at line 607 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.rotz | ( | Number | degreesToRotate | ) |
Rotz.
degreesToRotate | the degrees to rotate |
Definition at line 596 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.scale | ( | Number | scaleValue | ) |
Scale.
scaleValue | the scale value |
Definition at line 663 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.scalex | ( | Number | scaleValue | ) |
Scalex.
scaleValue | the scale value |
Definition at line 652 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.scaley | ( | Number | scaleValue | ) |
Scaley.
scaleValue | the scale value |
Definition at line 641 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
Polygon eu.mihosoft.vrl.v3d.Polygon.scalez | ( | Number | scaleValue | ) |
Scalez.
scaleValue | the scale value |
Definition at line 630 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.transformed().
void eu.mihosoft.vrl.v3d.Polygon.setDegenerate | ( | boolean | degenerate | ) |
Definition at line 680 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.degenerate.
Referenced by eu.mihosoft.vrl.v3d.Polygon.validateAndInit().
String eu.mihosoft.vrl.v3d.Polygon.toStlString | ( | ) |
Returns this polygon in STL string format.
Definition at line 257 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.CSG.toStlString(), and eu.mihosoft.vrl.v3d.Polygon.validateAndInit().
StringBuilder eu.mihosoft.vrl.v3d.Polygon.toStlString | ( | StringBuilder | sb | ) |
Returns this polygon in STL string format.
sb | string builder |
Definition at line 268 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Plane.normal, eu.mihosoft.vrl.v3d.Vector3d.toStlString(), and eu.mihosoft.vrl.v3d.Polygon.vertices.
Applies the specified transformation to this polygon.
Note: if the applied transformation performs a mirror operation the vertex order of this polygon is reversed.
transform | the transformation to apply |
Definition at line 341 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Vector3d.cross(), eu.mihosoft.vrl.v3d.Plane.dist, eu.mihosoft.vrl.v3d.Vector3d.dot(), eu.mihosoft.vrl.v3d.Polygon.flip(), eu.mihosoft.vrl.v3d.Vector3d.minus(), eu.mihosoft.vrl.v3d.Plane.normal, and eu.mihosoft.vrl.v3d.Vector3d.normalized().
Referenced by eu.mihosoft.vrl.v3d.Polygon.transformed().
Returns a transformed copy of this polygon.
Note: if the applied transformation performs a mirror operation the vertex order of this polygon is reversed.
Note: this polygon is not modified
transform | the transformation to apply |
Definition at line 375 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.clone(), and eu.mihosoft.vrl.v3d.Polygon.transform().
Referenced by eu.mihosoft.vrl.v3d.Polygon.movex(), eu.mihosoft.vrl.v3d.Polygon.movey(), eu.mihosoft.vrl.v3d.Polygon.movez(), eu.mihosoft.vrl.v3d.Extrude.polygons(), eu.mihosoft.vrl.v3d.Extrude.revolve(), eu.mihosoft.vrl.v3d.Polygon.rotx(), eu.mihosoft.vrl.v3d.Polygon.roty(), eu.mihosoft.vrl.v3d.Polygon.rotz(), eu.mihosoft.vrl.v3d.Polygon.scale(), eu.mihosoft.vrl.v3d.Polygon.scalex(), eu.mihosoft.vrl.v3d.Polygon.scaley(), eu.mihosoft.vrl.v3d.Polygon.scalez(), and eu.mihosoft.vrl.v3d.Toroid.Toroid().
Translates this polygon.
v | the vector that defines the translation |
Definition at line 304 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Vector3d.cross(), eu.mihosoft.vrl.v3d.Vector3d.minus(), eu.mihosoft.vrl.v3d.Plane.normal, and eu.mihosoft.vrl.v3d.Polygon.vertices.
Referenced by eu.mihosoft.vrl.v3d.Polygon.translated().
Returns a translated copy of this polygon.
Note: this polygon is not modified
v | the vector that defines the translation |
Definition at line 327 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Polygon.clone(), and eu.mihosoft.vrl.v3d.Polygon.translate().
|
private |
Definition at line 171 of file Polygon.java.
References eu.mihosoft.vrl.v3d.Edge.colinear(), eu.mihosoft.vrl.v3d.Vector3d.equals(), eu.mihosoft.vrl.v3d.Plane.normal, eu.mihosoft.vrl.v3d.Polygon.plane, eu.mihosoft.vrl.v3d.Polygon.setDegenerate(), eu.mihosoft.vrl.v3d.Polygon.toStlString(), eu.mihosoft.vrl.v3d.Polygon.valid, eu.mihosoft.vrl.v3d.Polygon.vertices, and eu.mihosoft.vrl.v3d.Vector3d.ZERO.
Referenced by eu.mihosoft.vrl.v3d.Polygon.Polygon().
|
private |
Definition at line 677 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Polygon.isDegenerate(), and eu.mihosoft.vrl.v3d.Polygon.setDegenerate().
final Plane eu.mihosoft.vrl.v3d.Polygon.plane |
Plane defined by this polygon.
Note: uses first three vertices to define the plane.
Definition at line 64 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Polygon.flip(), eu.mihosoft.vrl.v3d.Polygon.fromPoints(), eu.mihosoft.vrl.v3d.Edge.searchPlaneGroups(), eu.mihosoft.vrl.v3d.Plane.splitPolygon(), and eu.mihosoft.vrl.v3d.Polygon.validateAndInit().
|
private |
Shared property (can be used for shared color etc.).
Definition at line 58 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Polygon.fromPoints(), eu.mihosoft.vrl.v3d.Polygon.getStorage(), and eu.mihosoft.vrl.v3d.Polygon.Polygon().
|
private |
Definition at line 676 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Polygon.isValid(), and eu.mihosoft.vrl.v3d.Polygon.validateAndInit().
final List<Vertex> eu.mihosoft.vrl.v3d.Polygon.vertices |
Polygon vertices.
Definition at line 54 of file Polygon.java.
Referenced by eu.mihosoft.vrl.v3d.Bounds.contains(), eu.mihosoft.vrl.v3d.Polygon.contains(), eu.mihosoft.vrl.v3d.Polygon.edges(), eu.mihosoft.vrl.v3d.Polygon.flip(), eu.mihosoft.vrl.v3d.Polygon.fromPoints(), eu.mihosoft.vrl.v3d.Edge.fromPolygon(), eu.mihosoft.vrl.v3d.Polygon.getBounds(), eu.mihosoft.vrl.v3d.Polygon.getDegeneratePoints(), eu.mihosoft.vrl.v3d.Polygon.getPoints(), eu.mihosoft.vrl.v3d.Extrude.isCCW(), eu.mihosoft.vrl.v3d.Slice.isPolygonAtZero(), eu.mihosoft.vrl.v3d.Polygon.Polygon(), eu.mihosoft.vrl.v3d.Extrude.polygons(), eu.mihosoft.vrl.v3d.ext.org.poly2tri.PolygonUtil.pruneDuplicatePoints(), eu.mihosoft.vrl.v3d.Plane.splitPolygon(), eu.mihosoft.vrl.v3d.Edge.toPolygon(), eu.mihosoft.vrl.v3d.svg.SVGExporter.toPolyLine(), eu.mihosoft.vrl.v3d.Toroid.Toroid(), eu.mihosoft.vrl.v3d.Polygon.toStlString(), eu.mihosoft.vrl.v3d.Polygon.translate(), eu.mihosoft.vrl.v3d.CSG.updatePolygons(), and eu.mihosoft.vrl.v3d.Polygon.validateAndInit().