Shapes 3D  3.0
 All Classes Functions Variables Pages
shapes3d.contour.Polygon Class Reference
Inheritance diagram for shapes3d.contour.Polygon:

Public Member Functions

 Polygon (PVector[] verts, int dir, boolean open)
 
 Polygon (List< PVector > verts, int dir, boolean open)
 
Polygon mirror ()
 
PVector[] coords ()
 
UV[] uv ()
 
float[] v ()
 
int[] triangles ()
 
- Public Member Functions inherited from shapes3d.contour.Contour
int nbrSegs ()
 

Protected Attributes

PVector[] coords
 
UV[] uvNorm
 
float[] vNorm
 
float contour_length = 0
 
int[] tr = null
 
- Protected Attributes inherited from shapes3d.contour.Contour
int nbrSegs
 

Additional Inherited Members

- Static Public Member Functions inherited from shapes3d.contour.Contour
static PVector[] rotateCW (PVector[] vectors)
 
static PVector[] rotateCCW (PVector[] vectors)
 
static PVector[] flipV (PVector[] vectors)
 
static PVector[] flipH (PVector[] vectors)
 
- Public Attributes inherited from shapes3d.utils.SConstants
int WIRE = 0x00000011
 
int SOLID = 0x00000012
 
int TEXTURE = 0x00000014
 
int DRAWALL = WIRE | SOLID | TEXTURE
 
int WHITE = 0xFFFFFFFF
 
int BLACK = 0xFF000000
 
int GREY = 0xFFC0C0C0
 
int RED = 0xFFFF0000
 
int GREEN = 0xFF00FF00
 
int BLUE = 0xFF0000FF
 
int YELLOW = 0xFFFFFF00
 
int PURPLE = 0xFFFF00FF
 
int CYAN = 0xFF00FFFF
 
int ORANGE = 0xFFFFC000
 
int CW = 1
 
int CCW = 2
 
int ALL = 0b11111111
 
int BOTTOM = 0b00000001
 
int TOP = 0b00000010
 
int FRONT = 0b00000100
 
int BACK = 0b00001000
 
int LEFT = 0b00010000
 
int RIGHT = 0b00100000
 
int BODY = 0b00000001
 
int END0 = 0b00000010
 
int END1 = 0b00000100
 
float ONE_DEG_T = (float) (Math.PI / 180.0)
 
PathOrthogonal ORTHO_X = new PathOrthogonal.PathNormalX()
 
PathOrthogonal ORTHO_Y = new PathOrthogonal.PathNormalY()
 
PathOrthogonal ORTHO_Z = new PathOrthogonal.PathNormalZ()
 
PathOrthogonal ORTHO_A = new PathOrthogonal.PathNormalAMC()
 
TransformUV ROT_0 = TransformUV.ROT0
 
TransformUV ROT_90 = TransformUV.ROT90
 
TransformUV ROT_180 = TransformUV.ROT180
 
TransformUV ROT_270 = TransformUV.ROT270
 
TransformUV FLIP_H = TransformUV.FLIPH
 
TransformUV FLIP_V = TransformUV.FLIPV
 
Rotation ROTATION_ZERO = new Rotation()
 
int T_BOX = 0x1001
 
int T_DOME = 0x1002
 
int T_CONE = 0x1003
 
int T_ELLIPSOID = 0x1004
 
int T_EXTRUSION = 0x1005
 
int T_LATHESTOCK = 0x1006
 
int T_MD2 = 0x1007
 
int T_SKYBOX = 0x1008
 
int T_SKYDOME = 0x1009
 
int T_TERRAIN = 0x100A
 
int T_TUBE = 0x100B
 
int C_LATHESURFACE = 0x2001
 
int C_OVAL = 0x2002
 
int C_POLYGON = 0x2003
 
int P_BCURVE2D = 0x3001
 
int P_BCURVE3D = 0x3002
 
int P_BSPLINE2D = 0x3003
 
int P_BSPLINE3D = 0x3004
 
int P_LINEAR = 0x3005
 
int P_LISSAJOUS = 0x3006
 
int P_RING = 0x3007
 
int P_SPIRAL = 0x3008
 

Detailed Description

Defines an irregular polygon for the cross-section of an extruded shape.

The user supplied coordinates may represent an open or closed polygon in CW or CCW order but will be stored internally as a closed polygon in CCW order.

Author
Peter Lager

Constructor & Destructor Documentation

shapes3d.contour.Polygon.Polygon ( PVector[]  verts,
int  dir,
boolean  open 
)

Create a irregular polygon from the supplied vertices.

The contour coordinates should be XY plane when Z=0 and viewed from [0,0,1]

                    *v1
          *v2                   *v0
                  _____________________ +X
                 /|
            *v3 / |
               /  |            *v6
              /   |
             /    |      *v5
            / *v4 |
           /      |
         +Z       |
                  +Y 

The vertices are shown in CCW order. Note that the contour is open because the first and last vertex are different positions.

Parameters
vertsthe vertices in order
dirdirection of supplied vertices, CW or CCW
opentrue if the vertices form an open polygon or false for a closed polygon.

Member Function Documentation

PVector [] shapes3d.contour.Polygon.coords ( )
Returns
the [x, y, 0] coordinates for the vertices defining this polygon
Polygon shapes3d.contour.Polygon.mirror ( )
Returns
the Polygon that is a mirror of this one.
int [] shapes3d.contour.Polygon.triangles ( )
Returns
the indices for the vertices for each triangle (grouped in threes) to render the end cap
UV [] shapes3d.contour.Polygon.uv ( )
Returns
the normalized texture coordinates for this polygon
float [] shapes3d.contour.Polygon.v ( )
Returns
the v texture coordinates to be used when texturing the body of the shape

The documentation for this class was generated from the following file: