procedure create_s1_outer_jaw_block(loose_pin:boolean; var dxf_file:TextFile); type Tp=array[0..55] of Tpex; var s:string; p,raw_p:Tp; sections:array[0..3] of Tp; // 0=top, 1=middle, 2=seat, 3=plinth ztop,zmid,zseat,zplinth:extended; // down from rail top plinth_edge:Tpex; // from centre-line at jaw face rib_rad_top:extended; rib_rad_mid:extended; rib_rad_seat:extended; rib_rad_plinth:extended; fillet_rad_top:extended; fillet_rad_mid:extended; fillet_rad_seat:extended; fillet_rad_plinth:extended; i:integer; pn:integer; /////////////////////////////////////////////////// procedure do_rib_rad(pcentre:Tpex; rad,startk:extended; nmod:integer; make_horz_faces:boolean; z:extended); // do 90 degs convex rad var n:integer; nk:extended; begin for n:=0 to 6 do begin nk:=startk+n*Pi/12; // 15 deg steps clockwise p[n+nmod].x:=pcentre.x+rad*COS(nk); p[n+nmod].y:=pcentre.y-rad*SIN(nk); // y negative from gauge-face on outer jaw if (make_horz_faces=True) and (n>0) then begin s:=s+dxf_3dface_pex(p[n+nmod],z, pcentre,z, p[n+nmod-1],z, p[n+nmod-1],z, 21,0); end; end;//next end; /////////////////////////////////////////////////// procedure do_fillet_rad(pcentre:Tpex; rad,startk:extended; nmod:integer; make_horz_faces:boolean; z:extended; phorz:Tpex); // do 90 degs concave rad var n:integer; nk:extended; begin for n:=0 to 6 do begin nk:=startk-n*Pi/12; // 15 deg steps anticlockwise p[n+nmod].x:=pcentre.x+rad*COS(nk); p[n+nmod].y:=pcentre.y-rad*SIN(nk); // y negative from gauge-face on outer jaw if (make_horz_faces=True) and (n>0) then begin s:=s+dxf_3dface_pex(p[n+nmod],z, phorz,z, p[n+nmod-1],z, p[n+nmod-1],z, 21,0); end; end;//next end; /////////////////////////////////////////////////// begin if _3d=False then EXIT; for pn:=0 to 55 do begin p[pn].x:=0; p[pn].y:=0; end; // init all to prevent fp errors 223a with _3d_data do begin ztop:=0-(rail_section_data_mm.rail_depth_mm+(seat_thick-S1_outjaw_height_top)*inscale); // top of jaw // rad centres top ... p[50].x:=(S1_outjaw_half_rib_space_top-S1_outjaw_fillet_rad_top)*inscale; p[50].y:=0-(outer_jaw_face+S1_outjaw_depth_top+S1_outjaw_fillet_rad_top+outer_beefing)*inscale; p[51].x:=0-p[50].x; p[51].y:=p[50].y; p[52].x:=(S1_outjaw_half_rib_space_top+S1_outjaw_rib_width_top-S1_outjaw_rib_rad_top)*inscale; p[52].y:=0-(outer_jaw_face+S1_outjaw_depth_top+S1_outjaw_rib_depth_top-S1_outjaw_rib_rad_top+outer_beefing)*inscale; p[53].x:=(S1_outjaw_half_rib_space_top+S1_outjaw_rib_rad_top)*inscale; p[53].y:=p[52].y; p[54].x:=0-p[53].x; p[54].y:=p[52].y; p[55].x:=0-p[52].x; p[55].y:=p[52].y; // jaw top ... p[1].x:=(S1_outjaw_half_rib_space_top+S1_outjaw_rib_width_top)*inscale; p[1].y:=0-outer_jaw_face*inscale; p[0].x:=0-p[1].x; p[0].y:=p[1].y; p[46].x:=S1_outjaw_half_rib_space_top*inscale; p[46].y:=0-(outer_jaw_face+S1_outjaw_depth_top+outer_beefing)*inscale; p[47].x:=0-p[46].x; p[47].y:=p[46].y; p[49].x:=p[46].x; p[49].y:=p[0].y; p[48].x:=p[47].x; p[48].y:=p[0].y; rib_rad_top:=S1_outjaw_rib_rad_top*inscale; fillet_rad_top:=S1_outjaw_fillet_rad_top*inscale; end;//with if loose_pin=True then creating_block_str:='S1OUTJAL' else creating_block_str:='S1OUTJAW'; // 227a if stl=True then stl_block_list.AddObject(creating_block_str,TObjectList.Create); // 227a try s:=' 0|BLOCK| 2|'+creating_block_str+'|'; raw_p:=p; // for reset do_rib_rad(p[52],rib_rad_top,0,2,True,ztop); do_rib_rad(p[53],rib_rad_top,Pi/2,9,True,ztop); do_fillet_rad(p[50],fillet_rad_top,0,16,True,ztop,p[46]); do_fillet_rad(p[51],fillet_rad_top,0-Pi/2,23,True,ztop,p[47]); do_rib_rad(p[54],rib_rad_top,0,30,True,ztop); do_rib_rad(p[55],rib_rad_top,Pi/2,37,True,ztop); sections[0]:=p; // top x-section completed s:=s+dxf_3dface_pex( p[0],ztop, p[48],ztop, p[30],ztop, p[43],ztop, 21,0); // top surface of jaw ... s:=s+dxf_3dface_pex(p[48],ztop, p[49],ztop, p[46],ztop, p[47],ztop, 21,0); s:=s+dxf_3dface_pex(p[49],ztop, p[1],ztop, p[2],ztop, p[15],ztop, 21,0); s:=s+dxf_3dface_pex(p[53],ztop, p[52],ztop, p[8],ztop, p[9],ztop, 21,0); s:=s+dxf_3dface_pex(p[55],ztop, p[54],ztop, p[36],ztop, p[37],ztop, 21,0); p:=raw_p; // reset with _3d_data do begin zmid:=0-(rail_section_data_mm.rail_depth_mm+(seat_thick-S1_outjaw_height_mid)*inscale); // middle x-section // rad centres middle ... p[50].x:=(S1_outjaw_half_rib_space_mid-S1_outjaw_fillet_rad_mid)*inscale; p[50].y:=0-(outer_jaw_face+S1_outjaw_depth_mid+S1_outjaw_fillet_rad_mid+outer_beefing)*inscale; p[51].x:=0-p[50].x; p[51].y:=p[50].y; p[52].x:=(S1_outjaw_half_rib_space_mid+S1_outjaw_rib_width_mid-S1_outjaw_rib_rad_mid)*inscale; p[52].y:=0-(outer_jaw_face+S1_outjaw_depth_mid+S1_outjaw_rib_depth_mid-S1_outjaw_rib_rad_mid+outer_beefing)*inscale; p[53].x:=(S1_outjaw_half_rib_space_mid+S1_outjaw_rib_rad_mid)*inscale; p[53].y:=p[52].y; p[54].x:=0-p[53].x; p[54].y:=p[52].y; p[55].x:=0-p[52].x; p[55].y:=p[52].y; // jaw middle ... p[1].x:=(S1_outjaw_half_rib_space_mid+S1_outjaw_rib_width_mid)*inscale; p[1].y:=0-outer_jaw_face*inscale; p[0].x:=0-p[1].x; p[0].y:=p[1].y; p[46].x:=S1_outjaw_half_rib_space_mid*inscale; p[46].y:=0-(outer_jaw_face+S1_outjaw_depth_mid+outer_beefing)*inscale; p[47].x:=0-p[46].x; p[47].y:=p[46].y; p[49].x:=p[46].x; p[49].y:=p[0].y; p[48].x:=p[47].x; p[48].y:=p[0].y; rib_rad_mid:=S1_outjaw_rib_rad_mid*inscale; fillet_rad_mid:=S1_outjaw_fillet_rad_mid*inscale; end;//with raw_p:=p; // for reset do_rib_rad(p[52],rib_rad_mid,0,2,False,0); do_rib_rad(p[53],rib_rad_mid,Pi/2,9,False,0); do_fillet_rad(p[50],fillet_rad_mid,0,16,False,0,p[0]); do_fillet_rad(p[51],fillet_rad_mid,0-Pi/2,23,False,0,p[0]); do_rib_rad(p[54],rib_rad_mid,0,30,False,0); do_rib_rad(p[55],rib_rad_mid,Pi/2,37,False,0); sections[1]:=p; // middle x-section completed // sides of jaw... for i:=0 to 42 do s:=s+dxf_3dface_pex(sections[0][i],ztop, sections[0][i+1],ztop, sections[1][i+1],zmid, sections[1][i],zmid, 21,0); // down from top to middle ... s:=s+dxf_3dface_pex( sections[0][43],ztop, sections[0][0],ztop, sections[1][0],zmid, sections[1][43],zmid, 21,0); // back to start p:=raw_p; // reset // seat x-section ... with _3d_data do begin zseat:=0-rail_section_data_mm.rail_depth_mm; // seat x-section // rad centres seat ... p[50].x:=(S1_outjaw_half_rib_space_seat-S1_outjaw_fillet_rad_seat)*inscale; p[50].y:=0-(outer_jaw_face+S1_outjaw_depth_seat+S1_outjaw_fillet_rad_seat+outer_beefing)*inscale; p[51].x:=0-p[50].x; p[51].y:=p[50].y; p[52].x:=(S1_outjaw_half_rib_space_seat+S1_outjaw_rib_width_seat-S1_outjaw_rib_rad_seat)*inscale; p[52].y:=0-(outer_jaw_face+S1_outjaw_depth_seat+S1_outjaw_rib_depth_seat-S1_outjaw_rib_rad_seat+outer_beefing)*inscale; p[53].x:=(S1_outjaw_half_rib_space_seat+S1_outjaw_rib_rad_seat)*inscale; p[53].y:=p[52].y; p[54].x:=0-p[53].x; p[54].y:=p[52].y; p[55].x:=0-p[52].x; p[55].y:=p[52].y; // jaw seat ... p[1].x:=(S1_outjaw_half_rib_space_seat+S1_outjaw_rib_width_seat)*inscale; p[1].y:=0-outer_jaw_face*inscale; p[0].x:=0-p[1].x; p[0].y:=p[1].y; p[46].x:=S1_outjaw_half_rib_space_seat*inscale; p[46].y:=0-(outer_jaw_face+S1_outjaw_depth_seat+outer_beefing)*inscale; p[47].x:=0-p[46].x; p[47].y:=p[46].y; p[49].x:=p[46].x; p[49].y:=p[0].y; p[48].x:=p[47].x; p[48].y:=p[0].y; rib_rad_seat:=S1_outjaw_rib_rad_seat*inscale; fillet_rad_seat:=S1_outjaw_fillet_rad_seat*inscale; end;//with raw_p:=p; // for reset do_rib_rad(p[52],rib_rad_seat,0,2,False,0); do_rib_rad(p[53],rib_rad_seat,Pi/2,9,False,0); do_fillet_rad(p[50],fillet_rad_seat,0,16,False,0,p[0]); do_fillet_rad(p[51],fillet_rad_seat,0-Pi/2,23,False,0,p[0]); do_rib_rad(p[54],rib_rad_seat,0,30,False,0); do_rib_rad(p[55],rib_rad_seat,Pi/2,37,False,0); sections[2]:=p; // seat x-section completed // sides of jaw... for i:=0 to 42 do s:=s+dxf_3dface_pex(sections[1][i],zmid, sections[1][i+1],zmid, sections[2][i+1],zseat, sections[2][i],zseat, 21,0); // down from middle to seat ... s:=s+dxf_3dface_pex( sections[1][43],zmid, sections[1][0],zmid, sections[2][0],zseat, sections[2][43],zseat, 21,0); // back to start p:=raw_p; // reset // plinth x-section ... with _3d_data do begin zplinth:=0-(rail_section_data_mm.rail_depth_mm+(seat_thick-chair_plinth_thick)*inscale); // plinth x-section // rad centres plinth ... p[50].x:=(S1_outjaw_half_rib_space_plinth-S1_outjaw_fillet_rad_plinth)*inscale; p[50].y:=0-(outer_jaw_face+S1_outjaw_depth_plinth+S1_outjaw_fillet_rad_plinth+outer_beefing)*inscale; p[51].x:=0-p[50].x; p[51].y:=p[50].y; p[52].x:=(S1_outjaw_half_rib_space_plinth+S1_outjaw_rib_width_plinth-S1_outjaw_rib_rad_plinth)*inscale; p[52].y:=0-(outer_jaw_face+S1_outjaw_depth_plinth+S1_outjaw_rib_depth_plinth-S1_outjaw_rib_rad_plinth+outer_beefing)*inscale; p[53].x:=(S1_outjaw_half_rib_space_plinth+S1_outjaw_rib_rad_plinth)*inscale; p[53].y:=p[52].y; p[54].x:=0-p[53].x; p[54].y:=p[52].y; p[55].x:=0-p[52].x; p[55].y:=p[52].y; // jaw seat ... p[1].x:=(S1_outjaw_half_rib_space_plinth+S1_outjaw_rib_width_plinth)*inscale; p[1].y:=0-outer_jaw_face*inscale; p[0].x:=0-p[1].x; p[0].y:=p[1].y; p[46].x:=S1_outjaw_half_rib_space_plinth*inscale; p[46].y:=0-(outer_jaw_face+S1_outjaw_depth_plinth+outer_beefing)*inscale; p[47].x:=0-p[46].x; p[47].y:=p[46].y; p[49].x:=p[46].x; p[49].y:=p[0].y; p[48].x:=p[47].x; p[48].y:=p[0].y; rib_rad_plinth:=S1_outjaw_rib_rad_plinth*inscale; fillet_rad_plinth:=S1_outjaw_fillet_rad_plinth*inscale; end;//with raw_p:=p; // for reset do_rib_rad(p[52],rib_rad_plinth,0,2,True,zplinth); do_rib_rad(p[53],rib_rad_plinth,Pi/2,9,True,zplinth); do_fillet_rad(p[50],fillet_rad_plinth,0,16,True,zplinth,p[46]); do_fillet_rad(p[51],fillet_rad_plinth,0-Pi/2,23,True,zplinth,p[47]); do_rib_rad(p[54],rib_rad_plinth,0,30,True,zplinth); do_rib_rad(p[55],rib_rad_plinth,Pi/2,37,True,zplinth); sections[3]:=p; // plinth x-section completed s:=s+dxf_3dface_pex( p[0],zplinth, p[48],zplinth, p[30],zplinth, p[43],zplinth, 21,0); // bottom surface of jaw ... s:=s+dxf_3dface_pex(p[48],zplinth, p[49],zplinth, p[46],zplinth, p[47],zplinth, 21,0); s:=s+dxf_3dface_pex(p[49],zplinth, p[1],zplinth, p[2],zplinth, p[15],zplinth, 21,0); s:=s+dxf_3dface_pex(p[53],zplinth, p[52],zplinth, p[8],zplinth, p[9],zplinth, 21,0); s:=s+dxf_3dface_pex(p[55],zplinth, p[54],zplinth, p[36],zplinth, p[37],zplinth, 21,0); // add pin on underside of loose outer jaw, p[0].y on outer jaw face ... if loose_pin=True then s:=s+loose_jaw_pin_outer(False,False,0,p[0].y,zplinth,0); // S1 outer // sides of jaw... for i:=0 to 42 do s:=s+dxf_3dface_pex(sections[2][i],zseat, sections[2][i+1],zseat, sections[3][i+1],zplinth, sections[3][i],zplinth, 21,0); // down from seat to plinth ... s:=s+dxf_3dface_pex( sections[2][43],zseat, sections[2][0],zseat, sections[3][0],zplinth, sections[3][43],zplinth, 21,0); // back to start p:=raw_p; // reset // S1 outer do side bevels ... plinth_edge.y:=0-_3d_data.outer_jaw_face*inscale; // 237a plinth_edge.x:=0-(_2d_data.S1_chair_halfwide-_2d_data.S1_chair_crad_outer)*inscale; // plinth edge on corner rad centres // west side.. s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[2][0],zseat, sections[3][43],zplinth, sections[3][43],zplinth, 21,0); // visible side s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[3][0],zplinth, sections[3][43],zplinth, sections[3][43],zplinth, 21,0); // base s:=s+dxf_3dface_pex(sections[3][0],zplinth, sections[2][0],zseat, sections[3][43],zplinth, sections[3][43],zplinth, 21,0); // inside s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[3][0],zplinth, sections[2][0],zseat, sections[2][0],zseat, 21,0); // rear // east side.. plinth_edge.x:=0-plinth_edge.x; s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[2][1],zseat, sections[3][2],zplinth, sections[3][2],zplinth, 21,0); // visible side s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[3][1],zplinth, sections[3][2],zplinth, sections[3][2],zplinth, 21,0); // base s:=s+dxf_3dface_pex(sections[3][1],zplinth, sections[2][1],zseat, sections[3][2],zplinth, sections[3][2],zplinth, 21,0); // inside s:=s+dxf_3dface_pex(plinth_edge,zplinth, sections[3][1],zplinth, sections[2][1],zseat, sections[2][1],zseat, 21,0); // rear s:=s+' 0|ENDBLK|'; Write(dxf_file,insert_crlf_str(s)); // end of S1 outer finally creating_block_str:=''; end; end;