#include "voxel_2.h"
#include "puzzle.h"
#include "../halfedge/polyhedron.h"
#include "math.h"
Classes | |
struct | genPar |
Defines | |
#define | Epsilon 1.0e-6 |
Functions | |
static void | outTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, genPar &par) |
static void | normalize (float *x, float *y, float *z) |
static void | shiftToHoleBorder (int nr, float *x, float *y, float *z) |
static void | drawTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, int edge12, int edge23, int edge31, int rec, genPar &par) |
static float | radius (float a, genPar &par) |
static void | findPointOnArc (float xs, float ys, float zs, float xe, float ye, float ze, float arc, float *x, float *y, float *z) |
static void | drawHolePiece (int i, float start, float end, float x1, float y1, float z1, float x2, float y2, float z2, int rec, genPar &par) |
static void | drawHole (int i, float x1, float y1, float z1, float x2, float y2, float z2, int rec, int rec2, genPar &par) |
static void | shiftToConnectingHole (float px, float py, float pz, float rad, float *x, float *y, float *z) |
static void | drawConnectingTriangle (float x1, float y1, float z1, float x2, float y2, float z2, genPar &par) |
static void | drawConnectingHole (float hx, float hy, float hz, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, int edgeflag, int rec, genPar &par) |
static void | makeSphere (uint16_t neighbors, int recursion, bool hollow, bool variable, genPar &par) |
static bool | curvOk (float curvrad, float cnrad, float sprad, float offset) |
Variables | |
static int | connectionPoints [12][3] |
static int | holeTouchPoints [12][6][3] |
static int | trianglePoints [8][3][3+1] |
static int | squarePoints [6][8][4] |
#define Epsilon 1.0e-6 |
static bool curvOk | ( | float | curvrad, | |
float | cnrad, | |||
float | sprad, | |||
float | offset | |||
) | [static] |
Referenced by voxel_2_c::getMeshInternal().
static void drawConnectingHole | ( | float | hx, | |
float | hy, | |||
float | hz, | |||
float | x1, | |||
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
float | x3, | |||
float | y3, | |||
float | z3, | |||
float | x4, | |||
float | y4, | |||
float | z4, | |||
int | edgeflag, | |||
int | rec, | |||
genPar & | par | |||
) | [static] |
References drawConnectingTriangle(), drawTriangle(), genPar::hole_diam, normalize(), genPar::outside, shiftToConnectingHole(), and genPar::sphere_rad.
Referenced by makeSphere().
static void drawConnectingTriangle | ( | float | x1, | |
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
genPar & | par | |||
) | [static] |
References genPar::inner_rad, normalize(), genPar::offset, outTriangle(), and genPar::sphere_rad.
Referenced by drawConnectingHole().
static void drawHole | ( | int | i, | |
float | x1, | |||
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
int | rec, | |||
int | rec2, | |||
genPar & | par | |||
) | [static] |
References genPar::curvEnd, drawHolePiece(), genPar::holeStart, genPar::lineEnd, normalize(), and shiftToHoleBorder().
Referenced by makeSphere().
static void drawHolePiece | ( | int | i, | |
float | start, | |||
float | end, | |||
float | x1, | |||
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
int | rec, | |||
genPar & | par | |||
) | [static] |
References connectionPoints, Epsilon, findPointOnArc(), outTriangle(), and radius().
Referenced by drawHole().
static void drawTriangle | ( | float | x1, | |
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
float | x3, | |||
float | y3, | |||
float | z3, | |||
int | edge12, | |||
int | edge23, | |||
int | edge31, | |||
int | rec, | |||
genPar & | par | |||
) | [static] |
References genPar::inner_rad, normalize(), genPar::offset, genPar::outside, outTriangle(), shiftToHoleBorder(), and genPar::sphere_rad.
Referenced by drawConnectingHole(), and makeSphere().
static void findPointOnArc | ( | float | xs, | |
float | ys, | |||
float | zs, | |||
float | xe, | |||
float | ye, | |||
float | ze, | |||
float | arc, | |||
float * | x, | |||
float * | y, | |||
float * | z | |||
) | [static] |
static void makeSphere | ( | uint16_t | neighbors, | |
int | recursion, | |||
bool | hollow, | |||
bool | variable, | |||
genPar & | par | |||
) | [static] |
References genPar::connection_rad, connectionPoints, drawConnectingHole(), drawHole(), drawTriangle(), Epsilon, genPar::fb_face, FF_COLOR_LIGHT, FF_VARIABLE_FACE, FF_WIREFRAME, genPar::flags, genPar::hole_diam, holeTouchPoints, normalize(), genPar::outside, shiftToConnectingHole(), shiftToHoleBorder(), genPar::sphere_rad, squarePoints, and trianglePoints.
Referenced by voxel_2_c::getMeshInternal().
static void normalize | ( | float * | x, | |
float * | y, | |||
float * | z | |||
) | [static] |
Referenced by drawConnectingHole(), drawConnectingTriangle(), drawHole(), drawTriangle(), makeSphere(), shiftToConnectingHole(), and shiftToHoleBorder().
static void outTriangle | ( | float | x1, | |
float | y1, | |||
float | z1, | |||
float | x2, | |||
float | y2, | |||
float | z2, | |||
float | x3, | |||
float | y3, | |||
float | z3, | |||
genPar & | par | |||
) | [static] |
References genPar::color, genPar::fb_face, genPar::fb_index, genPar::flags, genPar::vl, genPar::xc, genPar::yc, and genPar::zc.
Referenced by drawConnectingTriangle(), drawHolePiece(), and drawTriangle().
static float radius | ( | float | a, | |
genPar & | par | |||
) | [static] |
References genPar::connection_rad, genPar::curvRad, genPar::curvX, genPar::curvY, Epsilon, genPar::offset, and genPar::sphere_rad.
Referenced by drawHolePiece().
static void shiftToConnectingHole | ( | float | px, | |
float | py, | |||
float | pz, | |||
float | rad, | |||
float * | x, | |||
float * | y, | |||
float * | z | |||
) | [static] |
static void shiftToHoleBorder | ( | int | nr, | |
float * | x, | |||
float * | y, | |||
float * | z | |||
) | [static] |
References connectionPoints, and normalize().
Referenced by drawHole(), drawTriangle(), and makeSphere().
int connectionPoints[12][3] [static] |
Initial value:
{ {-1,-1, 0}, {-1,+1, 0}, {+1,-1, 0}, {+1,+1, 0}, {-1, 0,-1}, {-1, 0,+1}, {+1, 0,-1}, {+1, 0,+1}, { 0,-1,-1}, { 0,-1,+1}, { 0,+1,-1}, { 0,+1,+1} }
Referenced by drawHolePiece(), makeSphere(), and shiftToHoleBorder().
int holeTouchPoints[12][6][3] [static] |
Referenced by makeSphere().
int squarePoints[6][8][4] [static] |
Referenced by makeSphere().
int trianglePoints[8][3][3+1] [static] |
Referenced by makeSphere().