!********************************************** BASIC GEOMETRY MODULE blines( FLOAT dz:=500 >"Spacing !"); !* Generates equally spaced buttock lines. !* !* (C)Microform AB, J.Kjellander !* !********************************************** INT i,j,n,nu,nv; FLOAT bmax,z; VECTOR p1; REF hull_id,r_id; STRING s*132; BEGINMODULE !* !***Check spacing. !* if dz < 1 then exit("Spacing is too small !"); endif; !* !***Global ID of hull. !* set_root_gm(); hull_id:=get_next_gm(1,16384,"hull"); !* !***ID for right hull surface. !* s:=rstr(hull_id); r_id:=rval(s+"#30#33"); !* !***How many patches. !* getsurh(r_id,"NPATU",nu); getsurh(r_id,"NPATV",nv); !* !***Where is max beam. Z=0 in centre of hull !***so bmax will be a negative number on right !***half. !* bmax:=0.0; for i:=0 to 50*nu do p1:=on(r_id,vec(i/50.0,nv)); if p1.z < bmax then bmax:=p1.z; endif; endfor; !* !***Create buttocks on right half of hull. !* i:=1; z:=-dz; loop: csys_1p(#1,"Cutplane",vec(0,0,z),0,0,0:BLANK=1,PEN=6); n:=n_cur_int(r_id,refc(1,i)); for j:=1 to n do cur_int(#2,r_id,refc(1,i),j:BLANK=0,PEN=2); endfor; z:=z-dz; i:=i+1; if z > bmax then goto loop; endif; ENDMODULE !*****************************************************