viewclear(); resolution = 10; ###################################################### # the upper budy of the clock. cu1 = cbspline(3, list( ctlpt (e2, 0.0, 0.92), ctlpt (e2, 0.1, 0.81), ctlpt (e2, 0.15,0.87), ctlpt (e2, 0.15,0.83), ctlpt (e2, 0.2, 0.81), ctlpt (e2, 0.25,0.8), ctlpt (e2, 0.3, 0.83) ), list(KV_OPEN) ); cb1 = cbspline(3, list( ctlpt (e2, 0.3, 0.37), ctlpt (e2, 0.28, 0.32), ctlpt (e2, 0.0, 0.32) ), list(KV_OPEN) ); mat1 = homomat(list (list (-1,0, 0, 0), list (0, 1, 0, 0), list (0, 0, 1, 0), list (0, 0, 0, 1) ) ); cs1 = cbezier(list( ctlpt (e2, 0.3, 0.83), ctlpt (e2, 0.3, 0.4))); cs2 = -cs1*mat1; cu = -cu1*mat1 + cu1; cb = cb1*mat1 + -cb1; free(cu1); free(cb1); cf=cu + cs1 + -cb + cs2; free(cs1); free(cs2); axis1 = cbezier(list( ctlpt (e3, 0.0, 0.0, 0), ctlpt (e3, 0.0, 0.0, 0.2) ) ); body1 = sweepsrf(cf,axis1,off); free(cf); free(axis1); srf1 = sfromcrvs(list(cu,cb),2); free(cu); free(cb); upBudy = list(srf1,srf1*tz(0.2),body1); free(srf1); free(body1); attrib(upBudy,"rgb","210,200,20"); clockList=list(upBudy); ########################################################################### # main budy of clock box1 = box(vector(-0.45,0.95,-0.1),0.9,0.1,0.4); box2 = box(vector(-0.025,-0.025,-0.01),0.05,0.05,0.02)*rz(45); attrib(box2,"rgb","255,255,255"); attrib(box1,"rgb","150,150,150"); boxList=list(box1); for(i=-0.4,0.1,0.4, boxList=boxList+list(box2*trans(vector(i,1,-0.1))) ); for(i=-0.4,0.1,0.4, boxList=boxList+list(box2*trans(vector(i,1,0.3))) ); box2=box2*ry(90); for(i=-0.1,0.1,0.3, boxList=boxList+list(box2*trans(vector(-0.45,1,i))) ); for(i=-0.1,0.1,0.3, boxList=boxList+list(box2*trans(vector(0.45,1,i))) ); clockList=clockList+boxList; free(boxList); free(box2); ##################################################################### # the clock disk cir1=circle(vector(0,0.6,0),0.2); disk1 = boolone(cir1*tz(-0.03)); axis1=cbezier(list( ctlpt (e3, 0, 0, -0.03), ctlpt (e3, 0, 0, 0) ) ); cir2 = circle(vector(0,0,0),0.03); frame1=sweepsrf(cir2,cir1,off); free(cir1); free(axis1); attrib(disk1,"rgb","170,70,10"); attrib(frame1,"rgb","250,250,250"); box2=box(vector(-0.013,-0.013,-0.013),0.026,0.026,0.026) *rx(45)*rz(45)*tx(0.25); attrib(box2,"rgb","180,200,200"); boxList=list(box2*ty(0.6)); for(i=15,15,359, boxList=boxList+list(box2*rz(i)*ty(0.6)) ); clockList=clockList+list(disk1,frame1)+boxList; free(boxList); ########################################################################### # MEHOGIM cm1 = cbspline(3, list ( ctlpt(e3,-0.05 ,0 ,0), ctlpt(e3,-0.04 ,0.004,0), ctlpt(e3, 0 ,0.004,0), ctlpt(e3, 0.1 ,0.004,0), ctlpt(e3, 0.11 ,0.02,0), ctlpt(e3, 0.12 ,0.015,0), ctlpt(e3, 0.125,0.003,0), ctlpt(e3, 0.17 ,0 ,0) ), list(KV_OPEN) ); mat1 = homomat (list (list(1, 0, 0, 0), list(0 , -1, 0, 0), list(0 , 0, 1, 0), list(0 , 0, 0, 1) ) ); mahog1=sfromcrvs(list(-cm1,cm1*mat1),2)* rz(170)*ty(0.6)*tz(-0.035); cm2 = cbspline(3, list ( ctlpt(e3,-0.05 ,0 ,0), ctlpt(e3,-0.04 ,0.005,0), ctlpt(e3, 0 ,0.01,0), ctlpt(e3, 0.01 ,0.005,0), ctlpt(e3, 0.05 ,0.03,0), ctlpt(e3, 0.065 ,0.015,0), ctlpt(e3, 0.085 ,0.01,0), ctlpt(e3, 0.1 ,0 ,0) ), list(KV_OPEN) ); mahog2=sfromcrvs(list(-cm2,cm2*mat1),2)* rz(60)*ty(0.6)*tz(-0.04); clockList=clockList+list(mahog1,mahog2); ####################################################### # amudim. cir1 = circle(vector(0,0,0),0.15); axis1 = cbezier(list( ctlpt(e3, 0, 0 ,0), ctlpt(e3, 0, 0 ,7.7) ) ); scaleCrv = cbspline(3, list ( ctlpt(e2, 0., 0), ctlpt(e2, 0.02, 1), ctlpt(e2, 0.05, 2), ctlpt(e2, 0.07, 0.5), ctlpt(e2, 0.12, 3.5), ctlpt(e2, 0.15, 2), ctlpt(e2, 0.2, 0.6), ctlpt(e2, 0.23, 3.5), ctlpt(e2, 0.28, 1.2), ctlpt(e2, 0.3, 0.8), ctlpt(e2, 0.4, 1.5), ctlpt(e2, 0.45, 2), ctlpt(e2, 0.5, 1.5), ctlpt(e2, 0.55, 0.7), ctlpt(e2, 0.6, 1), ctlpt(e2, 0.65, 1.8), ctlpt(e2, 0.7, 0.65), ctlpt(e2, 0.8, 1.5), ctlpt(e2, 0.95, 3.5), ctlpt(e2, 0.98, 0) ), list (KV_OPEN)); srf1 = swpsclsrf (cir1,axis1,scalecrv,off,1) * scale(vector(0.2,0.2,0.2)); srfr = srf1*trans(vector(0.37,-0.1,-0.35))*rx(270); srfl = srf1*trans(vector(-0.37,-0.1,-0.35))*rx(270); amudim=list(srfl,srfr); free(cir1); free(axis1); free(scaleCrv); free(srf1); free(srfl); free(srfr); ######################################################################### cir1=circle(vector(0,0,0),0.015); axis1 = cbezier(list( ctlpt(e3, 0, 0 ,-0.05), ctlpt(e3, 0, 0 ,0.05) ) ); cil=sweepsrf(cir1,axis1,off); cilMet = cil*trans(vector(0,0.6,0.2)); cil1=cil*ry(90); cilur=cil1*trans(vector(0.3 ,0.75,0.1)); cilul=cil1*trans(vector(-0.3,0.75,0.1)); cildr=cil1*trans(vector(0.3 ,0.45,0.1)); cildl=cil1*trans(vector(-0.3,0.45,0.1)); cilinders=list(cilur,cilul,cildr,cildl,cilMet); free(cilur); free(cilul); free(cildr); free(cildl); free(cilMet); free(cil); clockList=clockList+cilinders; clockList=clockList+amudim; ############################################################# # "metutelet" cil1=circle(vector(0,0,0),0.01)*sx(3); axis1 = cbezier(list( ctlpt(e3, 0, 0.65,0.25), ctlpt(e3, 0, 0 ,0.25) ) ); met1=sweepsrf(cil1,axis1,off); met2=sphere(vector(0,0,0.25),0.06)*sx(2.3)*sy(2.3); clockList=clockList+list(met1,met2); ############################################################# # "the 4 up spheres spr1=sphere(vector(0,0,0),0.07); sprr1=spr1*trans(vector(0.43, 1, -0.09)); sprr2=spr1*trans(vector(0.43, 1, 0.29)); sprl1=spr1*trans(vector(-0.43, 1, -0.09)); sprl2=spr1*trans(vector(-0.43, 1, 0.29)); spr=list(sprr1,sprr2,sprl1,sprl2); free(sprr1); free(sprr2); free(sprl1); free(sprl2); clockList=clockList+spr; ############################################################## # botton box crv1 = cbspline(2, list( ctlpt(e3, -1.6, 0.5 ,0), ctlpt(e3, 1.6, 0.5 ,0), ctlpt(e3, 1.6,-0.5 ,0), ctlpt(e3, -1.6,-0.5 ,0), ctlpt(e3, -1.6, 0.5 ,0) ), list(KV_OPEN) ); axis1 = cbezier(list( ctlpt(e3, 0, 0.48 ,1.1), ctlpt(e3, 0, 0.48 ,2.7) ) ); scaleCrv = cbspline(3, list ( ctlpt(e2, 0.0, 1.4), ctlpt(e2, 0.1, 1.3), ctlpt(e2, 0.2, 1.28), ctlpt(e2, 0.3, 1.5), ctlpt(e2, 0.4, 1.3), ctlpt(e2, 0.5, 1.8), ctlpt(e2, 0.6, 1.5), ctlpt(e2, 0.7, 1.1), ctlpt(e2, 0.8, 1.5), ctlpt(e2, 0.9, 2) ), list (KV_OPEN)); srf1 = swpsclsrf (crv1,axis1,scalecrv,off,1) * scale(vector(0.2,0.2,0.2))*rx(90); crvup=crv1*scale(vector(0.28,0.28,0.28))*rx(90); srfup=boolone(crvup)*tz(0.096)*ty(-0.22); crvdown=crv1*scale(vector(0.4,0.4,0.4))*rx(90); srfdown=boolone(crvdown)*tz(0.096)*ty(-0.54); clockList=clockList+list(srf1,srfup,srfdown); ############################################################################### # top "Kishut" shape=cbspline ( 3, list(ctlpt(p3, 1.000 ,0.0 ,0.9 ,0.000), ctlpt(p3, 1.000 ,0.01 ,0.7 ,0.000), ctlpt(p3, 1.000 ,0.2 ,0.2 ,0.000), ctlpt(p3, 1.000 ,0.5 ,0.25 ,0.000), ctlpt(p3, 1.000 ,0.5 ,0.5 ,0.000), ctlpt(p3, 1.000 ,0.55 ,0.45 ,0.000), ctlpt(p3, 1.000 ,0.65 ,0.25 ,0.000), ctlpt(p3, 1.000 ,0.8 ,0.2 ,0.000), ctlpt(p3, 1.000 ,0.9 ,0.1 ,0.000), ctlpt(p3, 1.000 ,1.0 ,0.0 ,0.000) ), list(0.000000, 0.000000, 0.000000, 1.000000, 2.000000, 3.415822, 3.415822, 5.000000, 6.000000, 7.000000, 8.000000, 8.000000, 8.000000 )); shape=-shape+ shape*homomat( list( list(-1, 0, 0, 0), list( 0, 1, 0, 0), list( 0, 0, 1, 0), list( 0, 0, 0, 1) ) ); button= cbezier(list ( ctlpt(e3,-1,-0.1,0), ctlpt(e3, 1,-0.1,0) ) ); axis1 = cbezier(list(ctlpt(e3,0,0,-0.3), ctlpt(e3,0,0,0.3) ) ); srfuk = sfromcrvs(list(-shape,button),2); upk=list(sweepsrf(shape,axis1,off),srfuk*tz(-0.3),srfuk*tz(0.3)); upkishut1=upk*scale(vector(0.3,0.1,0.3))*ty(1.05)*tz(0.1); upkishut2=upk*scale(vector(0.2,0.2,0.2))*ty(1.05)*tz(0.1); upkishut3=upk*scale(vector(0.1,0.3,0.1))*ty(1.05)*tz(0.1); attrib(upkishut1,"rgb","200,130,60"); attrib(upkishut2,"rgb","160,100,40"); attrib(upkishut3,"rgb","125,80,25"); upkishut=list( upkishut1,upkishut2,upkishut3) ; free(upkishut1); free(upkishut2); free(upkishut3); clockList = clockList+upKishut; ##################################################################### # digits ## the I digit bi=box(vector(-0.1,-0.25,0),0.2,0.5,0.02); bu=box(vector(-0.25,0.25,0),0.5,0.2,0.02); bd=box(vector(-0.25,-0.25,0),0.5,-0.2,0.02); I=list(bi,bu,bd); ## the X digit bx1=box(vector(-0.10,-0.50,0),0.2,1.0,0.02)*rz(45); bx2=box(vector(-0.10,-0.50,0),0.2,1.0,0.02)*rz(-45); bdl=bd*trans(vector(-0.3,0,0)); bdr=bd*trans(vector(0.3,0,0)); bul=bu*trans(vector(-0.3,0,0)); bur=bu*trans(vector(0.3,0,0)); X=list(bx1,bx2,bdl,bdr,bul,bur); ## the V digit bv1=box(vector(-0.10,-0.40,0),0.2,0.8,0.02)*rz(30)*trans(vector(-0.20,0,0)); bv2=box(vector(-0.10,-0.40,0),0.2,0.8,0.02)*rz(150)*trans(vector(0.20,0.0,0)); bvl=bu*trans(vector(-0.3,0,0)); bvr=bu*trans(vector(0.3,0,0)); bvd=box(vector(-0.09,-0.20,0),0.18,-0.2,0.02); V=list(bvl,bvr,bvd,bv1,bv2); free(bu); free(bi); free(bd); iii=list(i*tx(0.3),i,i*tx(-0.3))*tx(-3); vi=list(v*tx(0.3),i*tx(-0.35))*ty(-3); ix=List(i*tx(0.35),x*tx(-0.3))*tx(3); xii=list(x*tx(0.55),i*tx(-0.3),i*tx(-0.6))*ty(3); digits=list(iii,vi,ix,xii)*scale(vector(0.05,0.05,0.05))*ty(0.6)*tz(-0.032); attrib(digits,"rgb","200,200,200"); clockList=clockList+digits; view(list(view_mat,clockList),false);