Package eu.mihosoft.vrl.v3d
Class Polygon
java.lang.Object
eu.mihosoft.vrl.v3d.Polygon
Represents a convex polygon.
Each convex polygon has a
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).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
boolean
flip()
Flips this polygon.flipped()
Returns a flipped copy of this polygon.fromConcavePoints
(Vector3d... points) Decomposes the specified concave polygon into convex polygons.fromConcavePoints
(List<Vector3d> points) Decomposes the specified concave polygon into convex polygons.static Polygon
fromPoints
(Vector3d... points) Creates a polygon from the specified points.static Polygon
fromPoints
(List<Vector3d> points) Creates a polygon from the specified point list.static Polygon
fromPoints
(List<Vector3d> points, PropertyStorage shared) Creates a polygon from the specified point list.Returns the bounds of this polygon.getIntersection
(Vector3d planePoint, Vector3d planeNormal) getIntersection
(Straight line) Returns this polygon in STL string format.Returns this polygon in STL string format.Applies the specified transformation to this polygon.transformed
(Transform transform) Returns a transformed copy of this polygon.Translates this polygon.Returns a translated copy of this polygon.
-
Field Details
-
vertices
Polygon vertices -
plane
Plane defined by this polygon. Note: uses first three vertices to define the plane.
-
-
Constructor Details
-
Polygon
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.- Parameters:
vertices
- polygon verticesshared
- shared property
-
Polygon
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.- Parameters:
vertices
- polygon vertices
-
Polygon
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.- Parameters:
vertices
- polygon vertices
-
-
Method Details
-
fromConcavePoints
Decomposes the specified concave polygon into convex polygons.- Parameters:
points
- the points that define the polygon- Returns:
- the decomposed concave polygon (list of convex polygons)
-
fromConcavePoints
Decomposes the specified concave polygon into convex polygons.- Parameters:
points
- the points that define the polygon- Returns:
- the decomposed concave polygon (list of convex polygons)
-
clone
-
flip
Flips this polygon.- Returns:
- this polygon
-
flipped
Returns a flipped copy of this polygon. Note: this polygon is not modified.- Returns:
- a flipped copy of this polygon
-
toStlString
Returns this polygon in STL string format.- Returns:
- this polygon in STL string format
-
toStlString
Returns this polygon in STL string format.- Parameters:
sb
- string builder- Returns:
- the specified string builder
-
translate
Translates this polygon.- Parameters:
v
- the vector that defines the translation- Returns:
- this polygon
-
translated
Returns a translated copy of this polygon. Note: this polygon is not modified- Parameters:
v
- the vector that defines the translation- Returns:
- a translated copy of this polygon
-
transform
Applies the specified transformation to this polygon. Note: if the applied transformation performs a mirror operation the vertex order of this polygon is reversed.- Parameters:
transform
- the transformation to apply- Returns:
- this 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- Parameters:
transform
- the transformation to apply- Returns:
- a transformed copy of this polygon
-
fromPoints
Creates a polygon from the specified point list.- Parameters:
points
- the points that define the polygonshared
- shared property storage- Returns:
- a polygon defined by the specified point list
-
fromPoints
Creates a polygon from the specified point list.- Parameters:
points
- the points that define the polygon- Returns:
- a polygon defined by the specified point list
-
fromPoints
Creates a polygon from the specified points.- Parameters:
points
- the points that define the polygon- Returns:
- a polygon defined by the specified point list
-
getBounds
Returns the bounds of this polygon.- Returns:
- bouds of this polygon
-
contains
-
getIntersection
-
getIntersection
-
contains
-
getStorage
- Returns:
- the shared
-