13 #ifndef __GEO_ImplicitSurfaceOp_h__
14 #define __GEO_ImplicitSurfaceOp_h__
74 template <VEX_Precision PREC>
92 if (
trans.polarDecompose(&stretch))
94 myParms *= stretch.trace() / 3.0f;
158 int a_id,
int b_id,
int &out_id)
const;
160 int a_id,
int b_id,
int &out_id,
227 namespace GEO_ImplicitSurfaceOps {
234 template <
typename T>
237 template <
typename T>
240 template <
typename T>
244 template <
typename T>
247 template <
typename T>
250 template <
typename T>
254 template <
typename T>
257 template <
typename T>
258 T opShell(
T offset,
T thickness,
T a,
T &doffset,
T &dthickness,
T &da);
260 template <
typename T>
268 template <
typename T>
271 template <
typename T>
272 T opUnion(
T a,
T b,
int a_id,
int b_id,
int &
id,
T &da,
T &db);
274 template <
typename T>
277 template <
typename T>
282 template <
typename T>
285 template <
typename T>
288 template <
typename T>
291 template <
typename T>
296 template <
typename T>
299 template <
typename T>
302 template <
typename T>
305 template <
typename T>
310 template <
typename T>
313 template <
typename T>
316 template <
typename T>
319 template <
typename T>
328 template <
typename T>
331 template <
typename T>
334 template <
typename T>
337 template <
typename T>
342 template <
typename T>
345 template <
typename T>
347 T &dk,
T &drepulsion,
T &da,
T &db);
349 template <
typename T>
353 template <
typename T>
359 template <
typename T>
362 template <
typename T>
365 template <
typename T>
368 template <
typename T>
373 template <
typename T>
376 template <
typename T>
379 template <
typename T>
382 template <
typename T>
387 template <
typename T>
390 template <
typename T>
393 template <
typename T>
396 template <
typename T>
405 template <
typename T>
408 template <
typename T>
411 template <
typename T>
414 template <
typename T>
419 template <
typename T>
422 template <
typename T>
425 template <
typename T>
428 template <
typename T>
433 template <
typename T>
436 template <
typename T>
439 template <
typename T>
442 template <
typename T>
447 template <
typename T>
450 template <
typename T>
453 template <
typename T>
456 template <
typename T>
465 template <
typename T>
468 template <
typename T>
471 template <
typename T>
474 template <
typename T>
479 template <
typename T>
482 template <
typename T>
485 template <
typename T>
488 template <
typename T>
493 template <
typename T>
496 template <
typename T>
499 template <
typename T>
502 template <
typename T>
507 template <
typename T>
510 template <
typename T>
513 template <
typename T>
516 template <
typename T>
522 #endif // __GEO_ImplicitSurfaceOp_h__
static GEO_ImplicitSurfaceOp makeSubtract()
T opSmoothIntersect(T k, T a, T b, int a_id, int b_id, int &id)
Smooth intersect: -smooth_union(-a, -b)
static GEO_ImplicitSurfaceOp makeRoundDifference(VEXfloat< PREC > r)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
T opSubtract(T a, T b, int a_id, int b_id, int &id)
Subtract: r = max(a, -b)
T opShell(T offset, T thickness, T a)
Shell: r = abs(a - offset) - thickness.
VEXfloat< PREC > evalBinary(VEXfloat< PREC > a, VEXfloat< PREC > b, int a_id, int b_id, int &out_id) const
Evaluate binary operation.
T opSmoothRepulsiveUnion(T k, T repulsion, T a, T b, int a_id, int b_id, int &id)
Smooth repulsive union.
GEO_ImplicitSurfaceOp()=default
GEO_ImplicitSurfaceOp(GEO_ImplicitSurfaceOpID op_id, const UT_Vector4T< VEXfloat< PREC >> &op_parms={0, 0, 0, 0})
T opChamferUnion(T k, T a, T b, int a_id, int b_id, int &id)
Chamfer union.
T opUnion(T a, T b, int a_id, int b_id, int &id)
Union: r = min(a, b)
VEXfloat< PREC > evalUnary(VEXfloat< PREC > a) const
Evaluate unary operation.
GLboolean GLboolean GLboolean GLboolean a
T opSmoothUnion(T k, T a, T b, int a_id, int b_id, int &id)
Smooth union: polynomial smooth min.
static GEO_ImplicitSurfaceOp makeChamferSubtract(VEXfloat< PREC > r)
**But if you need a result
T opChamferSubtract(T k, T a, T b, int a_id, int b_id, int &id)
Chamfer subtract.
static GEO_ImplicitSurfaceOp makeSmoothRepulsiveUnion(VEXfloat< PREC > k, VEXfloat< PREC > repulsion)
static GEO_ImplicitSurfaceOpID opNameToID(const char *name)
Convert operation name string to ID.
T opInvert(T a)
Invert: r = -a.
static GEO_ImplicitSurfaceOp makeRoundSubtract(VEXfloat< PREC > r)
T opSmoothSubtract(T k, T a, T b, int a_id, int b_id, int &id)
Smooth subtract: smooth_intersect(a, -b)
static GEO_ImplicitSurfaceOp makeSmoothUnion(VEXfloat< PREC > k)
static GEO_ImplicitSurfaceOp makeRoundUnion(VEXfloat< PREC > r)
static GEO_ImplicitSurfaceOp makeChamferDifference(VEXfloat< PREC > r)
GA_API const UT_StringHolder trans
typename VEX_PrecisionResolver< P >::float_type VEXfloat
static GEO_ImplicitSurfaceOp makeChamferIntersect(VEXfloat< PREC > r)
T opRoundUnion(T k, T a, T b, int a_id, int b_id, int &id)
Round union.
static GEO_ImplicitSurfaceOp makeUnion()
T opDifference(T a, T b, int a_id, int b_id, int &id)
Difference: r = max(min(a,b), -max(a,b))
static GEO_ImplicitSurfaceOp makeIntersect()
T opRoundSubtract(T k, T a, T b, int a_id, int b_id, int &id)
Round subtract.
GEO_ImplicitSurfaceOpID
Operation ID enumeration matching VEX implicit_shapes_op.h.
T opRoundIntersect(T k, T a, T b, int a_id, int b_id, int &id)
Round intersect.
void evalBinaryBatched(int npts, const VEXfloat< PREC > *a, const VEXfloat< PREC > *b, const int *a_id, const int *b_id, int *out_id, VEXfloat< PREC > *result) const
static GEO_ImplicitSurfaceOp makeSmoothIntersect(VEXfloat< PREC > k)
T opChamferDifference(T k, T a, T b, int a_id, int b_id, int &id)
Chamfer difference.
GEO_ImplicitSurfaceOp(const char *name, const VEXmat3< PREC > &transform, const VEXvec4< PREC > &op_parms={0, 0, 0, 0})
GLuint const GLchar * name
T opRoundDifference(T k, T a, T b, int a_id, int b_id, int &id)
Round difference.
GLboolean GLboolean GLboolean b
static GEO_ImplicitSurfaceOp makeShell(VEXfloat< PREC > offset, VEXfloat< PREC > thickness)
GA_API const UT_StringHolder transform
GEO_ImplicitSurfaceOptFlag
T opIntersect(T a, T b, int a_id, int b_id, int &id)
Intersect: r = max(a, b)
static GEO_ImplicitSurfaceOp makeOffset(VEXfloat< PREC > offset)
static GEO_ImplicitSurfaceOp makeSmoothDifference(VEXfloat< PREC > k)
static GEO_ImplicitSurfaceOp makeDifference()
static GEO_ImplicitSurfaceOp makeInvert()
GEO_ImplicitSurfaceOpID myId
static GEO_ImplicitSurfaceOp makeRoundIntersect(VEXfloat< PREC > r)
void evalUnaryBatched(int npts, VEXfloat< PREC > *a) const
T opSmoothDifference(T k, T a, T b, int a_id, int b_id, int &id)
Smooth difference.
typename VEX_PrecisionResolver< P >::vec4_type VEXvec4
T opChamferIntersect(T k, T a, T b, int a_id, int b_id, int &id)
Chamfer intersect.
static const char * opIDToName(GEO_ImplicitSurfaceOpID op_id)
Convert operation ID to name string.
T opOffset(T offset, T a)
Offset: r = a - offset.
UT_Vector4T< VEXfloat< PREC > > myParms
typename VEX_PrecisionResolver< P >::mat3_type VEXmat3
static GEO_ImplicitSurfaceOp makeChamferUnion(VEXfloat< PREC > r)
static GEO_ImplicitSurfaceOp makeSmoothSubtract(VEXfloat< PREC > k)
void scale(VEXfloat< PREC > s)