HyperFun: Cat model

driwood246.jpg

my_model(x[3], a[1])
{
array head1Cent[3], hana1Cent[3], xface1Cent[3], xface2Cent[3],
xkuti1Cent[3], eye1Cent[3], eye2Cent[3], eye4Cent[3],
eye6Cent[3], eye8Cent[3], body1Cent[3], cubiwaCent[3],
suzuCent[3], hara1Cent[3], hara2Cent[3], hara4Cent[3],
hara5Cent[3], xllegCent[3], xrlegCent[3], xlfootCent[3],
xrfootCent[3], rhige1Cent[3], rhige2Cent[3], rhige3Cent[3],
xlhige1Cent[3], xlhige2Cent[3], xlhige3Cent[3],
hand1Cent[3], hand2Cent[3], ude1Cent[3];

xx=x[1];
y=x[2];
z=x[3];

-- head
head1Cent = [0, 4.5, 0];
head = hfEllipsoid(x, head1Cent, 6, 5.5, 6);

-- nose
hana1Cent = [0, 6.5, 5.9];
hana = hfEllipsoid(x, hana1Cent, 0.8, 0.8, 0.8);

-- face
xface1Cent = [0, 4.5, 0.3];
xface1 = hfEllipsoid(x, xface1Cent, 6, 5.5, 6);
xface2Cent = [0, 3.7, 0];
xface2 = hfEllCylZ(x, xface2Cent, 4.7, 4.5);
atama1 = xface1 & xface2;

-- mouth
xkuti1Cent = [0, 4.5, 6];
xkuti1 = hfEllipsoid(x, xkuti1Cent, 4, 4, 4);
xkuti2 = 4.5-y;
xkuti = xkuti1 & xkuti2;

-- eyes
eye1Cent = [0, 4.5, 0.4];
eye1 = hfEllipsoid(x, eye1Cent, 6, 5.5, 6);
eye2Cent = [1.5, 7.5, 0];
eye2 = hfEllCylZ(x, eye2Cent, 1.5, 1.4);
eye3 = eye1 & eye2;

eye4Cent = [-1.5, 7.5, 0];
eye4 = hfEllCylZ(x, eye4Cent, 1.5, 1.4);
eye5= eye1 & eye4;

eye6Cent = [0.3, 7.5, 5.5];
eye6 = hfEllipsoid(x, eye6Cent, 0.3, 0.3, 0.3);
eye7 = eye3 & (-eye6);

eye8Cent = [-0.3, 7.5, 5.5];
eye8 = hfEllipsoid(x, eye8Cent, 0.3, 0.3, 0.3);
eye9 = eye5 & (-eye8);

-- head final
atama = eye9| eye7 | atama1 | head | hana \ xkuti;

-- body
body1Cent = [0, -2, 0];
body1 = hfEllipsoid(x, body1Cent, 4.5, 6, 4.5);
body5 = body1 & (6.+y) & (1.-y);

-- neck
cubiwaCent = [0, 0, 0];
cubiwa = hfTorusY(x, cubiwaCent, 4, 0.5);

-- bell
suzuCent = [0, 0, 4.5];
suzu = hfSphere(x, suzuCent, 0.8);
body6 = body5 | cubiwa;

-- belly
hara1Cent = [0, -2, 0.3];
hara1 = hfEllipsoid(x, hara1Cent, 4.5, 6, 4.5);

hara2Cent = [0, -3, 0];
hara2 = hfEllCylZ(x, hara2Cent, 2.3, 2.3);
hara3 = hara1 & hara2;

hara4Cent = [0, -3, 0];
hara4 = hfEllCylZ(x, hara4Cent, 1.6, 1.6);

hara5Cent = [0, -2, 0.6];
hara5 = hfEllipsoid(x, hara5Cent, 4.5, 6, 4.5);
hara6 = -3-y;
body = body6 | (hara4 & hara6 & hara5) | hara3 | suzu;

-- legs and feet
xllegCent = [3, -7.5, 0];
xlleg = hfEllipsoid(x, xllegCent, 3, 1.5, 4);

xrlegCent = [-3, -7.5, 0];
xrleg = hfEllipsoid(x, xrlegCent, 3, 1.5, 4);

xlfootCent = [2, -6, 0];
xlfoot = hfEllipsoid(x, xlfootCent, 1, 1, 2);

xrfootCent = [-2, -6, 0];
xrfoot = hfEllipsoid(x, xrfootCent, 1, 1, 2);
ashi = (xlleg | xlfoot) | (xrleg | xrfoot);

-- right moustache
rh=0.2;
rhige1Cent = [2, -3, 4.5];
rhige1 = hfTorusZ(x, rhige1Cent, 10, rh);
rhige2Cent = [2, -3.5, 4.5];
rhige2 = hfTorusZ(x, rhige2Cent, 10, rh);
rhige3Cent = [2, -4, 4.5];
rhige3 = hfTorusZ(x, rhige3Cent, 10, rh);

-- left moustache
xlhige1Cent = [-2, -3, 4.5];
xlhige1 = hfTorusZ(x, xlhige1Cent, 10, rh);
xlhige2Cent = [-2, -3.5, 4.5];
xlhige2 = hfTorusZ(x, xlhige2Cent, 10, rh);
xlhige3Cent = [-2, -4, 4.5];
xlhige3 = hfTorusZ(x, xlhige3Cent, 10, rh);

rhani = (xx-0) & (7-xx);
rhige = (rhige1 | rhige2 | rhige3) & rhani & y;

xlhani = (xx+7) & (0-xx);
xlhige = (xlhige1 | xlhige2 | xlhige3) & xlhani & y;
hige = xlhige | rhige;

-- hands
hand1Cent = [8, -2.5, 0];
hand1 = hfSphere(x, hand1Cent, 1.41);
hand2Cent = [-8, -2.5, 0];
hand2 = hfSphere(x, hand2Cent, 1.41);

ude2 = xx+8;
ude3 = 8-xx;
ude1Cent = [0, -21, 0];
ude1 = hfTorusZ(x, ude1Cent, 20, 1);
te2 = (ude1 & ude3 & ude2) | hand1 | hand2;

-- final assembly
my_model = atama | body | ashi | te2 | hige;
}