-- Virtual Shikki: Japanese sake pot -- minimal grid: 120 my_model(x[3], a[1]){ array center[3], bb_par[5], xa[3], xx[3]; xx[1] = x[1]-3; xx[2] = x[2]+3; xx[3] = x[3]; xt = xx[1]; yt = xx[2]; zt = xx[3]; -- main body & stand; bottom y = -5.4 center = [0, -0.5, 0]; sphere = hfSphere(xx,center, 5.5); cyl_n = hfCylinderY(xx,center, 3.2) & (-3-yt); -- stand blend1 = hfBlendUni(sphere,cyl_n,0.05,1,1); body = hfBlendInt(blend1,yt+5.4, -0.4, 1, 1); -- top sphere blend; top coordinate y = 1.5 cyl_v = hfCylinderY(xx,center, 5.5) & (yt+0.5); body = body | cyl_v; center = [0,-18.5,0]; clipsphere = hfSphere(xx,center, 20.); -- top sphere center = [0,0.,0]; -- blendbound = (-hfCylinderY(xx,center, 2.9)) & (yt+0.5); blendbound = (yt+0.5); bb_par[1] = body; bb_par[2] = clipsphere; bb_par[3] = blendbound; bb_par[4] = -1000.; bb_par[5] = 0.1; -- inline version of body = BlendIntB(xx, bb_par); f1 = bb_par[1] ; f2 = bb_par[2]; f3 = bb_par[3]; b0 = bb_par[4]; b1 = bb_par[5]; Inter = f1 & f2; w1 = f1^2 + f2^2; if (f3 > 0) then w2 = f3^2; else w2 = 0; endif; disp = b0*(1 - w1/(w1+b1*w2)); body = Inter + disp; -------------------- -- lid; top y = 1.8 center = [0,-5.2,0]; lid = hfSphere(xx,center, 7) & (yt-1.1); -- lid handle handle_y = 2.2; handle_r = 0.8; center = [0,2.2,0]; lid_ball = hfEllipsoid(xx,center, handle_r, 0.4, handle_r); lid_cyl = hfCylinderY(xx,center, handle_r) & (yt-1.1) & (handle_y - yt); center = [0,1.6,0]; torcut = hfTorusY(xx,center,1.1,0.7); body = body | lid | (lid_ball | lid_cyl \ torcut); -- two "ears" ear1 = 1 - ((xt-4.6)/0.15)^4 - ((yt-1.3)/1.6)^4 - (zt/0.75)^4; center = [0, 1.9, 0]; ear_hole = hfCylinderX(xx,center, 0.15); ear2 = 1 - ((xt+4.6)/0.15)^4 - ((yt-1.3)/1.6)^4 - (zt/0.75)^4; ears = ear1 | ear2; -- pot handle sel1 = 1 - (xt/4.45)^4 - ((yt-1.6)/9.4)^4 - (zt/10.)^4; sel2 = 1 - (xt/4.15)^4 - ((yt-1.6)/9.1)^4 - (zt/9.7)^4; handle = (sel1 \ sel2) & (0.8^2 - zt^2); h_cut = 1 - (xt/10)^4 - ((yt-11)/9.7)^4 - (zt/1.2)^4; handle = handle & h_cut; -- spout -- rotation -9 degrees around Z -> xp,yp,zp rotated point xa[1] = xt+5.6; xa[2] = yt+0.2; xa[3] = zt; tmp = hfRotate3DZ(xa,-3.14/20); xp = xa[1]-5.6; yp = xa[2]-0.2; zp = xa[3]; -- spout = 1 - ((xp+5.6)/10)^2 - ((yp+0.2)/1.4)^2 - (zp/0.95)^2; -- spout blend x:[-8,-3], y:[-5,2], z:[-1,1] -- shift xt-1.0; rotation ~+18 degrees around Z -> xr,yr,zr rotated point -- around the lowest ellipsoid point xa[1] = (xt-1.0)+4.0; xa[2] = yt+4.1; xa[3] = zt; tmp = hfRotate3DZ(xa,3.14/10.); xr = xa[1]-4.0; yr = xa[2]-4.1; zr = xa[3]; el_bl = 1 - ((xr+4.)/2.5)^2 - ((yr+0.2)/4.3)^2 - (zr/0.95)^2; el_bl = el_bl & (-0.5 - yt); bb_par[1] = spout; bb_par[2] = el_bl; center = [-7.6, -1.5, 0]; clipcyl = hfCylinderZ(xx,center, 2.6); bb_par[3] = clipcyl; bb_par[4] = 0.8; bb_par[5] = 0.03; -- inline version of spout = BlendUniB(xx, bb_par); f1 = bb_par[1]; f2 = bb_par[2]; f3 = bb_par[3]; b0 = bb_par[4]; b1 = bb_par[5]; Uni = f1 | f2; w1 = f1^2 + f2^2; if (f3 > 0) then w2 = f3^2; else w2 = 0; endif; disp = b0*(1 - w1/(w1+b1*w2)); spout = Uni + disp; ------------------- sp_hole = 1 - ((xp+5.6)/10)^2 - ((yp+0.2)/1.2)^2 - (zp/0.75)^2; sp_hole = sp_hole \ (yp+0.4); spout = ((spout \ (yp+0.2)) \sp_hole) \ ((yp+0.2)-0.8*(xp+10.2)); el_cut = 1-((xp+10.2)/1.6)^2-((yp+0.2)/0.5)^2-(zp/0.75)^2; spout = spout \ el_cut; my_model = body | (ears | handle \ ear_hole) | spout; }