!*************************************************** !* BASIC GEOMETRY MODULE isonet( REF ytid >"@t16 Ange yta !"; INT nc_u:=0 >"Antal kurvor i U-led ? (0=auto)"; INT nc_v:=0 >"Antal kurvor i V-led ? (0=auto)"); !* Creates an UV-net on a surface. !* !**************************************************** INT nu,nv,i; FLOAT u,v,du,dv; BEGINMODULE !* !***Surface global identity. !* ytid:=global_ref(ytid,1); !* !***How many patches in U- and V-direction ? !* getsurh(ytid,"NPATU",nu); getsurh(ytid,"NPATV",nv); !* !***If nc_u = 0 or nc_v = 0 display all patch !***boundaries. !* if nc_u = 0 then nc_u:=nu+1; endif; if nc_v = 0 then nc_v:=nv+1; endif; !* !***Less than 2 curves in any diretion is meaningless. !* if nc_u < 2 or nc_v < 2 then exit("Minimum 2 curves in both directions needed !"); endif; !* !***Constant U-curves. !* du:=nu/(nc_u-1); u:=0; for i:=1 to nc_u do cur_iso(#1,ytid,"U",u,0,nv); u:=u+du; endfor; !* !***Constant V-curves. !* dv:=nv/(nc_v-1); v:=0; for i:=1 to nc_v do cur_iso(#2,ytid,"V",v,0,nu); v:=v+dv; endfor; ENDMODULE !********************************************