|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectunlekker.modelbuilder.UGeometry
public class UGeometry
| Field Summary | |
|---|---|
BBox |
bb
Boundng box. |
float |
d
|
UFace[] |
face
List of faces. |
int |
faceNum
Current number of faces. |
float |
h
|
java.lang.String |
name
|
static java.lang.String |
NONAME
|
UVertexList[] |
vl
Array of vertex lists stored in this object. |
int |
vln
Number of vertex lists stored in this object. |
float |
w
|
| Fields inherited from interface processing.core.PConstants |
|---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
| Constructor Summary | |
|---|---|
UGeometry()
Create unnamed instance. |
|
UGeometry(java.lang.String _name)
Create named instance. |
|
UGeometry(UGeometry _g)
Create copy of existing UGeometry object. |
|
| Method Summary | |
|---|---|
UGeometry |
add(UGeometry g)
Adds all the faces of a UGeometry instance. |
UGeometry |
add(UVertexList vv)
Adds a UVertexList object to the vl array. |
void |
addFace(UFace f)
Add single face |
void |
addFace(UVec3 v1,
UVec3 v2,
UVec3 v3)
Adds single face from three UVec3 objects. |
void |
beginShape(int _type)
Starts building a new series of faces, using the same logic as PApplet.beginShape(). |
void |
calcBounds()
|
void |
calcFaceNormals()
|
void |
center()
Calculates bounding box and centers all faces by calling translate(-bb.c.x,-bb.c.y,-bb.c.z) |
void |
draw(processing.core.PApplet p)
Draws all faces contained in this UGeometry object. |
void |
drawVertexLists(processing.core.PApplet p)
Convenience method to call UVertexList.drawVertices()
on all vertex lists. |
void |
endShape()
|
static UGeometry |
extrude(UVertexList vl,
float z,
boolean reverse)
Produces a UGeometry mesh by extruding a QUAD_STRIP along its face normal. |
UGeometry |
getCopy()
Convenience method to produce a copy of this UGeometry instance. |
void |
quadStrip(UVertexList[] vl,
int vln)
Adds a mesh of QUAD_STRIPs built from an array of vertex lists. |
void |
quadStrip(UVertexList vl,
boolean reverseOrder)
Adds QUAD_STRIP of faces from a list of vertex pairs. |
void |
quadStrip(UVertexList v1,
UVertexList v2)
Adds QUAD_STRIP of faces built from two vertex lists. |
void |
quadStrip(UVertexList v1,
UVertexList v2,
boolean reverse)
Adds QUAD_STRIP of faces built from two vertex lists. |
void |
reset()
Resets geometry to empty. |
UGeometry |
rotateX(float a)
|
UGeometry |
rotateY(float a)
|
UGeometry |
rotateZ(float a)
|
UGeometry |
scale(float m)
|
UGeometry |
scale(float mx,
float my,
float mz)
|
UGeometry |
setDimensions(float m)
|
UGeometry |
setDimensionsXY(float m)
|
UGeometry |
setDimensionsXZ(float m)
|
UGeometry |
setDimensionsYZ(float m)
|
float |
surfaceArea()
|
UGeometry |
toOrigin()
Calculates bounding box and translates the mesh to origin by calling translate(-bb.min.x,-bb.min.y,-bb.min.z); |
UGeometry |
translate(float x,
float y,
float z)
|
UGeometry |
translate(UVec3 vv)
|
static float |
triangleArea(UVec3 v1,
UVec3 v2,
UVec3 v3)
|
void |
triangleFan(UVertexList vl,
boolean reverseOrder)
Adds a TRIANGLE_FAN constructed from input vertex list. |
void |
vertex(float x,
float y,
float z)
Add vertex to shape being built by beginShape() / endShape() |
void |
vertex(UVec3 v)
Add UVec3 vertex to shape being built by beginShape() / endShape()
The vertex information is copied, leaving the original UVec3 instance unchanged. |
void |
vertex(UVec3[] _v,
int nv)
Adds array of UVec3 vertices to shape being built by beginShape() / endShape(). |
void |
vertex(UVec3[] _v,
int nv,
boolean reverseOrder)
Adds array of UVec3 vertices to shape being built by beginShape() / endShape(). |
void |
vertex(UVertexList vl)
Adds vertex list to shape being built by beginShape() / endShape(). |
void |
vertex(UVertexList vl,
boolean reverseOrder)
Add vertex list to shape being built by beginShape() / endShape(). |
void |
writeSTL(processing.core.PApplet p,
java.lang.String filename)
Output binary STL file of mesh geometry. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String NONAME
public java.lang.String name
public UFace[] face
public int faceNum
public UVertexList[] vl
public int vln
public BBox bb
public float w
public float d
public float h
| Constructor Detail |
|---|
public UGeometry()
public UGeometry(java.lang.String _name)
public UGeometry(UGeometry _g)
| Method Detail |
|---|
public void reset()
public void quadStrip(UVertexList vl,
boolean reverseOrder)
vl - Array of vertex pairsreverseOrder - Build in reverse order?
public void quadStrip(UVertexList v1,
UVertexList v2)
v1 - First edge of QUAD_STRIPv2 - Second edge of QUAD_STRIP
public void quadStrip(UVertexList v1,
UVertexList v2,
boolean reverse)
v1 - First edge of QUAD_STRIPv2 - Second edge of QUAD_STRIPreverse - Build in reverse order?
public void quadStrip(UVertexList[] vl,
int vln)
vl - Array of vertex lists to be used as edges.vln - Number of lists to use from array
public void triangleFan(UVertexList vl,
boolean reverseOrder)
vl - Array of vertex pairsreverseOrder - Build in reverse order?public void beginShape(int _type)
_type - Shape type (TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, QUADS, QUAD_STRIP)public void endShape()
public void vertex(float x,
float y,
float z)
beginShape() / endShape()
x - y - z - public void vertex(UVec3 v)
beginShape() / endShape()
The vertex information is copied, leaving the original UVec3 instance unchanged.
v -
public void vertex(UVertexList vl,
boolean reverseOrder)
beginShape() / endShape().
All vertices are copied, leaving the original instances unchanged.
vl - reverseOrder - Add in reverse order?public void vertex(UVertexList vl)
beginShape() / endShape().
All vertices are copied, leaving the original instances unchanged.
public void vertex(UVec3[] _v,
int nv)
beginShape() / endShape().
All objects are copied, leaving the original instances unchanged.
_v - Array of verticesnv - Number of vertices to add
public void vertex(UVec3[] _v,
int nv,
boolean reverseOrder)
beginShape() / endShape().
All objects are copied, leaving the original instances unchanged.
_v - Array of verticesnv - Number of vertices to addreverseOrder - Add in reverse order?
public void addFace(UVec3 v1,
UVec3 v2,
UVec3 v3)
v1 - v2 - v3 - public UGeometry add(UVertexList vv)
vl array. The object
is stored by reference, so any changes made to it through this class will
also affect the original instance.
Not to be confused with vertex(UVertexList vl)
vv -
public UGeometry add(UGeometry g)
g - UGeometry to add
public void addFace(UFace f)
f - public void draw(processing.core.PApplet p)
p - Reference to PApplet instance to draw intopublic UGeometry rotateX(float a)
public UGeometry rotateY(float a)
public UGeometry rotateZ(float a)
public UGeometry translate(float x,
float y,
float z)
public UGeometry translate(UVec3 vv)
public UGeometry toOrigin()
translate(-bb.min.x,-bb.min.y,-bb.min.z);
public UGeometry scale(float m)
public UGeometry scale(float mx,
float my,
float mz)
public UGeometry getCopy()
public static UGeometry extrude(UVertexList vl,
float z,
boolean reverse)
z.
vl - Vertex list defining a QUAD_STRIP meshz - Offset to extrude by along the face normal, can be positive or negativereverse - Construct in reverse order? Useful in case face normals of
resulting mesh is incorrect.
public void calcBounds()
public void calcFaceNormals()
public void center()
translate(-bb.c.x,-bb.c.y,-bb.c.z)
public UGeometry setDimensions(float m)
public UGeometry setDimensionsXZ(float m)
public UGeometry setDimensionsXY(float m)
public UGeometry setDimensionsYZ(float m)
public void writeSTL(processing.core.PApplet p,
java.lang.String filename)
p - Reference to PApplet instancefilename - Name of file to save to
public static float triangleArea(UVec3 v1,
UVec3 v2,
UVec3 v3)
public float surfaceArea()
public void drawVertexLists(processing.core.PApplet p)
UVertexList.drawVertices()
on all vertex lists. NOTE: begin/endShape() are not called.
p - Reference to PApplet instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||