-- Masashi Mizota, graduate school, Hosei Univewrsity, 2004 --model space 30~-30 --grid size = 100 Bone(x[3], a[1]) { array cen_conv[39], cen_upperjaw[3], cen_upperjaw_bound[3], cen_lefteye[12], cen_righteye[12]; array vertex_nose[18], vertex_cheek_right[12], vertex_cheek_left[12]; array S_head[13], S_lefteye[4], S_righteye[4], S_nose[5], S_cheek[3]; array vec_cheek_2_right[15], vec_cheek_2_left[15], S_cheek2[4]; array cen_bsp1[3], cen_block1[3], cen_bsp2[3], cen_block2[3]; array cen_tooth[3], cen_b[3]; array xt[3], xs[3]; xs[1]=x[1]; xs[2]=x[2]; xs[3]=x[3]; tmp = hfScale3D(xs, 0.7, 0.7, 0.7); xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; --- Head Convolusion -------------------------------- cen_conv = [ 0.0, 1.0, 0.0, 4.0, 5.0, 0.0, -4.0, 5.0, 0.0, 0.0, 1.0, 3.0, 0.0, 1.0, -5.0, 0.0, 7.0, 2.0, 0.0, 7.0, -2.0, 0.0, 5.0, 5.0, 0.0, 5.0, -5.0, 3.0, 5.0, 4.0, -3.0, 5.0, 4.0, 2.0, 0.0, 4.0, -2.0, 0.0, 4.0 ]; S_head = [ 0.2,0.2,0.2, 0.2,0.2,0.2, 0.2,0.2,0.2, 0.2,0.2,0.2, 0.2 ]; headconv = hfConvPoint(xt, cen_conv, S_head, 0.9); --- upper jaw --------------------------------- cen_upperjaw = [ 0, -5, 5]; upperjaw_ell = hfSuperell(xt,cen_upperjaw,3.5,4.5,3.5,1.0,0.3); cen_upperjaw_bound = [-4, -6, 4]; upperjaw_bound = hfBlock(xt,cen_upperjaw_bound,8,4,8); upperjaw = upperjaw_ell & upperjaw_bound; --- Eye --------------------------------- cen_righteye = [ 2.0, 0.0, 8, 3.0, 0.5, 8, 3.5, -1.0, 8, 4.5, 0.0, 8 ]; cen_lefteye = [ -2.0, 0.0, 8, -3.0, 0.5, 8, -3.5, -1.0, 8, -4.5, 0.0, 8 ]; S_righteye = [0.85, 0.85, 0.85, 0.85]; S_lefteye = [0.85, 0.85, 0.85, 0.85]; lefteye = hfConvPoint(xt, cen_lefteye, S_lefteye, 0.2); righteye = hfConvPoint(xt, cen_righteye, S_righteye, 0.2); --- Nose --------------------------------- xt[1]=2*xt[1]; xt[2]=2*xt[2]; xt[3]=2*xt[3]; vertex_nose = [ 2, -9, 18, 0, -4, 18, -2, -9, 18, 2, -9, 16, 0, -4, 16, -2, -9, 16 ]; S_nose = [1.0, 1.0, 1.0, 1.0, 1.0]; nose = hfConvCurve(xt, vertex_nose,S_nose, 0.4); xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; --- cheek --------------------------------- vertex_cheek_right = [ 4.5, 4.5, 7, 7, 0.0, 6, 5, -3.5, 7, 1, -2.5, 4 ]; vertex_cheek_left = [ -4.5, 4.5, 7, -7, 0.0, 6, -5, -3.5, 7, -1, -2.5, 4 ]; S_cheek = [0.8, 0.8, 0.8]; right_cheek = hfConvCurve(xt, vertex_cheek_right, S_cheek, 0.7); left_cheek = hfConvCurve(xt, vertex_cheek_left, S_cheek, 0.7); cheek = right_cheek | left_cheek; --- cheek_2 --------------------------------- vec_cheek_2_right = [ 5, -3.5, 7, 7, -1.5, 5, 7, -1.5, 3, 7, -1.0, 2, 6, -0.8, 2 ]; vec_cheek_2_left = [ -5, -3.5, 7, -7, -1.5, 5, -7, -1.5, 3, -7, -1.0, 2, -6, -0.8, 2 ]; S_cheek2 = [0.9, 1.1, 1.1, 1.3]; cheek_2_right = hfConvCurve(xt, vec_cheek_2_right, S_cheek2, 0.7); cheek_2_left = hfConvCurve(xt, vec_cheek_2_left, S_cheek2, 0.7); cheek2 = cheek_2_right | cheek_2_left; --- Under jaw ---------------------------------- xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; tmp = hfTaperY(xt,-11,1,0.8,1.2); cylinder1 = 5.5^2 - (xt[1])^2 - ((xt[3] + 2)/2)^2; cylinder2 = 4.5^2 - (xt[1])^2 - ((xt[3] + 2)/2)^2; xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; cen_bsp1 = [0, 5 ,7]; bsp1 = hfSphere(xt, cen_bsp1, 16); cen_block1 = [-6, -12, 0 ]; bblock1 = hfBlock(xt, cen_block1, 12, 12, 9); cen_bsp2 = [0, 7 ,7]; bsp2 = hfSphere(xt, cen_bsp2, 15); cen_block2= [-6, -12, 4 ]; bblock2 = hfBlock(xt, cen_block2, 12, 14, 7); cyl = cylinder1 \ cylinder2; underjaw1 = cyl & bsp1 & bblock1; underjaw2 = cyl & bsp2 & bblock2; underjaw = underjaw1 \ underjaw2; --- tooth-------------------------------------- ---Right tooth--- xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; tmp = hfShift3D(xt, 1.8, -8, 6.5); cen_tooth = [0,0,0]; cen_b = [-2,0,-2]; Rtooth_cone = hfConeY(xt, cen_tooth, 0.5); b_Rtooth = hfBlock(xt, cen_b, 4,2,4); Rtooth = Rtooth_cone & b_Rtooth; ---Left tooth--- xt[1]=xs[1]; xt[2]=xs[2]-20; xt[3]=xs[3]; tmp = hfShift3D(xt, -1.8, -8, 6.5); Ltooth_cone = hfConeY(xt, cen_tooth, 0.5); b_Ltooth = hfBlock(xt, cen_b, 4,2,4); Ltooth = Ltooth_cone & b_Ltooth; tooth = Rtooth | Ltooth; --- Main ------------------------------------- bone_cheek = hfBlendUni(cheek, cheek2, 0.2,0.2,0.2); head1 = hfBlendUni(headconv , upperjaw ,0.2,0.2,0.2); head2 = hfBlendUni(head1 , bone_cheek ,0.2,0.2,0.2); head3 = head2 \ nose; head4 = head3 | underjaw | tooth; Bone = head4 \ lefteye \ righteye; }