HyperFun: F-rep Library
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
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
----------------------------------------------
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