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 - sphere 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 - sphere 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 - sphere 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 - sphere 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 - sphere 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 - sphere 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 - sphere center array
a,b - elliptic half-axes along x,y
Test file: ellcyl.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: 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
----------------------------------------------
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