| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsmithers.java3d.Polygon3D
public class Polygon3D
Represents a polygon in 3D space. This class represents a polygon by a sequence of vertices. No guarantee is made that these are coplanar (in fact, such a guarantee would be impossible in the presence of floating-point rounding errors), but most uses of this class will only make sense for (almost) planar polgons.
| Constructor Summary | |
|---|---|
| Polygon3D()Constructs a new, empty Polygon3D. | |
| Polygon3D(float[]... points)Constructs a new Polygon3Dfrom the specified points. | |
| Polygon3D(int size)Constructs a new, empty Polygon3D. | |
| Method Summary | |
|---|---|
|  void | add(float[] point)Adds a new point to the end of the array of vertices. | 
|  float[][] | points()Returns the array of points which make up this polygon. | 
|  Polygon3D | scale(float factor)Scales the polygon by the given factor. | 
|  float[] | vertexCentroid()Computes the "centre" of this polygon. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public Polygon3D()
Polygon3D.
public Polygon3D(int size)
Polygon3D.
size - the number of points the polygon should have space forpublic Polygon3D(float[]... points)
Polygon3D from the specified points.
points - the vertices of the new polygon| Method Detail | 
|---|
public void add(float[] point)
point - the new pointpublic float[][] points()
public float[] vertexCentroid()
public Polygon3D scale(float factor)
factor - the scale factor to use
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||