HyperFun: F-rep Library

Primitives
Operations
Test objects are inside the cube [-10,10] by x, y, z.


Primitive: Sphere (ball)

Definition: R^2-(x-x0)^2-(y-y0)^2-(z-z0)^2

Call: hfSphere(x,center,R);

Parameters:

x - point coordinates array

center - sphere center array

R - sphere radius

Test file: sphere.hf



Primitive: Ellipsoid

Definition: 1-((x-x0)/a)^2-((y-y0)/b)^2-((z-z0)/c)^2

Call: hfEllipsoid(x,center,a,b,c);

Parameters:

x - point coordinates array

center - ellipsoid center array

a,b,c - ellipsoid half-axes along x,y,z

Test file: ellipsoid.hf



Primitive: Cylinder with x-axis

Definition: R^2-(y-y0)^2-(z-z0)^2

Call: hfCylinderX(x,center,R);

Parameters:

x - point coordinates array

center - cylinder center array

R - cylinder radius

Test file: cylinder.hf



Primitive: Cylinder with y-axis

Definition: R^2-(x-x0)^2-(z-z0)^2

Call: hfCylinderY(x,center,R);

Parameters:

x - point coordinates array

center - cylinder center array

R - cylinder radius

Test file: cylinder.hf



Primitive: Cylinder with z-axis

Definition: R^2-(x-x0)^2-(y-y0)^2

Call: hfCylinderZ(x,center,R);

Parameters:

x - point coordinates array

center - cylinder center array

R - cylinder radius

Test file: cylinder.hf



Primitive: Elliptic cylinder with x-axis

Definition: 1-((y-y0)/a)^2-((z-z0)/b)^2

Call: hfEllCylX(x,center,a,b);

Parameters:

x - point coordinates array

center - cylinder center array

a,b - elliptic half-axes along x,z

Test file: ellcyl.hf



Primitive: Elliptic cylinder with y-axis

Definition: 1-((x-x0)/a)^2-((z-z0)/b)^2

Call: hfEllCylY(x,center,a,b);

Parameters:

x - point coordinates array

center - cylinder center array

a,b - elliptic half-axes along x,z

Test file: ellcyl.hf



Primitive: Elliptic cylinder with z-axis

Definition: 1-((x-x0)/a)^2-((y-y0)/b)^2

Call: hfEllCylZ(x,center,a,b);

Parameters:

x - point coordinates array

center - cylinder center array

a,b - elliptic half-axes along x,y

Test file: ellcyl.hf



Primitive: Cone with x-axis

Definition: (x-x0)^2-((y-y0)/R)^2-((z-z0)/R)^2

Call: hfConeX(x,center,R);

Parameters:

x - point coordinates array

center - cone apex array

R - cone radius at height=1

Test file: cone.hf



Primitive: Cone with y-axis

Definition: (y-y0)^2-((x-x0)/R)^2-((z-z0)/R)^2

Call: hfConeY(x,center,R);

Parameters:

x - point coordinates array

center - cone apex array

R - cone radius at height=1

Test file: cone.hf



Primitive: Cone with z-axis

Definition: (z-z0)^2-((x-x0)/R)^2-((y-y0)/R)^2

Call: hfConeZ(x,center,R);

Parameters:

x - point coordinates array

center - cone apex array

R - cone radius at height=1

Test file: cone.hf



Primitive: Elliptic cone with x-axis

Definition: (x-x0)^2-((y-y0)/a)^2-((z-z0)/b)^2

Call: hfEllConeX(x,center,a,b);

Parameters:

x - point coordinates array

center - cone apex array

a,b - elliptic half-axes along y, z at the distance 1 along x

Test file: ellcone.hf



Primitive: Elliptic cone with y-axis

Definition: (y-y0)^2-((x-x0)/a)^2-((z-z0)/b)^2

Call: hfEllConeY(x,center,a,b);

Parameters:

x - point coordinates array

center - cone apex array

a,b - elliptic half-axes along x, z at the distance 1 along y

Test file: ellcone.hf



Primitive: Elliptic cone with z-axis

Definition: (z-z0)^2-(x-x0)/a)^2-((y-y0)/b)^2

Call: hfEllConeZ(x,center,a,b);

Parameters:

x - point coordinates array

center - cone apex array

a,b - elliptic half-axes along x, y at the distance 1 along z

Test file: ellcone.hf



Primitive: Torus with X-axis

Definition: r0^2-(x-x0)^2-(y-y0)^2-(z-z0)^2-R^2+2*R*sqrt((z-z0)^2+(y-y0)^2)

Call: hfTorusX(x,center,R,r0);

Parameters:

x - point coordinates array

center - center array

R - radius of revolution

r0 - disk radius

Test file: torus.hf



Primitive: Torus with Y-axis

Definition: r0^2-(x-x0)^2-(y-y0)^2-(z-z0)^2-R^2+2*R*sqrt((z-z0)^2+(x-x0)^2)

Call: hfTorusY(x,center,R,r0);

Parameters:

x - point coordinates array

center - center array

R - radius of revolution

r0 - disk radius

Test file: torus.hf



Primitive: Torus with Z-axis

Definition: r0^2-(x-x0)^2-(y-y0)^2-(z-z0)^2-R^2+2*R*sqrt((x-x0)^2+(y-y0)^2)

Call: hfTorusZ(x,center,R,r0);

Parameters:

x - point coordinates array

center - center array

R - radius of revolution

r0 - disk radius

Test file: torus.hf



Primitive: Superellipsoid

Definition: 1-(((x-x0)/a)^2/s2+((y-y0)/b)^2/s2)^(s2/s1)-((z-z0)/c)^(2/s1)

Call: hfSuperell(x,center,a,b,c,s1,s2);

Parameters:

x - point coordinates array

center - center array

a,b,c - half-axes along x,y,z

s1, s2 - shape parameters,
s1 - "sharpness" in z-direction
s2 - "sharpness" in xy-direction
s1, s2 close to 0 - "block" shape
s1, s2 >> 0 - "star" shape

Test file: superell.hf



Primitive: Block

Definition: x:[vertex[1], vertex[1]+dx], ...

Call: hfBlock(x,vertex,dx,dy,dz);

Parameters:

x - point coordinates array

vertex - block vertex coordinates array

dx,dy,dz - edge lengths along x,y,z

Test file: block.hf



Primitive: Blobby object [Blinn 1982]

Definition: Sum b*exp(-a*r^2)-T

Call: hfBlobby(x,x0,y0,z0,a,b,T);

Parameters:

x - point coordinates

x0,y0,z0 - arrays of blob centers

a - array of a coefficients

b - array of b coefficients

T - threshold value

Test file: blobby.hf



Primitive: Metaballs object [Nishimura et al. 1985]

Definition: Sum(f(r))-T

f(r) = b(1-3r^2/d^2) 0<r<=d/3

1.5b(1-r/d)^2 d/3<r<=d

0 r>d,

r - distance to the given point

Call: hfMetaball(x,x0,y0,z0,b,d,T);

Parameters:

x - point coordinates

x0,y0,z0 - arrays of mataball centers

b - array of b coefficients

d - array of d radii of influence

T - threshold value

Test file: metaball.hf



Primitive: Soft object [Wyvill et al. 1986]

Definition: Sum f(r)

f(r) = 1 - 22r^2/9d^2 + 17r^4/9d^4 - 4r^6/9d^6

r - distance to the given point

Call: hfSoft(x,x0,y0,z0,d,T);

Parameters:

x - point coordinates

x0,y0,z0 - arrays of blob centers

d - array of d - radii of influence

T - threshold value

Test file: soft.hf

Primitive: Convolution with set of skeleton points

Definition: Sum f(r)

f(r) = 1 / (1 + S^2*r^2)^2, Cauchy kernel [McCormack and Sherstyuk 1998]

r - distance to a skeleton point

Call: hfConvPoint(x,vect,S,T);

Parameters:

x - point coordinates

vect - array of skeleton points' coordinates

S - array of kernel width control parameters for each point

T - threshold

Test file: convpoint.hf



Primitive: Convolution with set of skeleton line segments

Definition: Sum f(x)

f(x) is analytical convolution for a segment with Cauchy kernel [McCormack and Sherstyuk 1998]

Call: hfConvLine(x,begin,end,S,T);

Parameters:

x - point coordinates

begin - starting points coordinate array for line segments

end - ending points coordinate array for line segments

S - array of kernel width control parameters for each line segment

T - threshold

Test file: convline.hf



Primitive: Convolution with set of skeleton arcs

Definition: Sum f(x)

f(x) is analytical convolution for an arc with Cauchy kernel [McCormack and Sherstyuk 1998]

Call: hfConvArc(x,center,radius,theta,axis,angle,S,T);

Parameters:

x - point coordinates

center - coordinate array for centers of arcs

radius - array of arcs' radii

theta - array of arcs' angles (from positive x-axis counter-clockwise, 360 for full circle)

axis - array of vectors defining axis of rotation for each arc (placed on local xy-plane)

angle - angles of rotation for arcs around axis of rotation

S - array of kernel width control parameters for each arc

T - threshold

Test file: convarc.hf



Primitive: Convolution with set of triangles

Definition: Sum f(x)

f(x) is analytical convolution for a triangle with Cauchy kernel [McCormack and Sherstyuk 1998]

Call: hfConvTriangle(x,vect,S,T);

Parameters:

x - point coordinates

vect - coordinate array for vertices of triangles (9 elements for each)

S - array of kernel width control parameters for each triangle

T - threshold

Test file: convtri.hf



Primitive: Convolution with curve (set of connected skeleton line segments)

Definition: Sum f(x)

f(x) is analytical convolution for a segment with Cauchy kernel [McCormack and Sherstyuk 1998]

Call: hfConvCurve(x,vect,S,T);

Parameters:

x - point coordinates

vect - coordinate array for vertices of curve

S - array of kernel width control parameters for each line segment

T - threshold

Test file: convcurve.hf



Primitive: Convolution with mesh (set of connected triangles)

Definition: Sum f(x)

f(x) is analytical convolution for a triangle with Cauchy kernel [McCormack and Sherstyuk 1998]

Call: hfConvMesh(x,vect,tri,S,T);

Parameters:

x - point coordinates

vect - coordinate array for vertices

tri - index array of vertices for triangles (3 elements each)

S - array of kernel width control parameters for each triangle

T - threshold

Test file: convmesh.hf



Primitive: Solid noise

Definition: Series(x)*Series(y)*Series(z) with Gardner's series [Gardner 1984]

Call: hfNoiseG(x,amp,freq,phase);

Parameters:

x - point coordinates array

amp - noise amplitude

freq - noise frequency

phase - phase for sin() in the series

Test file: noiseg.hf



Primitive: Cubic B-spline object [Schmitt et al. 2000]

Definition: Object defined by F>=0, where F is a B-spline function of three variables

F(u,v,w) = Sum Sum Sum N_i(u)N_j(v)N_k(w)P_ijk

P_ijk - Control points of the cubic B-spline volume. Only the fourth coordinnate is used

Sum Sum Sum - triple sum with the 3 indeces i,j,k starting from 0 to l*n*m

N_i(u) : Cubic BSpline blending function.

Call: hfCubicBSplineF(x,l,m,n,bbox,ctr_pts);

Parameters:

x - point coordinates

l,m,n - number of control points on each axis

bbox - array defining the bounding box of the object

ctr_pts - array of value of each control points

Test file: bsplinef.hf



Primitive: Bézier spline object [Schmitt, Pasko, and Savchenko 1999]

Definition: Object defined by F>=0, where F is a Bezier spline function of three variables

F(u,v,w) = Sum Sum Sum B_i(u)B_j(v)B_k(w)P_ijk

P_ijk - Control points of the Bézier volume. Only the fourth coordinnate is used

Sum Sum Sum - triple sum with the 3 indeces i,j,k starting from 0 to l*n*m

Call: hfBezierSplineF(x,l,m,n,bbox,ctr_pts);

Parameters:

x - point coordinates

l,m,n - number of control points on each axis

bbox - array defining the bounding box of the object

ctr_pts - array of value of each control points

Test file: bezierf.hf



Transformation: Blending Union [Pasko and Savchenko 1994]

Definition: R_uni(f1,f2) + disp(f1,f2,a0,a1,a2)

disp(f1,f2,a0,a1,a2)=a0/(1+(f1/a1)^2+(f2/a2)^2)

Call: hfBlendUni(f1,f2,a0,a1,a2);

Parameters:

f1,f2 - two objects

a0,a1,a2 - blend parameters

Test file: blend.hf



Transformation: Blending Intersection [Pasko and Savchenko 1994]

Definition: R_int(f1,f2) + disp(f1,f2,a0,a1,a2)

disp(f1,f2,a0,a1,a2)=a0/(1+(f1/a1)^2+(f2/a2)^2)

Call: hfBlendInt(f1,f2,a0,a1,a2);

Parameters:

f1,f2 - two objects

a0,a1,a2 - blend parameters

Test file: blend.hf



Transformation: Scale in 3D space

Definition: x'=sx*x

Call: hfScale3D(xt,sx,sy,sz);

Parameters:

xt - point coordinates array to be changed

sx,sy,sz - scaling factors along axes

Test file: scale.hf



Transformation: Shift in 3D space

Definition: x'=x+dx

Call: hfShift3D(xt,dx,dy,dz);

Parameters:

xt - point coordinates array to be changed

dx,dy,dz - scaling factors along axes

Test file: shift.hf



Transformation: Rotation in 3D around z-axis

Definition: inverse mapping

x'=x*cos(theta)+y*sin(theta)

y'=-x*sin(theta)+y*cos(theta)

Call: hfRotate3DZ(xt,theta);

Parameters:

xt - point coordinates array to be changed

theta - rotation angle in radians

Test file: rotate.hf



Transformation: Rotation in 3D around y-axis

Definition: inverse mapping

z'=z*cos(theta)+x*sin(theta)

x'=-z*sin(theta)+x*cos(theta)

Call: hfRotate3DY(xt,theta);

Parameters:

xt - point coordinates array to be changed

theta - rotation angle in radians

Test file: rotate.hf



Transformation: Rotation in 3D around x-axis

Definition: inverse mapping

y'=y*cos(theta)+z*sin(theta)

z'=-y*sin(theta)+z*cos(theta)

Call: hfRotate3DX(xt,theta);

Parameters:

xt - point coordinates array to be changed

theta - rotation angle in radians

Test file: rotate.hf



Transformation: Twisting around z-axis

Definition: inverse mapping

t = (z-z1)/(z2-z1)

theta = (1-t)*theta1 + t*theta2

x'=x*cos(theta)+y*sin(theta)

y'=-x*sin(theta)+y*cos(theta)

Call: hfTwistZ(xt,z1,z2,theta1,theta2);

Parameters:

xt - point coordinates array to be changed

z1, z2 - end points of z-interval

theta1, theta2 - rotation angles in radians for end points

Test file: twist.hf



Transformation: Twisting around y-axis

Definition: inverse mapping

t = (y-y1)/(y2-y1)

theta = (1-t)*theta1 + t*theta2

z'=z*cos(theta)+x*sin(theta)

x'=-z*sin(theta)+x*cos(theta)

Call: hfTwistY(xt,y1,y2,theta1,theta2);

Parameters:

xt - point coordinates array to be changed

y1, y2 - end points of y-interval

theta1, theta2 - rotation angles in radians for end points

Test file: twist.hf



Transformation: Twisting around x-axis

Definition: inverse mapping

t = (x-x1)/(x2-x1)

theta = (1-t)*theta1 + t*theta2

y'=y*cos(theta)+z*sin(theta)

z'=-y*sin(theta)+z*cos(theta)

Call: hfTwistX(xt,x1,x2,theta1,theta2);

Parameters:

xt - point coordinates array to be changed

x1, x2 - end points of x-interval

theta1, theta2 - rotation angles in radians for end points

Test file: twist.hf



Transformation: Stretching in 3D space

Definition: x'=x0+(x-x0)/scale (inverse mapping)

Call: hfSTretch3D(xt,x0,sx,sy,sz);

Parameters:

xt - point coordinates array to be changed

x0 - reference point for stretching

sx,sy,sz - scaling factors along axes

Test file: stretch.hf



Transformation: Tapering along z-axis

Definition: inverse mapping

z1<= z <= z2

t = (z-z1)/(z2-z1)

scale = (1-t)*s1 + t*s2

x'=x/scale

y'=y/scale

z < z1 scale = s1

z > z2 scale = s2

Call: hfTaperZ(xt,z1,z2,s1,s2);

Parameters:

xt - point coordinates array to be changed

z1, z2 - end points of z-interval, z2 > z1

s1, s2 - scaling factors for end points

Test file: taper.hf



Transformation: Tapering along x-axis

Definition: inverse mapping

x1<= x <= x2

t = (x-x1)/(x2-x1)

scale = (1-t)*s1 + t*s2

y'=y/scale

z'=z/scale

x < x1 scale = s1

x > x2 scale = s2

Call: hfTaperX(xt,x1,x2,s1,s2);

Parameters:

xt - point coordinates array to be changed

x1, x2 - end points of x-interval, x2 > x1

s1, s2 - scaling factors for end points

Test file: taper.hf



Transformation: Tapering along y-axis

Definition: inverse mapping

y1<= y <= y2

t = (y-y1)/(y2-y1)

scale = (1-t)*s1 + t*s2

z'=z/scale

x'=x/scale

y < y1 scale = s1

y > y2 scale = s2

Call: hfTaperY(xt,y1,y2,s1,s2);

Parameters:

xt - point coordinates array to be changed

y1, y2 - end points of y-interval, y2 > y1

s1, s2 - scaling factors for end points

Test file: taper.hf



Transformation: Cubic space mapping

Definition: Space mapping (deformation) controlled by moving arbitrary points in space.
Inverse Mapping:

x' = x - Sum[ (delta_xi) * (1-vi)^3 / (1+vi)]

y' = y - Sum[ (delta_yi) * (1-vi)^3 / (1+vi)]

z' = z - Sum[ (delta_zi) * (1-vi)^3 / (1+vi)]

vi - ((x-xai)^2+(y-yai)^2+(z-zai)^2)/b^2.

(x,y,z)ai - x,y,z coordinnates of the ith moved point

Call: hfSpaceMapCubic(xt,original_points,delta_points,b);

Parameters:

xt - point coordinates array to be changed

original_points - Array of moved control points

delta_points - Array of values for the displacements of the moved points

b - parameter determining the incluence of the mapping

Test file: spacemap.hf



References

[Blinn 1982] Blinn J., A generalization of algebraic surface drawing, ACM Transactions on Graphics, vol. 1, No. 3, 1982, pp. 135-256.

[Gardner 1984] Gardner G., Simulation of natural scenes using textured quadric surfaces, SIGGRAPH'84, Computer Graphics vol. 18, July 1984, pp.11-20.

[McCormack and Sherstyuk 1998] McCormack J. and Sherstyuk A., Creating and rendering convolution surfaces, Computer Graphics Forum, vol. 17, No. 2, 1998, pp. 113-120.

[Nishimura et al. 1985] Nishimura H., Hirai M., Kawai T., Kawata T., Shirakawa I., Omura K., Object modeling by distributed function and a method of image generation, Transactions of IECE of Japan, vol. J68-D, No. 4, 1985, pp. 718-725 (in Japanese)

[Pasko and Savchenko 1994] Pasko A. and Savchenko V., Blending operations for the functionally based constructive geometry, Set-theoretic Solid Modeling: Techniques and Applications, CSG 94 Conference Proceedings, Information Geometers, Winchester, UK, 1994, pp.151-161.

[Schmitt et al. 2000] Schmitt B., Kazakov M., Pasko A., Savchenko V., Volume sculpting with 4D spline volumes, CISST'2000, Las Vegas, Ed. Hamid Arabnia, CSREA Press, vol. II, ISBN 1-892512-54-8, 2000, pp 475-483.

[Schmitt, Pasko, and Savchenko 99] Schmitt B., Pasko A., Savchenko V., Extended space mapping with Bezier patches and volumes, Implicit Surfaces '99, Eurographics/ACM SIGGRAPH Workshop (Bordeaux, France, September 13-15 1999), J. Hughes and C. Schlick (Eds.), pp. 25-31.

[Wyvill et al. 1986] Wyvill G., McPheeters C., Wyvill B., Data structure for soft objects, The Visual Computer, vol. 2, No. 4, 1986, pp. 227-234.