commit 7ad023eecca150cdbe7d6d4fceaaf67212f0ad45 Author: GunterMueller Date: Mon Sep 18 21:21:22 2017 -0400 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..0aee02b --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Geometry_and_Algorithms_for_CAD diff --git a/cdg-skript-1998.pdf b/cdg-skript-1998.pdf new file mode 100644 index 0000000..5a747be Binary files /dev/null and b/cdg-skript-1998.pdf differ diff --git a/cdg0gv-2010/beispiele/Makefile b/cdg0gv-2010/beispiele/Makefile new file mode 100644 index 0000000..ab3f3fb --- /dev/null +++ b/cdg0gv-2010/beispiele/Makefile @@ -0,0 +1,27 @@ +#PC= ppc386 +PC= ppcx64 + +CDGDIR= .. +INCLDIR= $(CDGDIR)/include +UNITDIR= $(CDGDIR)/units +TOOLDIR= $(CDGDIR)/tools + +PFLAGS= -So -Fu../units -I../include + +%: %.p + $(PC) $(PFLAGS) $< + +units: + (cd $(UNITDIR) && make units) + (cd $(TOOLDIR) && make tools) + +clean: + rm -f *~ *.o + +cleanall: + rm -f *~ *.o n_eck + (cd $(TOOLDIR) && make clean) + (cd $(UNITDIR) && make clean) + + + diff --git a/cdg0gv-2010/beispiele/README.fpc b/cdg0gv-2010/beispiele/README.fpc new file mode 100644 index 0000000..e5c96d7 --- /dev/null +++ b/cdg0gv-2010/beispiele/README.fpc @@ -0,0 +1,16 @@ +Installationschritte: + +1. "make" ausfuehren + erzeugt + a) die notwendigen units in Dir UNITS und + b) pldv in TOOLS + +2. Compilieren des Programms n_eck.p: "make n_eck" + Ausfuehren von n_eck: "n_eck" + +3. "make clean" loescht .o Dateien und n_eck und tori_h +4. "make cleanall" loescht + a) ALLE .o-Dateien und + b) .o- und .ppu-Dateien in UNITS + c) pldv in TOOLS + diff --git a/cdg0gv-2010/beispiele/bezkur b/cdg0gv-2010/beispiele/bezkur new file mode 100755 index 0000000..e1b2068 Binary files /dev/null and b/cdg0gv-2010/beispiele/bezkur differ diff --git a/cdg0gv-2010/beispiele/bezkur.o b/cdg0gv-2010/beispiele/bezkur.o new file mode 100644 index 0000000..d71556b Binary files /dev/null and b/cdg0gv-2010/beispiele/bezkur.o differ diff --git a/cdg0gv-2010/beispiele/bezkur.p b/cdg0gv-2010/beispiele/bezkur.p new file mode 100644 index 0000000..30f26c0 --- /dev/null +++ b/cdg0gv-2010/beispiele/bezkur.p @@ -0,0 +1,139 @@ +program bezkur; + uses geograph; + const n_bez=20; + type bez_array = array[0..n_bez] of real; + bezpt_array = array[0..n_bez] of vt2d; + var p : vts2d; bx,by,bxnew,bynew : bez_array; + dt,t : real; bezpts: bezpt_array; curvept: vt2d; + i,j,degree,ipld,np,ivorn,degree1,nelev : integer; +{******} + +function bezier_comp(degree: integer; var coeff: bez_array; t: real) : real; +{Berechnet eine Komponente einer Bezier-Kurve.} +{aus FARIN: Curves and surfaces...} + var i,n_choose_i : integer; fact,t1,aux : real; + begin + t1:= 1-t; fact:=1; n_choose_i:= 1; + aux:= coeff[0]*t1; + for i:= 1 to degree-1 do + begin + fact:= fact*t; + n_choose_i:= n_choose_i*(degree-i+1) div i; + aux:= (aux + fact*n_choose_i*coeff[i])*t1; + end; + aux:= aux + fact*t*coeff[degree]; + bezier_comp:= aux; + end; {bezier_comp} +{*************} + +function bezier_comp_decas(degree: integer; var coeff: bez_array; t: real) : real; +{Berechnet eine Komponente einer Bezier-Kurve mit DECASTELJAU_Alg..} +{aus FARIN: Curves and Surfaces, S. 33,34} + var i,r : integer; t1 : real; coeffa: bez_array; + begin + t1:= 1-t; + coeffa:= coeff; + for r:= 1 to degree do + for i:= 0 to degree-r do coeffa[i]:= t1*coeffa[i] + t*coeffa[i+1]; + bezier_comp_decas:= coeffa[0]; + end; {bezier_comp_decas} +{*************} + +procedure degree_elev_comp(degree: integer; var coeff: bez_array; + var coeffnew: bez_array); +{Berechnet die Koeffizienten f"ur eine Graderh"ohung.} +var i,degree1: integer; +begin + degree1:= degree+1; + coeffnew[0]:= coeff[0]; coeffnew[degree1]:= coeff[degree]; + for i:= 1 to degree do + coeffnew[i]:= (i*coeff[i-1] + (degree1-i)*coeff[i])/degree1; +end; { degree_elev_comp } +{************} + +procedure beziercurvept2d_decas(degree: integer; var bezpts: bezpt_array; t: real; + var curvept: vt2d); +{Berechnet und zeichnet einen Punkt einer Bezier-Kurve mit DECASTELJAU_Alg..} +{aus FARIN: Curves and Surfaces, S. 33,34} + var i,r : integer; t1 : real; bezptsa: bezpt_array; + begin + t1:= 1-t; + bezptsa:= bezpts; + for r:= 1 to degree do + for i:= 0 to degree-r do + begin + lcomb2vt2d(t1,bezptsa[i],t,bezptsa[i+1], bezptsa[i]); + point2d(bezptsa[i],0); + if (i>0) and (r0 then t:= -fi/cc else begin t:= 0; pointc2d(xi,yi,0); end; + xi1:= xi + t*gxi; yi1:= yi + t*gyi; + end; +{***} +procedure curve_point(p0 : vt2d; var pc : vt2d); +{Sucht einen Punkt der Kurve entlang des steilsten Weges} + var xi,yi,xi1,yi1,delta : real; + begin + xi:= p0.x; yi:= p0.y; + repeat {pointc2d(xi,yi,10);} + newton_step(xi,yi,xi1,yi1); + delta:= abs(xi-xi1) + abs(yi-yi1); + xi:= xi1; yi:= yi1; + until delta < curvept_delta; + put2d(xi1,yi1, pc); + end; { curve_point } +{*********} + begin {implicitcurve} {Mit while-Schleife, n2 ist "var"} + curve_point(startpt, p[0]); curve_point(endpt, curve_endpt); + stepl:= tangent_stepl; delta:= stepl; + tv:= start_tangentvt; fac:= stepl/length2d(tv); + lcomb2vt2d(1,p[0], fac,tv, ps); curve_point(ps,p[1]); + i:=1; test:= 0; + while (delta>0.7*stepl) and (i0 then + begin + fac:= stepl/cc; + test:= scalarp2d(tv,dv); if test<0 then fac:= -fac; + lcomb2vt2d(1,p[i], fac,tv, ps); + end + else lcomb2vt2d(2,p[i],1,p[i-1], ps); + i:= i+1; + curve_point(ps,p[i]); + delta:= distance2d(p[i],curve_endpt); + end; { while } + if i0) , c (0.5 ... 2) ?'); readln(a,c); +{ writeln('Anfangspunkt (x0,y0) ? (nicht (0,0) !)'); readln(x0,y0);} + x0:= 1; y0:= 1; + put2d(x0,y0, p0); scalefac:= 30; +{Zeichenflaeche : } + draw_area(180,140,90,65,scalefac); + put2d(-2,0, p1); put2d(2,0, p2); arrow2d(p1,p2,2); + put2d(0,-1, p1); put2d(0,1, p2); arrow2d(p1,p2,2); + + put2d(x0,y0,startpt); new_color(red); point2d(startpt,0); new_color(default); + endpt:= startpt; put2d(0,1,start_tangentvt); + tangent_stepl:= 0.05; curvept_delta:= eps6; n2max:= 300; + f:= fcass; gradf:= gradfcass; + implicit_curvepts(startpt,endpt,start_tangentvt, + tangent_stepl,curvept_delta, + n2max,f,gradf,n2,p); +writeln('Anzahl der Punkte: ',n2); + curve2d(p,0,n2,0); + if c>a then + begin + for i:= 0 to n2 do p[i].x:= -p[i].x; curve2d(p,0,n2,0); + end; + draw_end; writeln; + writeln(' Noch eine Zeichnung ? (nein: 0) '); read(inz); + until inz=0; + graph_off; + end. + + + + + + + + + + + + + + + diff --git a/cdg0gv-2010/beispiele/flaech_h.p b/cdg0gv-2010/beispiele/flaech_h.p new file mode 100644 index 0000000..bf09207 --- /dev/null +++ b/cdg0gv-2010/beispiele/flaech_h.p @@ -0,0 +1,153 @@ +{********************************************************************} +{*** Projektion einer param. Flaeche mit UP cp_lines_before_convex_faces ***} +{********************************************************************} +program flaech_h; +uses geograph,hiddenl; +(* {const type und var in unit hiddenl:} +const {Achtung: es muss array_size>=nfmax sein !!!} + nfmax= 10000; nemax=20000; nsegmax=10; npfmax=10; + +type vts2d_pol = array[0..npfmax] of vt2d; + vts3d_pol = array[0..npfmax] of vt3d; + r_array_seg = array[0..nsegmax] of real; + i_array_seg = array[0..nsegmax] of integer; + box3d_dat = record + xmin,xmax,ymin,ymax,zmin,zmax : real; + end; + face_dat = record + npf,nef : integer; + fp,fe : array[1..npfmax] of integer; + vis : boolean; + box : box3d_dat; + discentre,d : real; + nv : vt3d; + end; + edge_dat = record + vis : boolean; + ep1,ep2,color,linew : integer; + end; + +var ne,nf,np: integer; {Anzahl der Kanten, Facetten,Punkte} + p : vts3d; {Punkte des Polyeders} + face : array[1..nfmax] of face_dat; + edge : array[1..nemax] of edge_dat; + pdist: r_array; {pdist[i]: Abstand d. i-ten Punktes von d. Bildeb.} + error,oriented_faces,is_permitted,newstyles: boolean; +*) + + var u,v,du,dv,u1,u2,v1,v2,r1 : real; + n1,n2,i,k,ik,iachs,inz,ianf,iplot,nf1,ne0 : integer; + ps1,ps2 : vt3d; {fuer Schnittkanten der Flaechen} + inters : boolean; +{****************} + +begin {Hauptprogramm} + writeln('PLD-Datei ? (ja: 1)'); readln(iplot); + graph_on(iplot); + repeat + writeln('*** Projektion parametrisierter Flaechen ***'); writeln; + writeln('*** hier: "Affensattel" und Zylinder ***'); + ne0:= 0; +{--------------------------------} +{ Affensattel: Typ ist "quadrangle"} + n1:= 30; n2:= 30; {Anzahl der Unterteilungen im Parameterbereich}; + u1:= -0.9; u2:= 0.9; {Parametergrenzen} + v1:= -0.9; v2:= 0.9; + du:= (u2-u1)/(n1-1); dv:= (v2-v1)/(n2-1); + v:= v1; + for k:= 1 to n2 do + begin + u:= u1; + for i:= 1 to n1 do + begin + ik:=i + (k-1)*n1; + put3d(u,v,u*u*u-3*u*v*v, p[ik]); {Parameterdarstellung} + u:= u+du; + end; + v:= v+dv; + end; + np:= n1*n2; +{ aux_quadrangle_triang(n1,n2,true);} + aux_quadrangle(n1,n2,0,0,0); + writeln(' np:',np); writeln(' nf:',nf); writeln(' ne:',ne); + nf1:= nf; + for i:= ne0+1 to ne do + with edge[i] do begin color:=cyan; linew:=1; end; + ne0:= ne; +{--------------------------------} +{Zylinder 1: x**2 + z**2 -r1**2=0, Typ ist "cylinder"} + r1:= 0.6; + n1:= 50; n2:= 10; + v1:= -1.5; v2:= 1; + u1:= 0; u2:= pi2; + du:= (u2-u1)/n1; dv:= (v2-v1)/(n2-1); + v:= v1; + for k:= 1 to n2 do + begin + u:= u1; + for i:= 1 to n1 do + begin + ik:=i + (k-1)*n1; + put3d(r1*cos(u),r1*sin(u),v, p[np+ik]); + u:= u+du; + end; + v:= v+dv; + end; + aux_cylinder(n1,n2,np,ne,nf); + for i:= ne0+1 to ne do + with edge[i] do begin color:=blue; linew:=1; end; + ne0:= ne; +{---------------------------------------------} + +{Durchdringung der beiden Flaechen:} + boxes_of_faces; + for i:= 1 to nf1 do { 1.Flaechenschleife } + begin + for k:= nf1+1 to nf do { 2.Flaechenschleife } + begin + is_face_face(i,k, ps1,ps2,inters); + if inters then + begin + p[np+1]:= ps1; p[np+2]:= ps2; + with edge[ne+1] do + begin ep1:= np+1; ep2:= np+2; vis:= true; end; + np:= np+2; ne:= ne+1; + with face[i] do begin fe[nef+1]:= ne; nef:= nef+1; end; + with face[k] do begin fe[nef+1]:= ne; nef:= nef+1; end; + end; { if } + end; { for k } + end; { for i } + for i:= ne0+1 to ne do + with edge[i] do begin color:=red; linew:=1; end; + ne0:= ne; +{---------------------------------------------} + + repeat + writeln; + init_centralparallel_projection(2); + writeln(' Koordinaten-Achsen ? (Ja = 1)'); + readln(iachs); +{ Zeichnen : } + draw_area(200,200,100,100,50); + if iachs=1 then begin cp_axes(1.8); point2d(null2d,0); end; + + oriented_faces:= false; + is_permitted:= true; + newstyles:= true; + cp_lines_before_convex_faces(oriented_faces,is_permitted,newstyles); + + draw_end ; writeln ; + writeln(' Noch eine Projektion ? ( Ja = 1 )'); + readln(inz); + until inz=0; + + writeln('Noch einmal mit ANDEREN n1, n2 ? (ja: 1)'); + readln(ianf); + until ianf=0; + graph_off; + end. + + + + + diff --git a/cdg0gv-2010/beispiele/flaech_h_off.p b/cdg0gv-2010/beispiele/flaech_h_off.p new file mode 100644 index 0000000..4f6f8c7 --- /dev/null +++ b/cdg0gv-2010/beispiele/flaech_h_off.p @@ -0,0 +1,200 @@ +{********************************************************************} +{*** Projektion einer param. Flaeche mit UP cp_lines_before_convex_faces ***} +{********************************************************************} +program flaech_h; +uses geograph,hiddenl; +(* {const type und var in unit hiddenl:} +const {Achtung: es muss array_size>=nfmax sein !!!} + nfmax= 10000; nemax=20000; nsegmax=10; npfmax=10; + +type vts2d_pol = array[0..npfmax] of vt2d; + vts3d_pol = array[0..npfmax] of vt3d; + r_array_seg = array[0..nsegmax] of real; + i_array_seg = array[0..nsegmax] of integer; + box3d_dat = record + xmin,xmax,ymin,ymax,zmin,zmax : real; + end; + face_dat = record + npf,nef : integer; + fp,fe : array[1..npfmax] of integer; + vis : boolean; + box : box3d_dat; + discentre,d : real; + nv : vt3d; + end; + edge_dat = record + vis : boolean; + ep1,ep2,color,linew : integer; + end; + +var ne,nf,np: integer; {Anzahl der Kanten, Facetten,Punkte} + p : vts3d; {Punkte des Polyeders} + face : array[1..nfmax] of face_dat; + edge : array[1..nemax] of edge_dat; + pdist: r_array; {pdist[i]: Abstand d. i-ten Punktes von d. Bildeb.} + error,oriented_faces,is_permitted,newstyles: boolean; +*) + + var u,v,du,dv,u1,u2,v1,v2,r1 : real; + n1,n2,i,k,ik,iachs,inz,ianf,iplot,nf1,ne0 : integer; + ps1,ps2 : vt3d; {fuer Schnittkanten der Flaechen} + inters : boolean; +{****************} + +{********************************************************************} +{**** Hilfsprogramme zur Erzeugung von OFF-Dateien fuer GEOMVIEW ***} +{********************************************************************} + +{*****} +var offdatei : text; +{*****} + +procedure open_offdatei; +{ fuer OFF-Datei } + var datei : string; + begin + writeln('Name der OFF-Datei ? (... .off)'); + readln(datei); + assign(offdatei,datei); + rewrite(offdatei); + end; { open_offdatei } +{*************} + +procedure close_offdatei; + begin + Close(offdatei); + end; +{************} + +procedure write_nangles_to_offfile; +var i,k : integer; +begin + open_offdatei; + writeln(offdatei, 'OFF'); + writeln(offdatei,np,' ',nf,' ',0); + for i:= 1 to np do with p[i] do + writeln(offdatei,' ',x:3:5,' ',y:3:5,' ',z:3:5); + for i:= 1 to nf do + with face[i] do + begin + write(offdatei,npf,' '); + for k:= 1 to npf do write(offdatei,fp[k]-1,' '); + writeln(offdatei,' '); + end; + close_offdatei; +end; { write_nangles_to_offdatei } +{*********************************************************************************} + +begin {Hauptprogramm} + writeln('PLD-Datei ? (ja: 1)'); readln(iplot); + graph_on(iplot); + repeat + writeln('*** Projektion parametrisierter Flaechen ***'); writeln; + writeln('*** hier: "Affensattel" und Zylinder ***'); + ne0:= 0; +{--------------------------------} +{ Affensattel: Typ ist "quadrangle"} + n1:= 30; n2:= 30; {Anzahl der Unterteilungen im Parameterbereich}; + u1:= -0.9; u2:= 0.9; {Parametergrenzen} + v1:= -0.9; v2:= 0.9; + du:= (u2-u1)/(n1-1); dv:= (v2-v1)/(n2-1); + v:= v1; + for k:= 1 to n2 do + begin + u:= u1; + for i:= 1 to n1 do + begin + ik:=i + (k-1)*n1; + put3d(u,v,u*u*u-3*u*v*v, p[ik]); {Parameterdarstellung} + u:= u+du; + end; + v:= v+dv; + end; + np:= n1*n2; +{ aux_quadrangle_triang(n1,n2,true);} + aux_quadrangle(n1,n2,0,0,0); + writeln(' np:',np); writeln(' nf:',nf); writeln(' ne:',ne); + nf1:= nf; + for i:= ne0+1 to ne do + with edge[i] do begin color:=cyan; linew:=1; end; + ne0:= ne; +{--------------------------------} +{Zylinder 1: x**2 + z**2 -r1**2=0, Typ ist "cylinder"} + r1:= 0.6; + n1:= 50; n2:= 10; + v1:= -1.5; v2:= 1; + u1:= 0; u2:= pi2; + du:= (u2-u1)/n1; dv:= (v2-v1)/(n2-1); + v:= v1; + for k:= 1 to n2 do + begin + u:= u1; + for i:= 1 to n1 do + begin + ik:=i + (k-1)*n1; + put3d(r1*cos(u),r1*sin(u),v, p[np+ik]); + u:= u+du; + end; + v:= v+dv; + end; + aux_cylinder(n1,n2,np,ne,nf); + for i:= ne0+1 to ne do + with edge[i] do begin color:=blue; linew:=1; end; + ne0:= ne; +{---------------------------------------------} + +{Durchdringung der beiden Flaechen:} + boxes_of_faces; + for i:= 1 to nf1 do { 1.Flaechenschleife } + begin + for k:= nf1+1 to nf do { 2.Flaechenschleife } + begin + is_face_face(i,k, ps1,ps2,inters); + if inters then + begin + p[np+1]:= ps1; p[np+2]:= ps2; + with edge[ne+1] do + begin ep1:= np+1; ep2:= np+2; vis:= true; end; + np:= np+2; ne:= ne+1; + with face[i] do begin fe[nef+1]:= ne; nef:= nef+1; end; + with face[k] do begin fe[nef+1]:= ne; nef:= nef+1; end; + end; { if } + end; { for k } + end; { for i } + for i:= ne0+1 to ne do + with edge[i] do begin color:=red; linew:=1; end; + ne0:= ne; +{---------------------------------------------} + + repeat + writeln; + init_centralparallel_projection(2); + writeln(' Koordinaten-Achsen ? (Ja = 1)'); + readln(iachs); +{ Zeichnen : } + draw_area(200,200,100,100,50); + if iachs=1 then begin cp_axes(1.8); point2d(null2d,0); end; + + oriented_faces:= false; + is_permitted:= true; + newstyles:= true; + cp_lines_before_convex_faces(oriented_faces,is_permitted,newstyles); + + draw_end ; writeln ; + writeln(' Noch eine Projektion ? ( Ja = 1 )'); + readln(inz); + until inz=0; + +{erzeugt off-file fuer GEOMVIEW:} + write_nangles_to_offfile; + + writeln('Noch einmal mit ANDEREN n1, n2 ? (ja: 1)'); + readln(ianf); + until ianf=0; + graph_off; + end. + + + + + diff --git a/cdg0gv-2010/beispiele/geodummy.eps b/cdg0gv-2010/beispiele/geodummy.eps new file mode 100644 index 0000000..28080ff --- /dev/null +++ b/cdg0gv-2010/beispiele/geodummy.eps @@ -0,0 +1,2344 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Creator: pldv +%%BoundingBox: -226 -255 340 312 +%%EndComments +gsave +2.8346 2.8346 scale +0.15 setlinewidth +1 setlinejoin + + +[] 0 setdash + -23.29 -23.71 moveto + -23.03 -27.71 lineto +stroke + -23.03 -27.71 moveto + -22.27 -30.78 lineto +stroke + -22.27 -30.78 moveto + -21.08 -32.63 lineto +stroke + -21.08 -32.63 moveto + -19.58 -33.06 lineto +stroke + -16.26 -3.42 moveto + -17.92 -4.43 lineto +stroke + -17.92 -4.43 moveto + -19.58 -6.80 lineto +stroke + -19.58 -6.80 moveto + -21.08 -10.28 lineto +stroke + -21.08 -10.28 moveto + -22.27 -14.55 lineto +stroke + -22.27 -14.55 moveto + -23.03 -19.18 lineto +stroke + -23.03 -19.18 moveto + -23.29 -23.71 lineto +stroke + -3.40 -25.36 moveto + -3.36 -29.34 lineto +stroke + -3.36 -29.34 moveto + -3.25 -32.36 lineto +stroke + -3.25 -32.36 moveto + -3.08 -34.12 lineto +stroke + -3.08 -34.12 moveto + -2.86 -34.45 lineto +stroke + -2.37 -4.57 moveto + -2.62 -5.70 lineto +stroke + -2.62 -5.70 moveto + -2.86 -8.19 lineto +stroke + -2.86 -8.19 moveto + -3.08 -11.78 lineto +stroke + -3.08 -11.78 moveto + -3.25 -16.13 lineto +stroke + -3.25 -16.13 moveto + -3.36 -20.81 lineto +stroke + -3.36 -20.81 moveto + -3.40 -25.36 lineto +stroke + 16.82 -24.53 moveto + 16.63 -28.52 lineto +stroke + 16.63 -28.52 moveto + 16.08 -31.57 lineto +stroke + 16.08 -31.57 moveto + 15.22 -33.37 lineto +stroke + 15.22 -33.37 moveto + 14.14 -33.75 lineto +stroke + 11.74 -3.99 moveto + 12.94 -5.06 lineto +stroke + 12.94 -5.06 moveto + 14.14 -7.49 lineto +stroke + 14.14 -7.49 moveto + 15.22 -11.03 lineto +stroke + 15.22 -11.03 moveto + 16.08 -15.34 lineto +stroke + 16.08 -15.34 moveto + 16.63 -19.99 lineto +stroke + 16.63 -19.99 moveto + 16.82 -24.53 lineto +stroke + 35.40 -21.30 moveto + 35.00 -25.33 lineto +stroke + 35.00 -25.33 moveto + 33.84 -28.48 lineto +stroke + 33.84 -28.48 moveto + 32.03 -30.44 lineto +stroke + 32.03 -30.44 moveto + 29.76 -31.04 lineto +stroke + 24.71 -1.73 moveto + 27.23 -2.58 lineto +stroke + 27.23 -2.58 moveto + 29.76 -4.77 lineto +stroke + 29.76 -4.77 moveto + 32.03 -8.10 lineto +stroke + 32.03 -8.10 moveto + 33.84 -12.25 lineto +stroke + 33.84 -12.25 moveto + 35.00 -16.79 lineto +stroke + 35.00 -16.79 moveto + 35.40 -21.30 lineto +stroke + 50.51 -15.98 moveto + 49.94 -20.07 lineto +stroke + 49.94 -20.07 moveto + 48.29 -23.39 lineto +stroke + 48.29 -23.39 moveto + 45.71 -25.63 lineto +stroke + 32.01 1.04 moveto + 35.26 1.98 lineto +stroke + 35.26 1.98 moveto + 38.86 1.51 lineto +stroke + 38.86 1.51 moveto + 42.46 -0.30 lineto +stroke + 42.46 -0.30 moveto + 45.71 -3.29 lineto +stroke + 45.71 -3.29 moveto + 48.29 -7.16 lineto +stroke + 48.29 -7.16 moveto + 49.94 -11.54 lineto +stroke + 49.94 -11.54 moveto + 50.51 -15.98 lineto +stroke + 60.68 -9.10 moveto + 60.00 -13.27 lineto +stroke + 60.00 -13.27 moveto + 58.01 -16.82 lineto +stroke + 58.01 -16.82 moveto + 54.91 -19.41 lineto +stroke + 38.45 5.40 moveto + 42.35 6.78 lineto +stroke + 42.35 6.78 moveto + 46.68 6.81 lineto +stroke + 46.68 6.81 moveto + 51.01 5.48 lineto +stroke + 51.01 5.48 moveto + 54.91 2.93 lineto +stroke + 54.91 2.93 moveto + 58.01 -0.58 lineto +stroke + 58.01 -0.58 moveto + 60.00 -4.73 lineto +stroke + 60.00 -4.73 moveto + 60.68 -9.10 lineto +stroke + 64.91 -1.33 moveto + 64.18 -5.58 lineto +stroke + 35.44 2.10 moveto + 35.44 2.10 lineto +stroke + 35.69 3.54 moveto + 37.81 7.34 lineto +stroke + 37.81 7.34 moveto + 41.13 10.33 lineto +stroke + 41.13 10.33 moveto + 45.30 12.20 lineto +stroke + 45.30 12.20 moveto + 49.93 12.79 lineto +stroke + 49.93 12.79 moveto + 54.56 12.01 lineto +stroke + 54.56 12.01 moveto + 58.74 9.97 lineto +stroke + 58.74 9.97 moveto + 62.05 6.85 lineto +stroke + 62.05 6.85 moveto + 64.18 2.95 lineto +stroke + 64.18 2.95 moveto + 64.91 -1.33 lineto +stroke + 34.00 2.39 moveto + 33.81 3.54 lineto +stroke + 33.81 3.54 moveto + 34.52 7.88 lineto +stroke + 34.52 7.88 moveto + 36.57 11.95 lineto +stroke + 36.57 11.95 moveto + 39.78 15.34 lineto +stroke + 39.78 15.34 moveto + 43.82 17.72 lineto +stroke + 43.82 17.72 moveto + 48.30 18.86 lineto +stroke + 48.30 18.86 moveto + 52.77 18.66 lineto +stroke + 52.77 18.66 moveto + 56.81 17.12 lineto +stroke + 56.81 17.12 moveto + 60.02 14.40 lineto +stroke + 60.02 14.40 moveto + 62.08 10.77 lineto +stroke + 31.40 0.62 moveto + 31.40 0.62 lineto +stroke + 31.31 0.80 moveto + 29.97 3.34 lineto +stroke + 29.97 3.34 moveto + 29.35 7.45 lineto +stroke + 29.35 7.45 moveto + 29.97 11.87 lineto +stroke + 29.97 11.87 moveto + 31.76 16.17 lineto +stroke + 31.76 16.17 moveto + 34.54 19.93 lineto +stroke + 34.54 19.93 moveto + 38.05 22.79 lineto +stroke + 38.05 22.79 moveto + 41.93 24.45 lineto +stroke + 41.93 24.45 moveto + 45.82 24.76 lineto +stroke + 45.82 24.76 moveto + 49.33 23.69 lineto +stroke + 49.33 23.69 moveto + 52.11 21.34 lineto +stroke + 25.92 1.33 moveto + 23.83 3.38 lineto +stroke + 23.83 3.38 moveto + 22.49 6.58 lineto +stroke + 22.49 6.58 moveto + 22.03 10.63 lineto +stroke + 22.03 10.63 moveto + 22.49 15.12 lineto +stroke + 22.49 15.12 moveto + 23.83 19.61 lineto +stroke + 23.83 19.61 moveto + 25.92 23.68 lineto +stroke + 25.92 23.68 moveto + 28.55 26.91 lineto +stroke + 28.55 26.91 moveto + 31.47 28.99 lineto +stroke + 31.47 28.99 moveto + 34.38 29.72 lineto +stroke + 34.38 29.72 moveto + 37.01 29.03 lineto +stroke + 16.26 3.42 moveto + 15.21 3.72 lineto +stroke + 12.55 12.83 moveto + 12.55 12.83 lineto +stroke + 14.86 26.43 moveto + 14.86 26.43 lineto +stroke + 2.67 33.57 moveto + 2.67 33.57 lineto +stroke + -11.79 30.35 moveto + -12.94 32.68 lineto +stroke + -12.94 32.68 moveto + -14.14 33.75 lineto +stroke + -22.43 2.32 moveto + -22.43 2.32 lineto +stroke + -22.43 2.32 moveto + -20.62 4.29 lineto +stroke + -20.62 4.29 moveto + -19.46 7.44 lineto +stroke + -19.46 7.44 moveto + -19.06 11.47 lineto +stroke + -19.06 11.47 moveto + -19.46 15.98 lineto +stroke + -19.46 15.98 moveto + -20.62 20.52 lineto +stroke + -20.62 20.52 moveto + -22.43 24.67 lineto +stroke + -22.43 24.67 moveto + -24.71 28.00 lineto +stroke + -24.71 28.00 moveto + -27.23 30.19 lineto +stroke + -27.23 30.19 moveto + -29.76 31.04 lineto +stroke + -29.76 31.04 moveto + -32.03 30.44 lineto +stroke + -30.55 0.22 moveto + -30.55 0.22 lineto +stroke + -30.20 0.52 moveto + -29.43 1.19 lineto +stroke + -29.43 1.19 moveto + -27.77 4.52 lineto +stroke + -27.77 4.52 moveto + -27.20 8.61 lineto +stroke + -27.20 8.61 moveto + -27.77 13.05 lineto +stroke + -27.77 13.05 moveto + -29.43 17.43 lineto +stroke + -29.43 17.43 moveto + -32.01 21.30 lineto +stroke + -32.01 21.30 moveto + -35.26 24.29 lineto +stroke + -35.26 24.29 moveto + -38.86 26.10 lineto +stroke + -38.86 26.10 moveto + -42.46 26.57 lineto +stroke + -42.46 26.57 moveto + -45.71 25.63 lineto +stroke + -33.18 1.82 moveto + -32.68 4.90 lineto +stroke + -32.68 4.90 moveto + -33.36 9.27 lineto +stroke + -33.36 9.27 moveto + -35.35 13.42 lineto +stroke + -35.35 13.42 moveto + -38.45 16.94 lineto +stroke + -38.45 16.94 moveto + -42.35 19.48 lineto +stroke + -42.35 19.48 moveto + -46.68 20.81 lineto +stroke + -46.68 20.81 moveto + -51.01 20.78 lineto +stroke + -51.01 20.78 moveto + -54.91 19.41 lineto +stroke + -54.91 19.41 moveto + -58.01 16.82 lineto +stroke + -58.01 16.82 moveto + -60.00 13.27 lineto +stroke + -64.91 1.33 moveto + -64.18 -2.95 lineto +stroke + -35.69 5.00 moveto + -37.81 8.89 lineto +stroke + -37.81 8.89 moveto + -41.13 12.01 lineto +stroke + -41.13 12.01 moveto + -45.30 14.06 lineto +stroke + -45.30 14.06 moveto + -49.93 14.83 lineto +stroke + -49.93 14.83 moveto + -54.56 14.25 lineto +stroke + -54.56 14.25 moveto + -58.74 12.37 lineto +stroke + -58.74 12.37 moveto + -62.05 9.39 lineto +stroke + -62.05 9.39 moveto + -64.18 5.58 lineto +stroke + -64.18 5.58 moveto + -64.91 1.33 lineto +stroke + -62.79 -6.57 moveto + -62.08 -10.77 lineto +stroke + -62.08 -10.77 moveto + -60.02 -14.40 lineto +stroke + -35.49 2.37 moveto + -35.49 2.37 lineto +stroke + -36.57 4.29 moveto + -36.57 4.29 lineto +stroke + -36.57 4.29 moveto + -39.78 7.01 lineto +stroke + -39.78 7.01 moveto + -43.82 8.54 lineto +stroke + -43.82 8.54 moveto + -48.30 8.75 lineto +stroke + -48.30 8.75 moveto + -52.77 7.61 lineto +stroke + -52.77 7.61 moveto + -56.81 5.22 lineto +stroke + -56.81 5.22 moveto + -60.02 1.83 lineto +stroke + -60.02 1.83 moveto + -62.08 -2.23 lineto +stroke + -62.08 -2.23 moveto + -62.79 -6.57 lineto +stroke + -54.51 -13.83 moveto + -53.90 -17.94 lineto +stroke + -53.90 -17.94 moveto + -52.11 -21.34 lineto +stroke + -52.11 -21.34 moveto + -49.33 -23.69 lineto +stroke + -34.54 2.41 moveto + -38.05 3.48 lineto +stroke + -38.05 3.48 moveto + -41.93 3.17 lineto +stroke + -41.93 3.17 moveto + -45.82 1.50 lineto +stroke + -45.82 1.50 moveto + -49.33 -1.35 lineto +stroke + -49.33 -1.35 moveto + -52.11 -5.11 lineto +stroke + -52.11 -5.11 moveto + -53.90 -9.41 lineto +stroke + -53.90 -9.41 moveto + -54.51 -13.83 lineto +stroke + -40.91 -19.74 moveto + -40.44 -23.78 lineto +stroke + -40.44 -23.78 moveto + -39.10 -26.98 lineto +stroke + -39.10 -26.98 moveto + -37.01 -29.03 lineto +stroke + -37.01 -29.03 moveto + -34.38 -29.72 lineto +stroke + -28.55 -0.64 moveto + -31.47 -1.38 lineto +stroke + -31.47 -1.38 moveto + -34.38 -3.46 lineto +stroke + -34.38 -3.46 moveto + -37.01 -6.69 lineto +stroke + -37.01 -6.69 moveto + -39.10 -10.75 lineto +stroke + -39.10 -10.75 moveto + -40.44 -15.25 lineto +stroke + -40.44 -15.25 moveto + -40.91 -19.74 lineto +stroke + -23.29 -23.71 moveto + -3.40 -25.36 lineto +stroke + -3.40 -25.36 moveto + 16.82 -24.53 lineto +stroke + 16.82 -24.53 moveto + 35.40 -21.30 lineto +stroke + 35.40 -21.30 moveto + 50.51 -15.98 lineto +stroke + 50.51 -15.98 moveto + 60.68 -9.10 lineto +stroke + 60.68 -9.10 moveto + 64.91 -1.33 lineto +stroke + -64.91 1.33 moveto + -62.79 -6.57 lineto +stroke + -62.79 -6.57 moveto + -54.51 -13.83 lineto +stroke + -54.51 -13.83 moveto + -40.91 -19.74 lineto +stroke + -40.91 -19.74 moveto + -23.29 -23.71 lineto +stroke + -23.03 -27.71 moveto + -3.36 -29.34 lineto +stroke + -3.36 -29.34 moveto + 16.63 -28.52 lineto +stroke + 16.63 -28.52 moveto + 35.00 -25.33 lineto +stroke + 35.00 -25.33 moveto + 49.94 -20.07 lineto +stroke + 49.94 -20.07 moveto + 60.00 -13.27 lineto +stroke + 60.00 -13.27 moveto + 64.18 -5.58 lineto +stroke + -64.18 -2.95 moveto + -62.08 -10.77 lineto +stroke + -62.08 -10.77 moveto + -53.90 -17.94 lineto +stroke + -53.90 -17.94 moveto + -40.44 -23.78 lineto +stroke + -40.44 -23.78 moveto + -23.03 -27.71 lineto +stroke + -22.27 -30.78 moveto + -3.25 -32.36 lineto +stroke + -3.25 -32.36 moveto + 16.08 -31.57 lineto +stroke + 16.08 -31.57 moveto + 33.84 -28.48 lineto +stroke + 33.84 -28.48 moveto + 48.29 -23.39 lineto +stroke + 48.29 -23.39 moveto + 58.01 -16.82 lineto +stroke + -60.02 -14.40 moveto + -52.11 -21.34 lineto +stroke + -52.11 -21.34 moveto + -39.10 -26.98 lineto +stroke + -39.10 -26.98 moveto + -22.27 -30.78 lineto +stroke + -21.08 -32.63 moveto + -3.08 -34.12 lineto +stroke + -3.08 -34.12 moveto + 15.22 -33.37 lineto +stroke + 15.22 -33.37 moveto + 32.03 -30.44 lineto +stroke + 32.03 -30.44 moveto + 45.71 -25.63 lineto +stroke + 45.71 -25.63 moveto + 54.91 -19.41 lineto +stroke + -49.33 -23.69 moveto + -37.01 -29.03 lineto +stroke + -37.01 -29.03 moveto + -21.08 -32.63 lineto +stroke + -19.58 -33.06 moveto + -2.86 -34.45 lineto +stroke + -2.86 -34.45 moveto + 14.14 -33.75 lineto +stroke + 14.14 -33.75 moveto + 29.76 -31.04 lineto +stroke + -34.38 -29.72 moveto + -19.58 -33.06 lineto +stroke + 26.39 1.13 moveto + 16.26 3.42 lineto +stroke + 16.26 3.42 moveto + 15.20 3.50 lineto +stroke + 14.33 3.58 moveto + 14.33 3.58 lineto +stroke + -14.80 3.46 moveto + -23.53 1.94 lineto +stroke + 29.01 -0.01 moveto + 25.92 1.33 lineto +stroke + 25.92 1.33 moveto + 15.21 3.75 lineto +stroke + 12.11 4.07 moveto + 12.11 4.07 lineto +stroke + -8.92 4.44 moveto + -8.92 4.44 lineto +stroke + -14.79 3.65 moveto + -22.43 2.32 lineto +stroke + -22.43 2.32 moveto + -29.01 0.01 lineto +stroke + -29.59 -0.19 moveto + -29.59 -0.19 lineto +stroke + 30.47 0.50 moveto + 23.83 3.38 lineto +stroke + 23.83 3.38 moveto + 15.31 5.30 lineto +stroke + 8.81 6.09 moveto + 8.81 6.09 lineto +stroke + -0.06 6.57 moveto + -0.06 6.57 lineto +stroke + -8.81 6.22 moveto + -8.81 6.22 lineto +stroke + -14.69 5.32 moveto + -20.62 4.29 lineto +stroke + -20.62 4.29 moveto + -29.43 1.19 lineto +stroke + -29.43 1.19 moveto + -30.33 0.58 lineto +stroke + 32.33 1.26 moveto + 29.97 3.34 lineto +stroke + 29.97 3.34 moveto + 22.49 6.58 lineto +stroke + 22.49 6.58 moveto + 15.47 8.17 lineto +stroke + -11.89 8.76 moveto + -11.89 8.76 lineto +stroke + -14.52 8.30 moveto + -19.46 7.44 lineto +stroke + -19.46 7.44 moveto + -27.77 4.52 lineto +stroke + -27.77 4.52 moveto + -32.32 1.44 lineto +stroke + 34.32 1.65 moveto + 34.32 1.65 lineto +stroke + 34.30 1.70 moveto + 34.30 1.70 lineto +stroke + 34.10 2.46 moveto + 33.81 3.54 lineto +stroke + 33.81 3.54 moveto + 29.35 7.45 lineto +stroke + 29.35 7.45 moveto + 22.03 10.63 lineto +stroke + 22.03 10.63 moveto + 15.70 12.06 lineto +stroke + 12.61 12.75 moveto + 12.61 12.75 lineto +stroke + 11.69 12.84 moveto + 11.69 12.84 lineto +stroke + 9.23 13.04 moveto + 9.23 13.04 lineto +stroke + 0.22 13.59 moveto + 0.22 13.59 lineto +stroke + -14.28 12.30 moveto + -19.06 11.47 lineto +stroke + -19.06 11.47 moveto + -27.20 8.61 lineto +stroke + -27.20 8.61 moveto + -32.68 4.90 lineto +stroke + -32.68 4.90 moveto + -34.13 2.23 lineto +stroke + 35.68 3.53 moveto + 35.69 3.54 lineto +stroke + 35.69 3.54 moveto + 34.52 7.88 lineto +stroke + 34.52 7.88 moveto + 29.97 11.87 lineto +stroke + 29.97 11.87 moveto + 22.49 15.12 lineto +stroke + 22.49 15.12 moveto + 16.29 16.52 lineto +stroke + 13.33 17.18 moveto + 13.33 17.18 lineto +stroke + -14.00 16.93 moveto + -19.46 15.98 lineto +stroke + -19.46 15.98 moveto + -27.77 13.05 lineto +stroke + -27.77 13.05 moveto + -33.36 9.27 lineto +stroke + -33.36 9.27 moveto + -35.69 5.00 lineto +stroke + -35.69 5.00 moveto + -35.16 3.05 lineto +stroke + -35.13 2.92 moveto + -35.13 2.92 lineto +stroke + 35.77 3.59 moveto + 37.81 7.34 lineto +stroke + 37.81 7.34 moveto + 36.57 11.95 lineto +stroke + 36.57 11.95 moveto + 31.76 16.17 lineto +stroke + 31.76 16.17 moveto + 23.83 19.61 lineto +stroke + 23.83 19.61 moveto + 17.05 21.14 lineto +stroke + -7.05 22.52 moveto + -7.05 22.52 lineto +stroke + -13.20 21.82 moveto + -20.62 20.52 lineto +stroke + -20.62 20.52 moveto + -29.43 17.43 lineto +stroke + -29.43 17.43 moveto + -35.35 13.42 lineto +stroke + -35.35 13.42 moveto + -37.81 8.89 lineto +stroke + -37.81 8.89 moveto + -36.57 4.29 lineto +stroke + -36.57 4.29 moveto + -34.33 2.31 lineto +stroke + 23.53 -1.94 moveto + 32.01 1.04 lineto +stroke + 32.01 1.04 moveto + 38.45 5.40 lineto +stroke + 38.45 5.40 moveto + 41.13 10.33 lineto +stroke + 41.13 10.33 moveto + 39.78 15.34 lineto +stroke + 39.78 15.34 moveto + 34.54 19.93 lineto +stroke + 34.54 19.93 moveto + 25.92 23.68 lineto +stroke + 25.92 23.68 moveto + 17.77 25.51 lineto +stroke + -12.44 26.40 moveto + -22.43 24.67 lineto +stroke + -22.43 24.67 moveto + -32.01 21.30 lineto +stroke + -32.01 21.30 moveto + -38.45 16.94 lineto +stroke + -38.45 16.94 moveto + -41.13 12.01 lineto +stroke + -41.13 12.01 moveto + -39.78 7.01 lineto +stroke + -39.78 7.01 moveto + -34.54 2.41 lineto +stroke + -34.54 2.41 moveto + -26.39 -1.13 lineto +stroke + -16.26 -3.42 moveto + -2.37 -4.57 lineto +stroke + -2.37 -4.57 moveto + 11.74 -3.99 lineto +stroke + 11.74 -3.99 moveto + 24.71 -1.73 lineto +stroke + 24.71 -1.73 moveto + 35.26 1.98 lineto +stroke + 35.26 1.98 moveto + 42.35 6.78 lineto +stroke + 42.35 6.78 moveto + 45.30 12.20 lineto +stroke + 45.30 12.20 moveto + 43.82 17.72 lineto +stroke + 43.82 17.72 moveto + 38.05 22.79 lineto +stroke + 38.05 22.79 moveto + 28.55 26.91 lineto +stroke + 28.55 26.91 moveto + 18.57 29.16 lineto +stroke + 12.03 30.03 moveto + 12.03 30.03 lineto +stroke + -5.73 30.50 moveto + -5.73 30.50 lineto +stroke + -11.81 30.24 moveto + -24.71 28.00 lineto +stroke + -24.71 28.00 moveto + -35.26 24.29 lineto +stroke + -35.26 24.29 moveto + -42.35 19.48 lineto +stroke + -42.35 19.48 moveto + -45.30 14.06 lineto +stroke + -45.30 14.06 moveto + -43.82 8.54 lineto +stroke + -43.82 8.54 moveto + -38.05 3.48 lineto +stroke + -38.05 3.48 moveto + -28.55 -0.64 lineto +stroke + -28.55 -0.64 moveto + -16.26 -3.42 lineto +stroke + -17.92 -4.43 moveto + -2.62 -5.70 lineto +stroke + -2.62 -5.70 moveto + 12.94 -5.06 lineto +stroke + 12.94 -5.06 moveto + 27.23 -2.58 lineto +stroke + 27.23 -2.58 moveto + 38.86 1.51 lineto +stroke + 38.86 1.51 moveto + 46.68 6.81 lineto +stroke + 46.68 6.81 moveto + 49.93 12.79 lineto +stroke + 49.93 12.79 moveto + 48.30 18.86 lineto +stroke + 48.30 18.86 moveto + 41.93 24.45 lineto +stroke + 41.93 24.45 moveto + 31.47 28.99 lineto +stroke + 31.47 28.99 moveto + 19.29 31.74 lineto +stroke + 16.10 32.20 moveto + 16.10 32.20 lineto +stroke + 4.61 33.15 moveto + 4.61 33.15 lineto +stroke + -11.39 32.74 moveto + -12.94 32.68 lineto +stroke + -12.94 32.68 moveto + -27.23 30.19 lineto +stroke + -27.23 30.19 moveto + -38.86 26.10 lineto +stroke + -38.86 26.10 moveto + -46.68 20.81 lineto +stroke + -46.68 20.81 moveto + -49.93 14.83 lineto +stroke + -49.93 14.83 moveto + -48.30 8.75 lineto +stroke + -48.30 8.75 moveto + -41.93 3.17 lineto +stroke + -41.93 3.17 moveto + -31.47 -1.38 lineto +stroke + -31.47 -1.38 moveto + -17.92 -4.43 lineto +stroke + -19.58 -6.80 moveto + -2.86 -8.19 lineto +stroke + -2.86 -8.19 moveto + 14.14 -7.49 lineto +stroke + 14.14 -7.49 moveto + 29.76 -4.77 lineto +stroke + 29.76 -4.77 moveto + 42.46 -0.30 lineto +stroke + 42.46 -0.30 moveto + 51.01 5.48 lineto +stroke + 51.01 5.48 moveto + 54.56 12.01 lineto +stroke + 54.56 12.01 moveto + 52.77 18.66 lineto +stroke + 52.77 18.66 moveto + 45.82 24.76 lineto +stroke + 45.82 24.76 moveto + 34.38 29.72 lineto +stroke + 34.38 29.72 moveto + 19.66 33.04 lineto +stroke + -10.55 33.90 moveto + -10.55 33.90 lineto +stroke + -11.18 33.87 moveto + -14.14 33.75 lineto +stroke + -14.14 33.75 moveto + -29.76 31.04 lineto +stroke + -29.76 31.04 moveto + -42.46 26.57 lineto +stroke + -42.46 26.57 moveto + -51.01 20.78 lineto +stroke + -51.01 20.78 moveto + -54.56 14.25 lineto +stroke + -54.56 14.25 moveto + -52.77 7.61 lineto +stroke + -52.77 7.61 moveto + -45.82 1.50 lineto +stroke + -45.82 1.50 moveto + -34.38 -3.46 lineto +stroke + -34.38 -3.46 moveto + -19.58 -6.80 lineto +stroke + -21.08 -10.28 moveto + -3.08 -11.78 lineto +stroke + -3.08 -11.78 moveto + 15.22 -11.03 lineto +stroke + 15.22 -11.03 moveto + 32.03 -8.10 lineto +stroke + 32.03 -8.10 moveto + 45.71 -3.29 lineto +stroke + 45.71 -3.29 moveto + 54.91 2.93 lineto +stroke + 54.91 2.93 moveto + 58.74 9.97 lineto +stroke + 58.74 9.97 moveto + 56.81 17.12 lineto +stroke + 56.81 17.12 moveto + 49.33 23.69 lineto +stroke + 49.33 23.69 moveto + 37.01 29.03 lineto +stroke + -32.03 30.44 moveto + -45.71 25.63 lineto +stroke + -45.71 25.63 moveto + -54.91 19.41 lineto +stroke + -54.91 19.41 moveto + -58.74 12.37 lineto +stroke + -58.74 12.37 moveto + -56.81 5.22 lineto +stroke + -56.81 5.22 moveto + -49.33 -1.35 lineto +stroke + -49.33 -1.35 moveto + -37.01 -6.69 lineto +stroke + -37.01 -6.69 moveto + -21.08 -10.28 lineto +stroke + -22.27 -14.55 moveto + -3.25 -16.13 lineto +stroke + -3.25 -16.13 moveto + 16.08 -15.34 lineto +stroke + 16.08 -15.34 moveto + 33.84 -12.25 lineto +stroke + 33.84 -12.25 moveto + 48.29 -7.16 lineto +stroke + 48.29 -7.16 moveto + 58.01 -0.58 lineto +stroke + 58.01 -0.58 moveto + 62.05 6.85 lineto +stroke + 62.05 6.85 moveto + 60.02 14.40 lineto +stroke + 60.02 14.40 moveto + 52.11 21.34 lineto +stroke + -58.01 16.82 moveto + -62.05 9.39 lineto +stroke + -62.05 9.39 moveto + -60.02 1.83 lineto +stroke + -60.02 1.83 moveto + -52.11 -5.11 lineto +stroke + -52.11 -5.11 moveto + -39.10 -10.75 lineto +stroke + -39.10 -10.75 moveto + -22.27 -14.55 lineto +stroke + -23.03 -19.18 moveto + -3.36 -20.81 lineto +stroke + -3.36 -20.81 moveto + 16.63 -19.99 lineto +stroke + 16.63 -19.99 moveto + 35.00 -16.79 lineto +stroke + 35.00 -16.79 moveto + 49.94 -11.54 lineto +stroke + 49.94 -11.54 moveto + 60.00 -4.73 lineto +stroke + 60.00 -4.73 moveto + 64.18 2.95 lineto +stroke + 64.18 2.95 moveto + 62.08 10.77 lineto +stroke + -60.00 13.27 moveto + -64.18 5.58 lineto +stroke + -64.18 5.58 moveto + -62.08 -2.23 lineto +stroke + -62.08 -2.23 moveto + -53.90 -9.41 lineto +stroke + -53.90 -9.41 moveto + -40.44 -15.25 lineto +stroke + -40.44 -15.25 moveto + -23.03 -19.18 lineto +stroke + -2.61 -5.70 moveto + -2.61 -5.70 lineto +stroke + 5.58 -5.37 moveto + 5.58 -5.37 lineto +stroke + 10.68 -4.03 moveto + 11.66 -3.69 lineto +stroke + 11.66 -3.69 moveto + 14.00 -2.10 lineto +stroke + 14.00 -2.10 moveto + 14.98 -0.31 lineto +stroke + -14.98 0.31 moveto + -14.49 -1.52 lineto +stroke + -14.49 -1.52 moveto + -12.58 -3.19 lineto +stroke + -12.58 -3.19 moveto + -11.07 -3.85 lineto +stroke + -4.24 14.18 moveto + 0.34 13.57 lineto +stroke + 0.34 13.57 moveto + 4.97 13.12 lineto +stroke + 4.97 13.12 moveto + 9.20 12.87 lineto +stroke + 9.20 12.87 moveto + 12.62 12.83 lineto +stroke + 12.62 12.83 moveto + 14.88 13.01 lineto +stroke + 14.88 13.01 moveto + 15.78 13.41 lineto +stroke + -14.02 16.82 moveto + -13.46 16.26 lineto +stroke + -13.46 16.26 moveto + -11.49 15.59 lineto +stroke + -11.49 15.59 moveto + -8.31 14.87 lineto +stroke + -8.31 14.87 moveto + -4.24 14.18 lineto +stroke + -0.93 34.23 moveto + 3.61 33.40 lineto +stroke + 3.61 33.40 moveto + 8.13 32.29 lineto +stroke + 8.13 32.29 moveto + 12.20 31.01 lineto +stroke + 12.20 31.01 moveto + 15.40 29.68 lineto +stroke + 15.40 29.68 moveto + 17.43 28.44 lineto +stroke + 17.43 28.44 moveto + 18.08 27.40 lineto +stroke + -11.24 33.67 moveto + -10.46 34.40 lineto +stroke + -10.46 34.40 moveto + -8.33 34.76 lineto +stroke + -8.33 34.76 moveto + -5.04 34.69 lineto +stroke + -5.04 34.69 moveto + -0.93 34.23 lineto +stroke + 4.23 52.71 moveto + 8.71 51.67 lineto +stroke + 8.71 51.67 moveto + 13.06 49.95 lineto +stroke + 13.06 49.95 moveto + 16.86 47.73 lineto +stroke + 16.86 47.73 moveto + 19.73 45.21 lineto +stroke + 19.73 45.21 moveto + 21.39 42.65 lineto +stroke + 21.39 42.65 moveto + 21.68 40.30 lineto +stroke + -6.91 49.21 moveto + -5.80 51.13 lineto +stroke + -5.80 51.13 moveto + -3.40 52.42 lineto +stroke + -3.40 52.42 moveto + 0.05 52.97 lineto +stroke + 0.05 52.97 moveto + 4.23 52.71 lineto +stroke + 10.72 67.82 moveto + 15.13 66.61 lineto +stroke + 15.13 66.61 moveto + 19.27 64.40 lineto +stroke + 19.27 64.40 moveto + 22.73 61.40 lineto +stroke + 22.73 61.40 moveto + 25.19 57.91 lineto +stroke + 25.19 57.91 moveto + 26.39 54.28 lineto +stroke + 26.39 54.28 moveto + 26.21 50.84 lineto +stroke + -1.45 61.91 moveto + 0.08 64.80 lineto +stroke + 0.08 64.80 moveto + 2.81 66.87 lineto +stroke + 2.81 66.87 moveto + 6.47 67.91 lineto +stroke + 6.47 67.91 moveto + 10.72 67.82 lineto +stroke + 17.92 78.07 moveto + 22.25 76.75 lineto +stroke + 22.25 76.75 moveto + 26.15 74.20 lineto +stroke + 26.15 74.20 moveto + 29.25 70.68 lineto +stroke + 29.25 70.68 moveto + 31.24 66.53 lineto +stroke + 31.24 66.53 moveto + 31.92 62.16 lineto +stroke + 31.92 62.16 moveto + 31.24 58.00 lineto +stroke + 31.24 58.00 moveto + 29.25 54.45 lineto +stroke + 6.59 74.08 moveto + 9.69 76.67 lineto +stroke + 9.69 76.67 moveto + 13.59 78.05 lineto +stroke + 13.59 78.05 moveto + 17.92 78.07 lineto +stroke + 25.12 82.47 moveto + 29.36 81.10 lineto +stroke + 29.36 81.10 moveto + 33.03 78.40 lineto +stroke + 33.03 78.40 moveto + 35.76 74.66 lineto +stroke + 35.76 74.66 moveto + 37.29 70.23 lineto +stroke + 37.29 70.23 moveto + 37.46 65.55 lineto +stroke + 37.46 65.55 moveto + 36.26 61.07 lineto +stroke + 36.26 61.07 moveto + 33.81 57.24 lineto +stroke + 33.81 57.24 moveto + 30.34 54.42 lineto +stroke + 25.79 52.89 moveto + 25.79 52.89 lineto +stroke + 16.57 80.87 moveto + 20.71 82.39 lineto +stroke + 20.71 82.39 moveto + 25.12 82.47 lineto +stroke + 31.61 80.58 moveto + 35.78 79.23 lineto +stroke + 35.78 79.23 moveto + 39.24 76.60 lineto +stroke + 39.24 76.60 moveto + 41.64 72.95 lineto +stroke + 41.64 72.95 moveto + 42.75 68.64 lineto +stroke + 42.75 68.64 moveto + 42.45 64.09 lineto +stroke + 42.45 64.09 moveto + 40.79 59.75 lineto +stroke + 40.79 59.75 moveto + 37.92 56.04 lineto +stroke + 37.92 56.04 moveto + 34.13 53.32 lineto +stroke + 34.13 53.32 moveto + 29.77 51.86 lineto +stroke + 29.77 51.86 moveto + 27.41 51.83 lineto +stroke + 26.26 51.82 moveto + 26.26 51.82 lineto +stroke + 46.30 65.72 moveto + 47.08 61.93 lineto +stroke + 47.08 61.93 moveto + 46.42 57.95 lineto +stroke + 46.42 57.95 moveto + 44.39 54.17 lineto +stroke + 44.39 54.17 moveto + 41.19 50.98 lineto +stroke + 41.19 50.98 moveto + 37.13 48.67 lineto +stroke + 37.13 48.67 moveto + 32.61 47.47 lineto +stroke + 32.61 47.47 moveto + 28.07 47.50 lineto +stroke + 28.07 47.50 moveto + 25.16 48.40 lineto +stroke + 21.89 50.25 moveto + 21.89 50.25 lineto +stroke + 49.29 53.68 moveto + 49.86 50.74 lineto +stroke + 49.86 50.74 moveto + 48.96 47.71 lineto +stroke + 48.96 47.71 moveto + 46.70 44.88 lineto +stroke + 46.70 44.88 moveto + 43.28 42.54 lineto +stroke + 43.28 42.54 moveto + 39.05 40.91 lineto +stroke + 39.05 40.91 moveto + 34.42 40.15 lineto +stroke + 34.42 40.15 moveto + 29.85 40.34 lineto +stroke + 29.85 40.34 moveto + 25.77 41.45 lineto +stroke + 25.77 41.45 moveto + 22.92 43.18 lineto +stroke + 22.02 44.12 moveto + 22.02 44.12 lineto +stroke + 50.82 36.17 moveto + 49.84 34.38 lineto +stroke + 49.84 34.38 moveto + 47.49 32.79 lineto +stroke + 47.49 32.79 moveto + 44.01 31.56 lineto +stroke + 44.01 31.56 moveto + 39.72 30.82 lineto +stroke + 39.72 30.82 moveto + 35.05 30.62 lineto +stroke + 35.05 30.62 moveto + 30.46 31.01 lineto +stroke + 30.46 31.01 moveto + 26.40 31.92 lineto +stroke + 26.40 31.92 moveto + 23.26 33.29 lineto +stroke + 23.26 33.29 moveto + 21.35 34.96 lineto +stroke + 21.35 34.96 moveto + 20.86 36.78 lineto +stroke + 24.73 21.36 moveto + 24.73 21.36 lineto +stroke + 41.57 6.25 moveto + 41.57 6.25 lineto +stroke + 37.92 7.44 moveto + 37.92 7.44 lineto +stroke + 23.21 10.11 moveto + 23.21 10.11 lineto +stroke + 38.52 -5.82 moveto + 38.52 -5.82 lineto +stroke + 27.00 -0.72 moveto + 25.29 -0.32 lineto +stroke + 25.29 -0.32 moveto + 21.12 -0.06 lineto +stroke + 21.12 -0.06 moveto + 17.66 -0.61 lineto +stroke + 17.66 -0.61 moveto + 15.26 -1.90 lineto +stroke + 15.26 -1.90 moveto + 15.10 -2.18 lineto +stroke + 37.33 -24.51 moveto + 37.33 -24.51 lineto +stroke + 35.13 -16.75 moveto + 35.13 -16.75 lineto +stroke + 31.28 -12.69 moveto + 31.28 -12.69 lineto +stroke + 26.15 -40.19 moveto + 29.25 -37.60 lineto +stroke + 29.25 -37.60 moveto + 31.24 -34.05 lineto +stroke + 31.24 -34.05 moveto + 31.82 -30.50 lineto +stroke + 26.52 -18.27 moveto + 26.52 -18.27 lineto +stroke + 10.72 -45.99 moveto + 15.13 -45.92 lineto +stroke + 15.13 -45.92 moveto + 19.27 -44.40 lineto +stroke + 19.27 -44.40 moveto + 22.73 -41.58 lineto +stroke + 22.73 -41.58 moveto + 25.19 -37.75 lineto +stroke + 25.19 -37.75 moveto + 26.39 -33.27 lineto +stroke + 26.39 -33.27 moveto + 26.32 -31.63 lineto +stroke + 26.26 -29.80 moveto + 26.26 -29.80 lineto +stroke + 20.47 -19.32 moveto + 20.47 -19.32 lineto +stroke + 4.23 -44.10 moveto + 8.71 -44.05 lineto +stroke + 8.71 -44.05 moveto + 13.06 -42.59 lineto +stroke + 13.06 -42.59 moveto + 16.86 -39.87 lineto +stroke + 16.86 -39.87 moveto + 19.73 -36.16 lineto +stroke + 19.73 -36.16 moveto + 21.11 -32.54 lineto +stroke + 21.66 -27.65 moveto + 21.66 -27.65 lineto +stroke + -5.80 -36.47 moveto + -3.40 -40.12 lineto +stroke + -3.40 -40.12 moveto + 0.05 -42.75 lineto +stroke + 0.05 -42.75 moveto + 4.23 -44.10 lineto +stroke + -0.93 -36.11 moveto + 3.61 -36.15 lineto +stroke + 3.61 -36.15 moveto + 8.13 -34.95 lineto +stroke + 8.13 -34.95 moveto + 9.94 -33.92 lineto +stroke + 16.71 -27.01 moveto + 16.71 -27.01 lineto +stroke + -6.44 -33.84 moveto + -6.44 -33.84 lineto +stroke + -5.95 -34.19 moveto + -5.04 -34.85 lineto +stroke + -5.04 -34.85 moveto + -0.93 -36.11 lineto +stroke + 9.67 -20.27 moveto + 9.67 -20.27 lineto +stroke + 14.89 -15.38 moveto + 14.89 -15.38 lineto +stroke + -5.31 -4.33 moveto + -4.24 14.18 lineto +stroke + -4.24 14.18 moveto + -0.93 34.23 lineto +stroke + -0.93 34.23 moveto + 4.23 52.71 lineto +stroke + 4.23 52.71 moveto + 10.72 67.82 lineto +stroke + 10.72 67.82 moveto + 17.92 78.07 lineto +stroke + 17.92 78.07 moveto + 25.12 82.47 lineto +stroke + 25.12 82.47 moveto + 31.61 80.58 lineto +stroke + 10.72 -45.99 moveto + 4.23 -44.10 lineto +stroke + 4.23 -44.10 moveto + -0.93 -36.11 lineto +stroke + -0.93 -36.11 moveto + -1.36 -34.39 lineto +stroke + -4.37 -20.73 moveto + -4.37 -20.73 lineto +stroke + -5.38 -5.47 moveto + -5.38 -5.47 lineto +stroke + -0.77 -5.63 moveto + -0.77 -5.63 lineto +stroke + -0.71 -4.50 moveto + 0.34 13.57 lineto +stroke + 0.34 13.57 moveto + 3.61 33.40 lineto +stroke + 3.61 33.40 moveto + 8.71 51.67 lineto +stroke + 8.71 51.67 moveto + 15.13 66.61 lineto +stroke + 15.13 66.61 moveto + 22.25 76.75 lineto +stroke + 22.25 76.75 moveto + 29.36 81.10 lineto +stroke + 29.36 81.10 moveto + 35.78 79.23 lineto +stroke + 15.13 -45.92 moveto + 8.71 -44.05 lineto +stroke + 8.71 -44.05 moveto + 3.61 -36.15 lineto +stroke + 3.61 -36.15 moveto + 3.13 -34.20 lineto +stroke + 3.90 -5.43 moveto + 3.90 -5.43 lineto +stroke + 3.96 -4.31 moveto + 4.97 13.12 lineto +stroke + 4.97 13.12 moveto + 8.13 32.29 lineto +stroke + 8.13 32.29 moveto + 13.06 49.95 lineto +stroke + 13.06 49.95 moveto + 19.27 64.40 lineto +stroke + 19.27 64.40 moveto + 26.15 74.20 lineto +stroke + 26.15 74.20 moveto + 33.03 78.40 lineto +stroke + 33.03 78.40 moveto + 39.24 76.60 lineto +stroke + 26.15 -40.19 moveto + 19.27 -44.40 lineto +stroke + 19.27 -44.40 moveto + 13.06 -42.59 lineto +stroke + 13.06 -42.59 moveto + 8.13 -34.95 lineto +stroke + 8.13 -34.95 moveto + 7.90 -34.01 lineto +stroke + 4.26 -11.48 moveto + 4.26 -11.48 lineto +stroke + 8.21 -4.13 moveto + 9.20 12.87 lineto +stroke + 9.20 12.87 moveto + 12.20 31.01 lineto +stroke + 12.20 31.01 moveto + 16.86 47.73 lineto +stroke + 16.86 47.73 moveto + 22.73 61.40 lineto +stroke + 22.73 61.40 moveto + 29.25 70.68 lineto +stroke + 29.25 70.68 moveto + 35.76 74.66 lineto +stroke + 35.76 74.66 moveto + 41.64 72.95 lineto +stroke + 41.64 72.95 moveto + 46.30 65.72 lineto +stroke + 46.30 65.72 moveto + 49.29 53.68 lineto +stroke + 35.00 -29.40 moveto + 29.25 -37.60 lineto +stroke + 29.25 -37.60 moveto + 22.73 -41.58 lineto +stroke + 22.73 -41.58 moveto + 16.86 -39.87 lineto +stroke + 16.86 -39.87 moveto + 12.94 -33.80 lineto +stroke + 9.18 -20.29 moveto + 9.18 -20.29 lineto +stroke + 8.59 -11.30 moveto + 8.59 -11.30 lineto +stroke + 11.66 -3.69 moveto + 12.62 12.83 lineto +stroke + 12.62 12.83 moveto + 15.40 29.68 lineto +stroke + 15.40 29.68 moveto + 19.73 45.21 lineto +stroke + 19.73 45.21 moveto + 25.19 57.91 lineto +stroke + 25.19 57.91 moveto + 31.24 66.53 lineto +stroke + 31.24 66.53 moveto + 37.29 70.23 lineto +stroke + 37.29 70.23 moveto + 42.75 68.64 lineto +stroke + 42.75 68.64 moveto + 47.08 61.93 lineto +stroke + 47.08 61.93 moveto + 49.86 50.74 lineto +stroke + 49.86 50.74 moveto + 50.82 36.17 lineto +stroke + 50.82 36.17 moveto + 50.06 23.07 lineto +stroke + 48.20 9.60 moveto + 48.20 9.60 lineto +stroke + 47.69 6.50 moveto + 47.69 6.50 lineto +stroke + 47.08 2.82 moveto + 47.08 2.82 lineto +stroke + 43.86 -8.72 moveto + 43.86 -8.72 lineto +stroke + 34.34 -29.63 moveto + 31.24 -34.05 lineto +stroke + 31.24 -34.05 moveto + 25.19 -37.75 lineto +stroke + 25.19 -37.75 moveto + 19.73 -36.16 lineto +stroke + 19.73 -36.16 moveto + 17.77 -33.12 lineto +stroke + 13.08 -20.13 moveto + 13.08 -20.13 lineto +stroke + 12.15 -11.15 moveto + 12.15 -11.15 lineto +stroke + 11.68 -3.99 moveto + 11.66 -3.69 lineto +stroke + 14.00 -2.10 moveto + 14.88 13.01 lineto +stroke + 14.88 13.01 moveto + 17.43 28.44 lineto +stroke + 17.43 28.44 moveto + 21.39 42.65 lineto +stroke + 21.39 42.65 moveto + 26.39 54.28 lineto +stroke + 26.39 54.28 moveto + 31.92 62.16 lineto +stroke + 31.92 62.16 moveto + 37.46 65.55 lineto +stroke + 37.46 65.55 moveto + 42.45 64.09 lineto +stroke + 42.45 64.09 moveto + 46.42 57.95 lineto +stroke + 46.42 57.95 moveto + 48.96 47.71 lineto +stroke + 48.96 47.71 moveto + 49.84 34.38 lineto +stroke + 49.84 34.38 moveto + 49.22 23.73 lineto +stroke + 49.22 23.72 moveto + 49.22 23.72 lineto +stroke + 49.11 21.87 moveto + 49.11 21.87 lineto +stroke + 48.89 18.84 moveto + 48.89 18.84 lineto +stroke + 48.67 17.48 moveto + 48.67 17.48 lineto +stroke + 47.01 7.41 moveto + 47.01 7.41 lineto +stroke + 46.90 6.74 moveto + 46.90 6.74 lineto +stroke + 35.16 -25.27 moveto + 35.16 -25.27 lineto +stroke + 30.60 -30.69 moveto + 30.60 -30.69 lineto +stroke + 30.25 -30.91 moveto + 26.39 -33.27 lineto +stroke + 26.39 -33.27 moveto + 22.84 -32.24 lineto +stroke + 19.00 -28.11 moveto + 19.00 -28.11 lineto +stroke + 14.88 -15.38 moveto + 14.88 -15.38 lineto +stroke + 14.42 -8.40 moveto + 14.42 -8.40 lineto +stroke + 14.36 -7.45 moveto + 14.36 -7.45 lineto +stroke + 14.10 -3.58 moveto + 14.00 -2.10 lineto +stroke + 14.98 -0.31 moveto + 15.78 13.41 lineto +stroke + 15.78 13.41 moveto + 18.08 27.40 lineto +stroke + 18.08 27.40 moveto + 21.68 40.30 lineto +stroke + 21.68 40.30 moveto + 26.21 50.84 lineto +stroke + 26.21 50.84 moveto + 31.24 58.00 lineto +stroke + 31.24 58.00 moveto + 36.26 61.07 lineto +stroke + 36.26 61.07 moveto + 40.79 59.75 lineto +stroke + 40.79 59.75 moveto + 44.39 54.17 lineto +stroke + 44.39 54.17 moveto + 46.70 44.88 lineto +stroke + 46.70 44.88 moveto + 47.49 32.79 lineto +stroke + 47.49 32.79 moveto + 47.02 24.69 lineto +stroke + 45.57 12.24 moveto + 45.57 12.24 lineto +stroke + 44.67 6.79 moveto + 44.67 6.79 lineto +stroke + 42.99 0.05 moveto + 42.99 0.05 lineto +stroke + 42.80 -0.62 moveto + 42.80 -0.62 lineto +stroke + 39.79 -10.15 moveto + 39.79 -10.15 lineto +stroke + 15.18 -3.39 moveto + 14.98 -0.31 lineto +stroke + 25.42 48.99 moveto + 29.25 54.45 lineto +stroke + 29.25 54.45 moveto + 33.81 57.24 lineto +stroke + 33.81 57.24 moveto + 37.92 56.04 lineto +stroke + 37.92 56.04 moveto + 41.19 50.98 lineto +stroke + 41.19 50.98 moveto + 43.28 42.54 lineto +stroke + 43.28 42.54 moveto + 44.01 31.56 lineto +stroke + 44.01 31.56 moveto + 43.69 26.13 lineto +stroke + 41.04 5.89 moveto + 41.04 5.89 lineto +stroke + 37.55 -6.16 moveto + 37.55 -6.16 lineto +stroke + 34.25 -13.85 moveto + 34.25 -13.85 lineto +stroke + 28.39 53.23 moveto + 30.34 54.42 lineto +stroke + 30.34 54.42 moveto + 34.13 53.32 lineto +stroke + 34.13 53.32 moveto + 37.13 48.67 lineto +stroke + 37.13 48.67 moveto + 39.05 40.91 lineto +stroke + 39.05 40.91 moveto + 39.72 30.82 lineto +stroke + 39.72 30.82 moveto + 39.55 27.93 lineto +stroke + 38.09 13.55 moveto + 38.09 13.55 lineto +stroke + 36.25 4.55 moveto + 36.25 4.55 lineto +stroke + 31.96 -8.12 moveto + 31.96 -8.12 lineto +stroke + 29.56 -12.99 moveto + 29.56 -12.99 lineto +stroke + 19.05 -19.57 moveto + 19.05 -19.57 lineto +stroke + 27.41 52.55 moveto + 27.41 52.55 lineto +stroke + 27.83 52.43 moveto + 29.77 51.86 lineto +stroke + 29.77 51.86 moveto + 32.61 47.47 lineto +stroke + 32.61 47.47 moveto + 34.42 40.15 lineto +stroke + 34.42 40.15 moveto + 35.05 30.62 lineto +stroke + 35.05 30.62 moveto + 34.99 29.56 lineto +stroke + 34.98 29.46 moveto + 34.98 29.46 lineto +stroke + 33.56 14.59 moveto + 33.56 14.59 lineto +stroke + 32.72 9.46 moveto + 32.72 9.46 lineto +stroke + 28.70 -3.85 moveto + 28.70 -3.85 lineto +stroke + 25.31 51.78 moveto + 25.31 51.78 lineto +stroke + 26.30 50.25 moveto + 28.07 47.50 lineto +stroke + 28.07 47.50 moveto + 29.85 40.34 lineto +stroke + 29.85 40.34 moveto + 30.46 31.01 lineto +stroke + 30.46 31.01 moveto + 30.44 30.61 lineto +stroke + 27.66 8.18 moveto + 27.66 8.18 lineto +stroke + 25.74 1.28 moveto + 25.29 -0.32 lineto +stroke + 25.29 -0.32 moveto + 24.79 -1.50 lineto +stroke + 24.09 -3.12 moveto + 24.09 -3.12 lineto +stroke + 22.86 -5.97 moveto + 22.86 -5.97 lineto +stroke + 20.65 -10.08 moveto + 20.65 -10.08 lineto +stroke + 22.33 51.28 moveto + 22.33 51.28 lineto +stroke + 24.45 46.75 moveto + 25.77 41.45 lineto +stroke + 25.77 41.45 moveto + 26.40 31.92 lineto +stroke + 26.40 31.92 moveto + 26.37 31.53 lineto +stroke + 25.41 18.93 moveto + 25.41 18.93 lineto +stroke + 23.87 9.83 moveto + 23.87 9.83 lineto +stroke + 22.92 6.40 moveto + 22.92 6.40 lineto +stroke + 22.78 5.89 moveto + 22.78 5.89 lineto +stroke + 21.74 2.18 moveto + 21.12 -0.06 lineto +stroke + 21.12 -0.06 moveto + 20.05 -2.54 lineto +stroke + 22.65 42.55 moveto + 23.26 33.29 lineto +stroke + 23.26 33.29 moveto + 23.20 32.25 lineto +stroke + 23.12 30.87 moveto + 23.12 30.87 lineto +stroke + 22.28 19.96 moveto + 22.28 19.96 lineto +stroke + 18.66 2.97 moveto + 18.66 2.97 lineto +stroke + 18.64 2.88 moveto + 17.66 -0.61 lineto +stroke + 17.66 -0.61 moveto + 16.57 -3.15 lineto +stroke + 15.97 -4.54 moveto + 15.97 -4.54 lineto +stroke + 21.13 38.31 moveto + 21.35 34.96 lineto +stroke + 21.35 34.96 moveto + 21.22 32.69 lineto +stroke + 19.52 15.79 moveto + 19.52 15.79 lineto +stroke + 16.72 3.31 moveto + 15.26 -1.90 lineto +stroke + 15.26 -1.90 moveto + 15.11 -2.26 lineto +stroke + 20.83 37.24 moveto + 20.86 36.78 lineto +stroke + 20.86 36.78 moveto + 20.63 32.83 lineto +stroke + 18.15 11.50 moveto + 18.15 11.50 lineto +stroke + 16.20 3.53 moveto + 16.20 3.53 lineto +stroke + 16.18 3.44 moveto + 16.18 3.44 lineto +stroke + 16.18 3.42 moveto + 15.01 -0.76 lineto +stroke + -14.98 0.31 moveto + -14.02 16.82 lineto +stroke + -14.02 16.82 moveto + -11.24 33.67 lineto +stroke + -11.24 33.67 moveto + -6.91 49.21 lineto +stroke + -6.91 49.21 moveto + -1.45 61.91 lineto +stroke + -14.25 -10.85 moveto + -14.25 -10.85 lineto +stroke + -14.65 -4.70 moveto + -14.65 -4.70 lineto +stroke + -14.73 -3.54 moveto + -14.98 0.31 lineto +stroke + -14.49 -1.52 moveto + -13.46 16.26 lineto +stroke + -13.46 16.26 moveto + -10.46 34.40 lineto +stroke + -10.46 34.40 moveto + -5.80 51.13 lineto +stroke + -5.80 51.13 moveto + 0.08 64.80 lineto +stroke + 0.08 64.80 moveto + 6.59 74.08 lineto +stroke + -5.80 -36.47 moveto + -7.35 -34.08 lineto +stroke + -14.28 -4.73 moveto + -14.28 -4.73 lineto +stroke + -14.35 -3.57 moveto + -14.49 -1.52 lineto +stroke + -12.58 -3.19 moveto + -11.49 15.59 lineto +stroke + -11.49 15.59 moveto + -8.33 34.76 lineto +stroke + -8.33 34.76 moveto + -3.40 52.42 lineto +stroke + -3.40 52.42 moveto + 2.81 66.87 lineto +stroke + 2.81 66.87 moveto + 9.69 76.67 lineto +stroke + 9.69 76.67 moveto + 16.57 80.87 lineto +stroke + -3.40 -40.12 moveto + -7.30 -34.08 lineto +stroke + -8.47 -31.93 moveto + -8.47 -31.93 lineto +stroke + -10.24 -24.79 moveto + -10.24 -24.79 lineto +stroke + -12.06 -11.03 moveto + -12.06 -11.03 lineto +stroke + -12.47 -4.88 moveto + -12.47 -4.88 lineto +stroke + -12.55 -3.72 moveto + -12.58 -3.19 lineto +stroke + -9.41 -3.99 moveto + -8.31 14.87 lineto +stroke + -8.31 14.87 moveto + -5.04 34.69 lineto +stroke + -5.04 34.69 moveto + 0.05 52.97 lineto +stroke + 0.05 52.97 moveto + 6.47 67.91 lineto +stroke + 6.47 67.91 moveto + 13.59 78.05 lineto +stroke + 13.59 78.05 moveto + 20.71 82.39 lineto +stroke + 0.05 -42.75 moveto + -5.04 -34.85 lineto +stroke + -5.04 -34.85 moveto + -5.19 -34.26 lineto +stroke + -5.71 -32.16 moveto + -5.71 -32.16 lineto +stroke + -9.40 -5.14 moveto + -9.40 -5.14 lineto +stroke +grestore +showpage diff --git a/cdg0gv-2010/beispiele/include b/cdg0gv-2010/beispiele/include new file mode 120000 index 0000000..f5030fe --- /dev/null +++ b/cdg0gv-2010/beispiele/include @@ -0,0 +1 @@ +../include \ No newline at end of file diff --git a/cdg0gv-2010/beispiele/n_eck b/cdg0gv-2010/beispiele/n_eck new file mode 100755 index 0000000..a350913 Binary files /dev/null and b/cdg0gv-2010/beispiele/n_eck differ diff --git a/cdg0gv-2010/beispiele/n_eck.o b/cdg0gv-2010/beispiele/n_eck.o new file mode 100644 index 0000000..6a666d3 Binary files /dev/null and b/cdg0gv-2010/beispiele/n_eck.o differ diff --git a/cdg0gv-2010/beispiele/n_eck.p b/cdg0gv-2010/beispiele/n_eck.p new file mode 100644 index 0000000..fda8d4a --- /dev/null +++ b/cdg0gv-2010/beispiele/n_eck.p @@ -0,0 +1,36 @@ +{******************************} +{*** Regelmaessiges n-Eck ***} +{******************************} +program n_eck; +uses geograph; +var p : vts2d; + n,iverb,i,j,inz : integer; + r,dw,cdw,sdw : real; +{*******************} + begin {Hauptprogramm} + graph_on(0); + repeat + writeln('*** n-Eck ***'); + writeln(' n ? Radius r des zugehoerigen Kreises ?'); + readln(n,r); + writeln('Jeden Punkt mit jedem Punkt verbinden ? (Ja = 1)'); + readln(iverb); +{Berechnung der Eckpunkte:} + put2d(r,0, p[0]); + dw:= pi2/n; cdw:= cos(dw); sdw:= sin(dw); + for i := 0 to n-1 do rotor2d(cdw,sdw, p[i], p[i+1]); + draw_area(2*r+20,2*r+20,r+10,r+10,1); +{Zeichnen:} new_color(green); + if iverb=1 then + for i:= 0 to n-1 do + for j:= i+1 to n do + line2d(p[i],p[j],0) + else + curve2d(p,0,n,0); + draw_end; + writeln('Noch eine Zeichnung? (ja:1, nein:0)'); + readln(inz); + until inz=0; + graph_off; + end. + diff --git a/cdg0gv-2010/beispiele/n_ecki.p b/cdg0gv-2010/beispiele/n_ecki.p new file mode 100644 index 0000000..d9e3ffc --- /dev/null +++ b/cdg0gv-2010/beispiele/n_ecki.p @@ -0,0 +1,41 @@ +{******************************} +{*** Regelmaessiges n-Eck ***} +{******************************} +program n_eck; +uses linux; +const {$i include/geoconst.pas} +type {$i include/geotype.pas} +var {$i include/geovar.pas} + p : vts2d; + n,iverb,i,j,inz : integer; + r,dw,cdw,sdw : real; + {$i include/geoproc.pas} + {$i include/proc_ag.pas} +{*******************} + begin {Hauptprogramm} + graph_on(0); + repeat + writeln('*** n-Eck ***'); + writeln(' n ? Radius r des zugehoerigen Kreises ?'); + readln(n,r); + writeln('Jeden Punkt mit jedem Punkt verbinden ? (Ja = 1)'); + readln(iverb); +{Berechnung der Eckpunkte:} + put2d(r,0, p[0]); + dw:= pi2/n; cdw:= cos(dw); sdw:= sin(dw); + for i := 0 to n-1 do rotor2d(cdw,sdw, p[i], p[i+1]); + draw_area(2*r+20,2*r+20,r+10,r+10,1); +{Zeichnen:} new_color(green); + if iverb=1 then + for i:= 0 to n-1 do + for j:= i+1 to n do + line2d(p[i],p[j],0) + else + curve2d(p,0,n,0); + draw_end; + writeln('Noch eine Zeichnung? (ja:1, nein:0)'); + readln(inz); + until inz=0; + graph_off; + end. + diff --git a/cdg0gv-2010/beispiele/pldv b/cdg0gv-2010/beispiele/pldv new file mode 120000 index 0000000..90d3aac --- /dev/null +++ b/cdg0gv-2010/beispiele/pldv @@ -0,0 +1 @@ +../tools/pldv \ No newline at end of file diff --git a/cdg0gv-2010/beispiele/povcommandline.txt b/cdg0gv-2010/beispiele/povcommandline.txt new file mode 100644 index 0000000..41d3dfe --- /dev/null +++ b/cdg0gv-2010/beispiele/povcommandline.txt @@ -0,0 +1,7 @@ + +%%%% Type the following command +%%%% (file triblend.pp has to be provided by triblend_pov !). + + povray +L/usr/lib/povray31/include +Itriblend.pov +Otriblend.tga +W600 +H400 +FT + +%%%% File triblend.tga can be displayed by xv. diff --git a/cdg0gv-2010/beispiele/tori b/cdg0gv-2010/beispiele/tori new file mode 100755 index 0000000..a588d1b Binary files /dev/null and b/cdg0gv-2010/beispiele/tori differ diff --git a/cdg0gv-2010/beispiele/tori.o b/cdg0gv-2010/beispiele/tori.o new file mode 100644 index 0000000..cfca81e Binary files /dev/null and b/cdg0gv-2010/beispiele/tori.o differ diff --git a/cdg0gv-2010/beispiele/tori.p b/cdg0gv-2010/beispiele/tori.p new file mode 100644 index 0000000..8fcb8ba --- /dev/null +++ b/cdg0gv-2010/beispiele/tori.p @@ -0,0 +1,87 @@ +{*** Projektion zweier Tori mit UP cp_lines_before_convex_faces ***} +{********************************************************************} +program tori_h; +uses geograph,dos; + const {Achtung: es muss array_size>=nfmax sein !!!} + nfmax= 20000; nemax=40000; nsegmax=10; npfmax=4; + + + type vts2d_pol = array[0..npfmax] of vt2d; + vts3d_pol = array[0..npfmax] of vt3d; + r_array_seg = array[0..nsegmax] of real; + i_array_seg = array[0..nsegmax] of integer; + box3d_dat = record + xmin,xmax,ymin,ymax,zmin,zmax : real; + end; + face_dat = record + npf,nef : integer; + fp,fe : array[1..npfmax] of integer; + vis : boolean; + box : box3d_dat; + discentre,d : real; + nv : vt3d; + end; + edge_dat = record + vis : boolean; + ep1,ep2,color,linew : integer; + end; + var face : array[1..nfmax] of face_dat; + edge : array[1..nemax] of edge_dat; + p : vts3d; p0 : vt3d; pdist : r_array; error : boolean; + n1,n2,np,nf,ne,i,j,k,ik,iachs,inz,ianf,i2tor : integer; + r1,r2,xf,yf,x1,y1,x2,y2,dw,cdw,sdw : real; + {$i include/proc_zpo.pas} + +{****************} +begin {Hauptprogramm} + graph_on(0); + repeat + writeln(' *** 2 Tori *** '); writeln; +{ writeln(' n2 (>2 Unterteilungen des grossen Kreises) ? '); readln(n2); + writeln(' n1 (>2 Unterteilungen des kleinen Kreises) ? '); readln(n1); + writeln(' 2 Tori ? (ja=1) oder 1 Torus ? '); readln(i2tor);} + n1:= 20; n2:= 20; i2tor:= 1; + r1:= 50; r2:= 15; +{ Koordinaten der Punkte 1...n1 (kleiner Kreis): } + dw:= pi2/n1; cdw:= cos(dw); sdw:= sin(dw); + put3d(r1+r2,0,0, p[1]); put3d(r1,0,0, p0); + for i:= 2 to n1 do rotp0y(cdw,-sdw,p0, p[i-1], p[i]); +{ Koordinaten der restlichen Punkte des 1. Torus: } + dw:= pi2/n2; cdw:= cos(dw); sdw:= sin(dw); + for k:= 2 to n2 do + for i:= 1 to n1 do + begin + ik:= i + (k-1)*n1; + rotorz(cdw,sdw,p[ik-n1], p[ik]); + end; + np:= n1*n2; + aux_torus(n1,n2,0,0,0); +{ 2. Torus:} + if i2tor=1 then + begin + for i:= 1 to np do put3d(p[i].x-r1, -p[i].z, p[i].y, p[np+i]); + aux_torus(n1,n2,np,ne,nf); + end; + writeln(' np:',np); writeln(' nf:',nf); writeln(' ne:',ne); + + repeat + init_centralparallel_projection(2); + { writeln(' Koordinaten-Achsen ? (Ja = 1)'); readln(iachs);} +{ Zeichnen : } + draw_area(200,200,80,90,1); + { if iachs=1 then begin cp_axes(20); point2d(null2d,0); end; } + + cp_lines_before_convex_faces(true,false,false); {Hiddenline-Algorithmus} + + draw_end ; writeln ; + writeln(' Noch eine Projektion ? ( Ja = 1 )'); readln(inz); + until inz=0; + writeln('Noch einmal mit ANDEREN n1, n2 ? (ja: 1)'); readln(ianf); + until ianf=0; + graph_off; + end. + + + + + diff --git a/cdg0gv-2010/beispiele/triang_proc.p b/cdg0gv-2010/beispiele/triang_proc.p new file mode 100644 index 0000000..f964688 --- /dev/null +++ b/cdg0gv-2010/beispiele/triang_proc.p @@ -0,0 +1,718 @@ + +(* + +{***************************************************} +{********* P R O C E D U R E S ON VECTORS *******} +{***************************************************} + +const array_size = 20000; + pi= 3.14159265358; pi2= 6.2831853; pih= 1.5707963; + eps8=0.00000001; + +type vt3d = record x: real; y: real; z: real; end; + vts3d = array[0..array_size] of vt3d; +{***************************************************} + +function max(a,b : real) : real; + begin if a>=b then max:= a else max:= b; end; {max} +{*************} +function min(a,b : real) : real; + begin if a<=b then min:= a else min:= b; end; {min} +{*************} + +procedure put3d(x,y,z : real; var v: vt3d); + begin v.x:= x; v.y:= y; v.z:= z; end; +{*************} + +procedure get3d(v : vt3d; var x,y,z: real); + begin x:= v.x; y:= v.y; z:= v.z; end; +{*************} + +procedure scale3d(r : real; v: vt3d; var vs: vt3d); + begin vs.x:= r*v.x; vs.y:= r*v.y; vs.z:= r*v.z; end; +{*************} + +procedure sum3d(v1,v2 : vt3d; var vs : vt3d); + begin vs.x:= v1.x + v2.x; vs.y:= v1.y + v2.y; vs.z:= v1.z + v2.z; end; +{*************} + +procedure diff3d(v1,v2 : vt3d; var vs : vt3d); + begin vs.x:= v1.x - v2.x; vs.y:= v1.y - v2.y; vs.z:= v1.z - v2.z; end; +{*************} + +procedure lcomb2vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; var vlc : vt3d); + begin + vlc.x:= r1*v1.x + r2*v2.x; vlc.y:= r1*v1.y + r2*v2.y; vlc.z:= r1*v1.z + r2*v2.z; + end; +{*************} + +procedure lcomb3vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; + r3: real; v3: vt3d; var vlc : vt3d); + begin + vlc.x:= r1*v1.x + r2*v2.x + r3*v3.x; + vlc.y:= r1*v1.y + r2*v2.y + r3*v3.y; + vlc.z:= r1*v1.z + r2*v2.z + r3*v3.z; + end; +{*************} + +function abs3d(v : vt3d) : real; + begin abs3d:= abs(v.x) + abs(v.y) + abs(v.z); end; +{*************} +function length3d(v : vt3d) : real; + begin length3d:= sqrt( sqr(v.x) + sqr(v.y) + sqr(v.z)); end; +{*************} +procedure normalize3d(var p: vt3d); +var c : real; +begin c:= 1/length3d(p); p.x:= c*p.x; p.y:= c*p.y; p.z:= c*p.z end; +{************} +function scalarp3d(p1,p2 : vt3d) : real; + begin scalarp3d:= p1.x*p2.x + p1.y*p2.y + p1.z*p2.z; end; +{*************} +function distance3d(p,q : vt3d): real; +begin distance3d:= sqrt( sqr(p.x-q.x) + sqr(p.y-q.y) + sqr(p.z-q.z) ); end; +{*************} +function distance3d_square(p,q : vt3d) : real; +begin distance3d_square:= sqr(p.x-q.x) + sqr(p.y-q.y) + sqr(p.z-q.z); end; +{**************} + +procedure vectorp(v1,v2 : vt3d; var vp : vt3d); +{vectorproduct of v1,v2} + begin + vp.x:= v1.y*v2.z - v1.z*v2.y ; + vp.y:= -v1.x*v2.z + v2.x*v1.z ; + vp.z:= v1.x*v2.y - v2.x*v1.y ; + end; {vectorp} +{*************} + +function determ3d(v1,v2,v3: vt3d) : real; +{determinant of 3 vectors.} + begin + determ3d:= v1.x*v2.y*v3.z + v1.y*v2.z*v3.x + v1.z*v2.x*v3.y + - v1.z*v2.y*v3.x - v1.x*v2.z*v3.y - v1.y*v2.x*v3.z; + end; {determ3d} +{*************} + +procedure rotorz(cos_rota,sin_rota : real; p : vt3d; var pr: vt3d); + begin + pr.x:= p.x*cos_rota - p.y*sin_rota; + pr.y:= p.x*sin_rota + p.y*cos_rota; pr.z:= p.z; + end; {rotorz} +{*************} + +function polar_angle(x,y : real) : real; + {determines the polar angle of point (x,y)} + var w : real; + begin + if (x=0) and (y=0) then w:= 0 + else + begin + if abs(y)<=abs(x) then + begin + w:= arctan(y/x); + if x<0 then w:=pi+w + else if (y<0) and( w<>0) then w:= pi2+w; + end + else + begin + w:= pih-arctan(x/y); + if y<0 then w:= pi+w; + end; {if} + end; {if} + polar_angle:= w; + end; { polar_angle } +{******************} + +procedure newcoordinates3d(p,b0,b1,b2,b3: vt3d; var pnew: vt3d); +{determines the coordinates of p for the basis b1,b2,b3 with origin b0.} +var det : real; p0: vt3d; +begin + diff3d(p,b0, p0); det:= determ3d(b1,b2,b3); + pnew.x:= determ3d(p0,b2,b3)/det; + pnew.y:= determ3d(b1,p0,b3)/det; + pnew.z:= determ3d(b1,b2,p0)/det; +end; { newcoordinates3d } +{************} + +*) + +{*******************************************************************************} + +{**********************************************} +{********** T R I A N G U L A T I O N : *******} +{**********************************************} + +(* +{for triangulation:} +const tnfmax=10000; tnemax=20000; tnpmax=10000; + tfrnpmax= 500; {max. number of points in a front} + tnfrmax=20; {max. number of further fronts.}*) + +type +(* implicit3d = procedure(p: vt3d; var fvalue: real; var gradf: vt3d);*) + + tface_dat = record + p1,p2,p3: integer; {points of a triangle} + end; + tpoint_dat= record + p,nv,tv1,tv2 : vt3d; {coordinates, normal,tangentvectors} + full,achange: boolean; {full=true: point surrounded by triang.} + angle: real; {achange=true: angle was changed} + end; +var + tface : array[1..tnfmax] of tface_dat; + tpoint: array[1..tnpmax] of tpoint_dat; + tfrontpt: array[1..tfrnpmax] of integer; {points in actual front polygon} + tfrontnp: integer; {number of front points} + tfr : array[0..tnfrmax,0..tfrnpmax] of integer; {further fronts} + tfrbox : array[0..tnfrmax,1..6] of real; + tnp,tne,tnf,tnfr : integer; {number of points, edges, triangles, fronts} + tstepl,tstepl_square,xmin,xmax,ymin,ymax,zmin,zmax,minangle : real; + n_triang,fullcount,frontnumber: integer; + f_gradf : implicit3d; + actual_ip : integer; + nearpointtest : boolean; + cuttype : integer; + xcut,ycut,zcut,rcut,rcut_square: real; +{*****************************************} +procedure quader(xmin,xmax,ymin,ymax,zmin,zmax: real); +var p1,p2,p3,p4,p5,p6,p7,p8: vt3d; +begin + put3d(xmin,ymin,zmin, p1); + put3d(xmax,ymin,zmin, p2); + put3d(xmax,ymax,zmin, p3); + put3d(xmin,ymax,zmin, p4); + put3d(xmin,ymin,zmax, p5); + put3d(xmax,ymin,zmax, p6); + put3d(xmax,ymax,zmax, p7); + put3d(xmin,ymax,zmax, p8); + cp_line(p1,p2,0); cp_line(p2,p3,0); cp_line(p3,p4,0); cp_line(p4,p1,0); + cp_line(p5,p6,0); cp_line(p6,p7,0); cp_line(p7,p8,0); cp_line(p8,p5,0); + cp_line(p1,p5,0); cp_line(p2,p6,0); cp_line(p3,p7,0); cp_line(p4,p8,0); +end; +{***************************************************************************} + + +procedure insert_point(ip_new,i_new: integer); +{inserts point ip_new as i_new-th front point} +var i : integer; +begin + for i:= tfrontnp+1 downto i_new do tfrontpt[i+1]:= tfrontpt[i]; + tfrontpt[i_new]:= ip_new; + tfrontnp:= tfrontnp+1; +end; +{******} +procedure delete_point(i_del: integer); +{deletes i_del-th front point} +var i : integer; +begin + tfrontnp:= tfrontnp-1; + for i:= i_del to tfrontnp+1 do tfrontpt[i]:= tfrontpt[i+1]; +end; +{******} + +function point_ok_box(p: vt3d): boolean; +{point p in bounding box ?} +begin + with p do + if ((x<=xmax) and (x>=xmin) and + (y<=ymax) and (y>=ymin) and + (z<=zmax) and (z>=zmin)) then point_ok_box:= true + else point_ok_box:= false; +end; +{*****} +procedure cut_seg_box(p0,p: vt3d; var pc: vt3d); +{cuts new edge p0-p at bounding box -> p0-pc} +var dv: vt3d; x0,y0,z0,t: real; +begin + diff3d(p,p0, dv); t:= 1; get3d(p0, x0,y0,z0); + with dv do + begin + if x>0 then t:= min(t,(xmax-x0)/x) else t:= min(t,(xmin-x0)/x); + if y>0 then t:= min(t,(ymax-y0)/y) else t:= min(t,(ymin-y0)/y); + if z>0 then t:= min(t,(zmax-z0)/z) else t:= min(t,(zmin-z0)/z); + end; + lcomb2vt3d(1,p0,t,dv, pc); +end; +{******} + +function point_ok_cyl(p: vt3d): boolean; +{point p in bounding box ?} +begin + with p do + if (z<=zmax) and (z>=zmin) and (sqr(x-xcut)+sqr(y-ycut)< rcut_square) + then point_ok_cyl:= true + else point_ok_cyl:= false; +end; +{*****} +procedure cut_seg_cyl(p0,p: vt3d; var pc: vt3d); +{cuts new edge p0-p at bounding cylinder -> p0-pc} +var dv: vt3d; t,x0,y0,z0,a,b,d2: real; +begin + diff3d(p,p0, dv); t:= 1; get3d(p0, x0,y0,z0); + with dv do + begin + if z>0 then t:= min(t,(zmax-z0)/z) else t:= min(t,(zmin-z0)/z); + d2:=x*x+y*y; + if d2>0 then + begin + x0:= p0.x-xcut; y0:=p0.y-ycut; + a:= (x0*x+y0*y)/d2; b:= (x0*x0+y0*y0-rcut_square)/d2; + t:= min(t,-a+sqrt(a*a-b)); + end; + end; + lcomb2vt3d(1,p0,t,dv, pc); +end; +{******} +function point_ok_sph(p: vt3d): boolean; +{point p in bounding sphere ?} +begin + with p do + if (sqr(x-xcut)+sqr(y-ycut)+sqr(z-zcut)< rcut_square) + then point_ok_sph:= true + else point_ok_sph:= false; +end; +{*****} +procedure cut_seg_sph(p0,p: vt3d; var pc: vt3d); +{cuts new edge p0-p at bounding sphere -> p0-pc} +var dv: vt3d; t,x0,y0,z0,a,b,d2: real; +begin + diff3d(p,p0, dv); t:= 1; get3d(p0, x0,y0,z0); + with dv do + begin + d2:=x*x+y*y+z*z; + if d2>0 then + begin + x0:= p0.x-xcut; y0:=p0.y-ycut; z0:= p0.z-zcut; + a:= (x0*x+y0*y+z0*z)/d2; + b:= (x0*x0+y0*y0+z0*z0-rcut_square)/d2; + t:= min(t,-a+sqrt(a*a-b)); + end; + end; + lcomb2vt3d(1,p0,t,dv, pc); +end; +{******} + +function point_ok(p: vt3d): boolean; +{point p in bounding box or cylinder} +begin + if cuttype=1 then + point_ok:= point_ok_cyl(p) + else if cuttype=2 then point_ok:= point_ok_sph(p) + else point_ok:= point_ok_box(p); +end; +{*****} +procedure cut_seg(p0,p: vt3d; var pc: vt3d); +{cuts new edge p0-p at bounding box or cylinder -> p0-pc} +begin + if cuttype=1 then cut_seg_cyl(p0,p, pc) + else if cuttype=2 then cut_seg_sph(p0,p, pc) + else cut_seg_box(p0,p, pc); +end; +{******} + +procedure surface_point_normal_tangentvts(p_start : vt3d; + f_gradf : implicit3d; + var p,nv,tv1,tv2: vt3d); +{***} +procedure surface_point(p0 : vt3d; var p_surface,nv : vt3d); +{seeks surface point along the steepest way} + var delta,fi : real; p_i,p_i1,dv,gradfi : vt3d; +{**} +procedure newton_step(p_i : vt3d; var p_i1 : vt3d); + var t,cc : real; + begin + f_gradf(p_i, fi,gradfi); + cc:= scalarp3d(gradfi,gradfi); + if cc>1E-15{eps8} then t:= -fi/cc + else + begin t:= 0; writeln(cc,' WARNING tri (surface_point...): newton'); + new_color(lightred); cp_point(p_i, 1); new_color(default); end; + lcomb2vt3d(1,p_i, t,gradfi, p_i1); + end; +{**} + begin {surface_point} + p_i:= p0; + repeat + newton_step(p_i, p_i1); diff3d(p_i1,p_i, dv); + delta:= abs3d(dv); + p_i:= p_i1; + until delta < eps8; + p_surface:= p_i1; nv:= gradfi; + end; { surface_point } +{***} +begin + surface_point(p_start, p,nv); + normalize3d(nv); + with nv do if (abs(x)>0.5) or (abs(y)>0.5) then put3d(y,-x,0, tv1) + else put3d(-z,0,x, tv1); + normalize3d(tv1); vectorp(nv,tv1, tv2); {nv,tv1,tv2: ON-base} +end; {surface_point_normal_tangentvts} +{****} + +procedure start_triangulation(p_start: vt3d; f_gradf: implicit3d); +{calculates from p_start the first surface point p[1] and the first six triangles} +var p0,p1,nv0,tv10,tv20 : vt3d; i,tnp0 : integer; dw,cw,sw : real; +begin + tnp:= tnp+1; + surface_point_normal_tangentvts(p_start,f_gradf,p0,nv0,tv10,tv20); + if not point_ok(p0) then + begin writeln('!!! First point not in bounding box or cylinder !!!'); + n_triang:= 0; exit; + end; + with tpoint[tnp] do + begin p:= p0; nv:= nv0; tv1:= tv10; tv2:= tv20; end; + tnp0:= tnp; + for i:= 0 to 5 do + begin + dw:= pi/3; cw:= cos(i*dw); sw:= sin(i*dw); + lcomb3vt3d(1,p0,tstepl*cw,tv10,tstepl*sw,tv20, p1); + tnp:= tnp +1; tfrontpt[i+1]:= tnp; + with tpoint[tnp] do + begin + surface_point_normal_tangentvts(p1,f_gradf, p,nv,tv1,tv2); + achange:= true; + end; + end; { for } + tfrontnp:= 6; tpoint[1].full:= true; + for i:= 1 to 6 do {triangles} + begin + tnf:= tnf+1; + with tface[tnf] do begin p1:= tnp0; p2:= tnp0+i; p3:= tnp0+i+1; end; + end; + tface[tnf].p3:= tnp0+1; +end; +{********} +procedure new_triangle(q1,q2,q3: integer); +begin + tnf:= tnf+1; + with tface[tnf] do begin p1:= q1; p2:= q2; p3:= q3; end; +end; +{****} +function reduce(n: integer): integer; +begin + reduce:= n; + if n<1 then reduce:= n+tfrontnp; + if n>tfrontnp then reduce:= n-tfrontnp; +end; +{****} + +procedure make_angle(ipf: integer); +{calculates the front angle at ipf-th front point} +var pn1,pn2,pn11,pn22 : vt3d; ip,ip1,ip2 : integer; w1,w2: real; +begin + ip:= tfrontpt[ipf]; + with tpoint[ip] do + if (full or (not achange) ) then exit + else + begin + ip1:= tfrontpt[reduce(ipf-1)]; + ip2:= tfrontpt[reduce(ipf+1)]; + pn1:= tpoint[ip1].p; newcoordinates3d(pn1,p,tv1,tv2,nv, pn11); + pn2:= tpoint[ip2].p; newcoordinates3d(pn2,p,tv1,tv2,nv, pn22); + w1:= polar_angle(pn11.x,pn11.y); + w2:= polar_angle(pn22.x,pn22.y); if w2ipf+3 ! important for divide_front} + for i:= ipf+3 to nn do + begin {ipi not neighbor or neighbor of neighbors} + ipi:= tfrontpt[i]; + with tpoint[ipi] do + if not full then + if abs(p0.x-p.x)0 then + begin ipf:= i; ipf_nearp:= inp; frontnumber:= 0; exit; end; + end; + for i:= 1 to tnfr do + begin + tfrontnpi:= tfr[i,0]; + for k:= 1 to tfrontnp do + begin + ip:= tfrontpt[k]; + with tpoint[ip] do if full then goto 10 else p0:= p; + for j:= 1 to tfrontnpi do + begin + ipj:= tfr[i,j]; + with tpoint[ipj] do + if abs(p0.x-p.x)0) + then begin ne_rest:= ne_rest-1; dw:= angle/(ne_rest+1); end; + if (ne_rest=0) and (dw>0.8) and (distance3d(pn1,pn2)>1.25*tstepl) then + begin ne_rest:= 1; dw:= dw/2; end; + p0:= p; nv0:= nv; tv10:= tv1; tv20:= tv2; + end; + if ((distance3d_square(p0,pn1)<0.2*tstepl_square) or + (distance3d_square(p0,pn2)<0.2*tstepl_square)) then ne_rest:=0; + if ne_rest=0 + then new_triangle(ip1,ip2,ip) + else + for i:= 1 to ne_rest do + begin + cdw:= cos(dw); sdw:= sin(dw); + rotorz(cdw,sdw,pn11, pn11); + lcomb3vt3d(1,p0,pn11.x,tv10,pn11.y,tv20, p_start); + tnp:= tnp +1; + if point_ok(p_start) + then begin tpoint[tnp].full:= false; pc_start:=p_start; end + else begin tpoint[tnp].full:= true; cut_seg(p0,p_start, pc_start); end; + with tpoint[tnp] do + begin + surface_point_normal_tangentvts(pc_start,f_gradf, p,nv,tv1,tv2); + if scalarp3d(nv,tpoint[ip].nv)<0 then {change if necessary (SING.)} + begin scale3d(-1,nv,nv); change3d(tv1,tv2); end; + achange:= true; + end; + if i=1 then new_triangle(ip1,tnp,ip); + if i=ne_rest then new_triangle(tnp,ip2,ip) + else new_triangle(tnp,tnp+1,ip); + end; { for } + delete_point(ipf); + for i:= 0 to ne_rest-1 do insert_point(tnp-i,ipf); + tpoint[ip1].achange:= true; tpoint[ip2].achange:= true; +end; +{********} + +procedure divide_front(ipf1,ipf2: integer); +var i,nn: integer; fa1,fa2: real; +begin + tnfr:= tnfr+1; + with tpoint[tfrontpt[ipf1]] do achange:= true; + with tpoint[tfrontpt[ipf2]] do achange:= true; + for i:= 0 to ipf2-ipf1 do tfr[tnfr,i+1]:= tfrontpt[ipf1+i]; + for i:=1 to tfrontnp-ipf2+1 do tfrontpt[ipf1+i]:= tfrontpt[ipf2+i-1]; + tfrontnp:= tfrontnp-(ipf2-ipf1-1); + tfr[tnfr,0]:= ipf2-ipf1+1; + fa1:= fangle(ipf1); fa2:= fangle(ipf1+1); + if fa1tfrontnpi then ipf:= ipf-tfrontnpi; + insert_point(tfr[frontnumber,ipf],ipf1+i); + end; + insert_point(tfrontpt[ipf1+1],ipf1+tfrontnpi+1); + insert_point(tfrontpt[ipf1],ipf1+tfrontnpi+2); + for i:= 0 to tfr[tnfr,0] do tfr[frontnumber,i]:= tfr[tnfr,i]; + tnfr:= tnfr-1; + with tpoint[tfrontpt[ipf1]] do + begin achange:= true; full:= false; end; + with tpoint[tfrontpt[ipf1+1]] do + begin achange:= true; full:= false; end; + fa1:= fangle(ipf1); fa2:= fangle(ipf1+1); + if fa1=0) and (tnf3) do + begin + if ((not nearpointtest) or (tfrontnp<10) or (minangle<1.5)) + then delay:= 1; + if delay=0 then find_pair_of_nearpts(ipf1,ipf2,frontnumber) + else begin delay:= delay-1; ipf2:= -1; end; + if ipf2>0 then + begin + ipi1:= tfrontpt[ipf1]; + if frontnumber=0 then ipi2:= tfrontpt[ipf2] + else ipi2:= tfr[frontnumber,ipf2]; + delay:= 0; + writeln('triangles: ',tnf,' NEARPOINTS detected: ',ipi1,' +++ ',ipi2); + if frontnumber=0 then divide_front(ipf1,ipf2); + if frontnumber>0 then unite_front(ipf1,ipf2,frontnumber); + end; + for i:= 1 to tfrontnp do make_angle(i); + ipf:= minanglept; + if ipf>0 then complete_point(ipf,f_gradf); + for i:= 1 to tfrontnp do make_angle(i); + ipf:= minanglept; {renews minangle for "if ....(minangle<..)" above !!} + fullcount:= 0; + for i:= 1 to tfrontnp do + with tpoint[tfrontpt[i]] do if full then fullcount:= fullcount+1; + end; { while } + + if tfrontnp=3 then + begin + new_triangle(tfrontpt[1],tfrontpt[2],tfrontpt[3]); + tfrontnp:= 0; + end; + if ((tfrontnp=0) or (fullcount=tfrontnp)) and (tnfr>0) then + begin + tfrontnp:= tfr[tnfr,0]; + for i:=1 to tfrontnp do + begin + tfrontpt[i]:= tfr[tnfr,i]; + with tpoint[tfrontpt[i]] do achange:= true; + end; + tnfr:= tnfr-1; fullcount:=0; writeln('tnfr: ',tnfr); + end; + end; { while } + writeln('*****************************************************'); + writeln('triang.: total number of triangels: ', tnf); + writeln('triang.: remaining front points: ', tfrontnp); + writeln('triang.: remaining fronts: ', tnfr); + writeln('*****************************************************'); + if tnf>tnfmax then writeln('triang. warning: tnfmax to small !!!'); + if tnp>tnpmax then writeln('triang. warning: tnpmax to small !!!'); + if tfrontnp>tfrnpmax then writeln('triang. warning: tfrnpmax to small !!!'); + if tnfr>tnfrmax then writeln('triang. warning: tnfrmax to small !!!'); +end; { triangulation } +{*************************************************************} + diff --git a/cdg0gv-2010/beispiele/triblend.pov b/cdg0gv-2010/beispiele/triblend.pov new file mode 100644 index 0000000..102f24d --- /dev/null +++ b/cdg0gv-2010/beispiele/triblend.pov @@ -0,0 +1,93 @@ +// Persistence Of Vision raytracer version 3.0 sample file. +// PolyWood.pov - Wooden polyhedron hollowed by a sphere +// on a grassy hilly lawn. Shows how easy it is to +// create interesting shapes with CSG operations +// and simple primitive shapes. +// File by Eduard [esp] Schwan + +#version 3.0 +global_settings { assumed_gamma 1.0 } + +#include "shapes.inc" +#include "colors.inc" +#include "textures.inc" + +// Moi +camera { + location <7, 2.5, -8.0> + direction <0.0, 0.0, 1.0> + up <0.0, 1.0, 0.0> + right <4/3, 0.0, 0.0> + look_at <0, 0, 0> +} + +// Some Light just above the horizon for a long shadow +light_source +{ + <20, 5, -60> + color White +} +light_source{<60, 5, -20> color White} + + +// The Cloudy Blue Sky +sphere +{ + <0, 0, 0>, 10000 + pigment + { + Bright_Blue_Sky + scale <4000, 600, 1000> + } +} + + +// The Hilly Grassy Land +plane +{ + y, -3 + pigment { color red 0.2 green 3.0 blue 0.4 } + finish + { + crand 0.025 // a little randomness to hide the rather severe color banding + ambient 0.1 + diffuse 0.7 + roughness 1 + } + normal { bumps 0.5 scale 10 } +} + +union{ + #include "triblend.pp" + rotate <-90, 15, 0> + translate <1, 0, 0> + pigment{color Green} + pigment { + wood + turbulence 0.04 + colour_map { + [0.0 0.4 color red 0.8 green 0.4 blue 0.2 + color red 0.8 green 0.4 blue 0.1] + [0.4 0.5 color red 0.1 green 0.3 blue 0.1 + color red 0.1 green 0.3 blue 0.2] + [0.5 0.8 color red 0.1 green 0.3 blue 0.2 + color red 0.8 green 0.4 blue 0.1] + [0.8 1.0 color red 0.8 green 0.4 blue 0.1 + color red 0.8 green 0.4 blue 0.2] + } + scale <0.2, 0.2, 1> + rotate <45, 0, 5> + translate <2, 2, -4> + } + finish { + // make it look wood-like + ambient 0.15 + diffuse 0.6 + // make it a little bit shiny + specular 0.3 roughness 0.01 + phong 0.3 phong_size 60 + } +} + + +// ttfn! diff --git a/cdg0gv-2010/beispiele/triblend_off.p b/cdg0gv-2010/beispiele/triblend_off.p new file mode 100644 index 0000000..4089f8b --- /dev/null +++ b/cdg0gv-2010/beispiele/triblend_off.p @@ -0,0 +1,186 @@ +program triexample; +uses geograph,hiddenl; + +type funct2d = function(x,y: real) : real; + funct2d2d = procedure(x,y: real; var gx,gy: real); + funct3d = function(p: vt3d) : real; + funct3d3d = procedure(p: vt3d; var g: vt3d); + funct2d3d = procedure(u,v: real; var p: vt3d); + funct1d3d = procedure(u: real; var p: vt3d); + psurface_tangents = procedure(u,v: real; var su,sv: vt3d); + implicit3d = procedure(p: vt3d; var fvalue: real; var gradf: vt3d); + +{var f_gradf: implicit3d;} +{--------------------------} +{for triangulation:} +const tnfmax=15000; tnemax=30000; tnpmax=15000; + tfrnpmax= 500; {max. number of points in a front} + tnfrmax=20; {max. number of additional fronts.} +{--------------------------} +var i,ipro,ianf : integer; + oriented_faces : boolean; + mue,dw,r_sph : real; + p1 : vt3d; + +{****************} +{$i triang_proc.p} +{****************} + +{###################################################################} +{**** auxiliary procs for generating OFFfiles used for GEOMVIEW ***} +{*******************************************************************} + +{*****} +var offdatei : text; +{*****} + +procedure open_offdatei; +{ for OFF-file } + var datei : string; + begin + writeln('name of OFF-File ? (... .off)'); + readln(datei); + assign(offdatei,datei); + rewrite(offdatei); + end; { open_offdatei } +{*************} + +procedure close_offdatei; + begin + Close(offdatei); + end; +{************} + +procedure write_nangles_to_offfile; +var i,k : integer; +begin + open_offdatei; + writeln(offdatei, 'OFF'); + writeln(offdatei,np,' ',nf,' ',0); + for i:= 1 to np do with p[i] do + writeln(offdatei,' ',x:3:5,' ',y:3:5,' ',z:3:5); + for i:= 1 to nf do + with face[i] do + begin + write(offdatei,npf,' '); + for k:= 1 to npf do write(offdatei,fp[k]-1,' '); + writeln(offdatei,' '); + end; + close_offdatei; +end; { write_nangles_to_offdatei } +{#####################################################################} + +procedure f_gradf_blend3cy(p: vt3d; var f: real; var gradf: vt3d); +{Blending 3 cylinders by parabol. funct. splines} +var c1,c2,c3,fk: real; +begin + with p do + begin + c1:= y*y+z*z-1; c2:= x*x+z*z-1; c3:= x*x+y*y-1; + fk:= 1+sqr(r_sph) - x*x - y*y - z*z; + f:= (1-mue)*c1*c2*c3-mue*fk*fk*fk; + gradf.x:= (1-mue)*2*x*c1*(c3 + c2) + 6*mue*x*fk*fk; + gradf.y:= (1-mue)*2*y*c2*(c3 + c1) + 6*mue*y*fk*fk; + gradf.z:= (1-mue)*2*z*c3*(c1 + c2) + 6*mue*z*fk*fk; + end; +end; +{******} +{*************************************************************} +begin {main program} + graph_on(0); + repeat + writeln('****************************************************'); + writeln('*** Triangulation of an implicit surface *** '); + writeln('*** (blending of 3 cylinders) *** '); + writeln('****************************************************'); + writeln; + writeln(' and generation of a OFF-file for GEOMVIEW '); + writeln('****************************************************'); + writeln; + +{------------------------------------} +{for triangulation:} + cuttype:=0; {box} + {cuttype=1: cylinder, needs xcut,ycut,rcut_square (see proc. cut...)} + {cuttype=2: sphere, needs xcut,ycut,zcut,rcut_square ( " )} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + np:=0; nf:= 0; ne:= 0; + + writeln('Number of triangles ?'); readln(n_triang); + writeln; + +{------------------------------------------------------------------------} + +{Tringulation of a blend surface of 3 cylinders with bounding box} + f_gradf:= f_gradf_blend3cy; mue:= 0.0003; r_sph:= 3; + put3d(1,1,-1, p1); + dw:= pi2/30; tstepl:= dw; {radii= 1 !!} + xmin:= -3; xmax:= 3; + ymin:= -3; ymax:= 3; + zmin:= -3; zmax:= 3; + tnp:= 0; tnf:= 0; tnfr:= 0; + start_triangulation(p1,f_gradf); + +{triangulation:} + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + +{--------------------------------------------------------------------} + repeat + init_centralparallel_projection(2); + +{drawing : } + draw_area(250,250,120,120,25); + +{hiddenline:} + oriented_faces:= false; + cp_lines_before_convex_faces(oriented_faces,true,false); + + draw_end; writeln ; + + writeln('Another projection? (yes: 1, no: 0)'); + readln(ipro); + until ipro=0; + + writeln('Run again ? (yes: 1, no: 0)'); + readln(ianf); + until ianf=0; + +{generates offfile for GEOMVIEW:} + write_nangles_to_offfile; + + graph_off; + end. + + + + + + + + + + + + + diff --git a/cdg0gv-2010/beispiele/triblend_pov.p b/cdg0gv-2010/beispiele/triblend_pov.p new file mode 100644 index 0000000..06681be --- /dev/null +++ b/cdg0gv-2010/beispiele/triblend_pov.p @@ -0,0 +1,196 @@ +program triexample; +uses geograph,hiddenl; + +type funct2d = function(x,y: real) : real; + funct2d2d = procedure(x,y: real; var gx,gy: real); + funct3d = function(p: vt3d) : real; + funct3d3d = procedure(p: vt3d; var g: vt3d); + funct2d3d = procedure(u,v: real; var p: vt3d); + funct1d3d = procedure(u: real; var p: vt3d); + psurface_tangents = procedure(u,v: real; var su,sv: vt3d); + implicit3d = procedure(p: vt3d; var fvalue: real; var gradf: vt3d); + +{var f_gradf: implicit3d;} +{--------------------------} +{for triangulation:} +const tnfmax=15000; tnemax=30000; tnpmax=15000; + tfrnpmax= 500; {max. number of points in a front} + tnfrmax=20; {max. number of additional fronts.} +{--------------------------} +var i,ipro,ianf : integer; + oriented_faces : boolean; + mue,dw,r_sph : real; + p1 : vt3d; + +{****************} +{$i triang_proc.p} +{****************} + +{****************************************************************} +{**** auxiliary proc. for generating ppfiles used for POVRAY ***} +{****************************************************************} + +var ppfile : text; +{*******} +procedure open_ppfile; +{ for ppfile } + var datei : string; + begin + writeln('name of ppfile ? (... .pp)'); + readln(datei); + assign(ppfile,datei); + rewrite(ppfile); + end; { open_ppfile } +{*************} +procedure close_ppdatei; + begin + Close(ppfile); + end; +{************} +procedure write_s3angles_to_ppfile(n1,n2: integer); +var i : integer; +begin + open_ppfile; + for i:= n1 to n2 do + begin + writeln(ppfile, 'smooth_triangle{'); + with tface[i] do + begin + with tpoint[p1] do + begin + with p do + write(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>,'); + with nv do + writeln(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>,'); + end; + with tpoint[p2] do + begin + with p do + write(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>,'); + with nv do + writeln(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>,'); + end; + with tpoint[p3] do + begin + with p do + write(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>,'); + with nv do + writeln(ppfile,'<',x:3:5,', ',y:3:5,', ',z:3:5,'>'); + end; + writeln(ppfile,'}'); + end; { with } + end; { for } + close_ppdatei; +end; { write_3angles_to_ppfile } +{***********} + +{************************************************************} +procedure f_gradf_blend3cy(p: vt3d; var f: real; var gradf: vt3d); +{Blending 3 cylinders by parabol. funct. splines} +var c1,c2,c3,fk: real; +begin + with p do + begin + c1:= y*y+z*z-1; c2:= x*x+z*z-1; c3:= x*x+y*y-1; + fk:= 1+sqr(r_sph) - x*x - y*y - z*z; + f:= (1-mue)*c1*c2*c3-mue*fk*fk*fk; + gradf.x:= (1-mue)*2*x*c1*(c3 + c2) + 6*mue*x*fk*fk; + gradf.y:= (1-mue)*2*y*c2*(c3 + c1) + 6*mue*y*fk*fk; + gradf.z:= (1-mue)*2*z*c3*(c1 + c2) + 6*mue*z*fk*fk; + end; +end; +{******} +{*************************************************************} +begin {main program} + graph_on(0); + repeat + writeln('****************************************************'); + writeln('*** Triangulation of implicit surfaces *** '); + writeln('****************************************************'); + writeln; + writeln(' and generation of a PP-file for POVRAY (ray tracer) '); + writeln('****************************************************'); + writeln; + +{------------------------------------} +{for triangulation:} + cuttype:=0; {box} + {cuttype=1: cylinder, needs xcut,ycut,rcut_square (see proc. cut...)} + {cuttype=2: sphere, needs xcut,ycut,zcut,rcut_square ( " )} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + np:=0; nf:= 0; ne:= 0; + + writeln('Number of triangles ?'); readln(n_triang); + writeln; + +{------------------------------------------------------------------------} + +{Tringulation of a blend surface of 3 cylinders with bounding box} + f_gradf:= f_gradf_blend3cy; mue:= 0.0003; r_sph:= 3; + put3d(1,1,-1, p1); + dw:= pi2/30; tstepl:= dw; {radii= 1 !!} + xmin:= -3; xmax:= 3; + ymin:= -3; ymax:= 3; + zmin:= -3; zmax:= 3; + tnp:= 0; tnf:= 0; tnfr:= 0; + start_triangulation(p1,f_gradf); + +{triangulation:} + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + +{--------------------------------------------------------------------} + repeat + init_centralparallel_projection(2); + +{drawing : } + draw_area(250,250,120,120,25); + +{hiddenline:} + oriented_faces:= false; + cp_lines_before_convex_faces(oriented_faces,true,false); + + draw_end; writeln ; + + writeln('Another projection? (yes: 1, no: 0)'); + readln(ipro); + until ipro=0; + + writeln('Run again ? (yes: 1, no: 0)'); + readln(ianf); + until ianf=0; + +{generates ppfile for POVRAY:} + write_s3angles_to_ppfile(1,tnf); + + graph_off; + end. + + + + + + + + + diff --git a/cdg0gv-2010/beispiele/trisample.p b/cdg0gv-2010/beispiele/trisample.p new file mode 100644 index 0000000..e7c1600 --- /dev/null +++ b/cdg0gv-2010/beispiele/trisample.p @@ -0,0 +1,342 @@ +program trisample; +uses geograph,hiddenl; + +type funct2d = function(x,y: real) : real; + funct2d2d = procedure(x,y: real; var gx,gy: real); + funct3d = function(p: vt3d) : real; + funct3d3d = procedure(p: vt3d; var g: vt3d); + funct2d3d = procedure(u,v: real; var p: vt3d); + funct1d3d = procedure(u: real; var p: vt3d); + psurface_tangents = procedure(u,v: real; var su,sv: vt3d); + implicit3d = procedure(p: vt3d; var fvalue: real; var gradf: vt3d); + +{var f_gradf: implicit3d;} +{--------------------------} +{for triangulation:} +const tnfmax=15000; tnemax=30000; tnpmax=15000; + tfrnpmax= 500; {max. number of points in a front} + tnfrmax=20; {max. number of additional fronts.} +{--------------------------} +var i,k,ipro,ianf,n1,n2,ik,ne0 : integer; + u1,u2,v1,v2,du,dv,u,v : real; + oriented_faces : boolean; + x1,y1,r1,x2,y2,r2,x3,y3,r3,dw,r_tor,a_tor : real; + p1 : vt3d; +{****************} +{$i triang_proc.p} +{****************} +{************************************************************} + +procedure f_gradf_c1(p: vt3d; var f: real; var gradf: vt3d); +{1. cylinder} +begin + with p do + begin + f:= sqr(x-x1)+sqr(y-y1) -r1*r1; + gradf.x:= 2*(x-x1); + gradf.y:= 2*(y-y1); + gradf.z:= 0; + end; +end; +{******} + +procedure f_gradf_c2(p: vt3d; var f: real; var gradf: vt3d); +{2. cylinder} +begin + with p do + begin + f:= sqr(x-x2)+sqr(y-y2) -r2*r2; + gradf.x:= 2*(x-x2); + gradf.y:= 2*(y-y2); + gradf.z:= 0; + end; +end; +{******} +procedure f_gradf_sph4(p: vt3d; var f: real; var gradf: vt3d); +begin + with p do + begin + f:= x*x*x*x+y*y*y*y+z*z*z*z - 16; + gradf.x:= 4*x*x*x; + gradf.y:= 4*y*y*y; + gradf.z:= 4*z*z*z; + end; +end; +{******} +procedure f_gradf_tor(p: vt3d; var f: real; var gradf: vt3d); +{torus } +var c1,c2: real; +begin + c1:= sqr(r_tor); + with p do + begin + c2:= x*x+y*y +z*z + c1 - sqr(a_tor); + f:= c2*c2 - 4*c1*(x*x+y*y); + gradf.x:= 4*x*c2 - 8*c1*x; + gradf.y:= 4*y*c2 - 8*c1*y; + gradf.z:= 4*z*c2; + end; +end; +{******} +{*************************************************************} +begin {main program} + graph_on(0); + repeat + writeln('*********************************************'); + writeln(' *** Triangulation of implicit surfaces *** '); + writeln('*********************************************'); + writeln; + writeln(' example: 3 cylinders and a quartic sphere '); + writeln('*********************************************'); + writeln; +{------------------------------------} +{for hiddenline:} + for i:= 1 to nemax do + with edge[i] do begin color:=black; linew:=1; end; +{------------------------------------} +{for triangulation:} + cuttype:=0; {box} + {cuttype=1: cylinder, needs xcut,ycut,rcut_square (see proc. cut...)} + {cuttype=2: sphere, needs xcut,ycut,zcut,rcut_square ( " )} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + np:=0; nf:= 0; ne:= 0; ne0:= 0; + + writeln('Number of triangles ?'); readln(n_triang); + writeln; + +{------------------------------------------------------------------------} + +{1. cylinder: with start hexagon} + f_gradf:= f_gradf_c1; + x1:= -2; y1:= -5; r1:= 2; + put3d(0,-3,1, p1); + tstepl:= 0.4; + xmin:= -10; xmax:= 10; + ymin:= -10; ymax:= 10; + zmin:= -2; zmax:= 5; + tnp:= 0; tnf:= 0; tnfr:= 0; + start_triangulation(p1,f_gradf); + +{triangulation: } + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + for i:= ne0+1 to ne do + with edge[i] do begin color:=black; linew:=1; end; + ne0:= ne; +{--------------------------------} + +{2. cylinder: with start POLYGON (circle)} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + x2:= -5; y2:=0; r2:= 2; + f_gradf:= f_gradf_c2; + xmin:= -10; xmax:= 10; + ymin:= -10; ymax:= 10; + zmin:= -10; zmax:= 10; + tfrontnp:= 30; tnp:= tfrontnp; dw:= pi2/tfrontnp; tstepl:= r2*pi2/tfrontnp; + for i:= 1 to tfrontnp do {front polygon: circle on the top} + begin + with tpoint[i] do + begin + put3d(x2+r2*cos((i-1)*dw),y2+r2*sin((i-1)*dw),5, p1); + surface_point_normal_tangentvts(p1,f_gradf, p,nv,tv1,tv2); + full:= false; achange:= true; + end; { with } + tfrontpt[i]:= i; + end; { for } + dw:= -dw; + for i:= 1 to tfrontnp do {bounding polygon: circle on the bottom} + begin + with tpoint[tnp+i] do + begin + put3d(x2+r2*cos((i-1)*dw),y2+r2*sin((i-1)*dw),-2, p1); + surface_point_normal_tangentvts(p1,f_gradf, p,nv,tv1,tv2); + full:= false; achange:= true; + end; { with } + tfr[1,i]:= tnp+i ; + end; { for } + tfr[1,0]:= tfrontnp; tnp:= tnp+tnp; + tnfr:= 1; + +{triangulation:} + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + for i:= ne0+1 to ne do + with edge[i] do begin color:=red; linew:=3; end; + ne0:= ne; +{-------------------------------------------------------} + +{3. quartic sphere x^4+y^4+z^4-16=0: with start hexagon} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + f_gradf:= f_gradf_sph4; + put3d(0,0,1, p1); + tstepl:= 0.3; + xmin:= -3; xmax:= 3; + ymin:= -3; ymax:= 3; + zmin:= -3; zmax:= 3; + tnp:= 0; tnf:= 0; tnfr:= 0; + start_triangulation(p1,f_gradf); + +{triangulation: } + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + for i:= ne0+1 to ne do + with edge[i] do begin color:=blue; linew:=1; end; + ne0:= ne; + +{--------------------------------} + +{4.torus: with start hexagon} + for i:= 1 to tnpmax do tpoint[i].full:= false; + tnp:= 0; tnf:= 0; tnfr:= 0; + f_gradf:= f_gradf_tor; r_tor:= 8.5; a_tor:= 1; +{ cuttype:= 1; xcut:= 0; ycut:= 0; rcut_square:= sqr(r_tor);} + put3d(0,6,0, p1); + tstepl:= 0.45; + xmin:= -10; xmax:= 10; + ymin:= -10; ymax:= 10; + zmin:= -3; zmax:= 3; + start_triangulation(p1,f_gradf); + +{triangulation: } + nearpointtest:= true; + triangulation(nearpointtest); + + writeln('tfrontnp: ',tfrontnp,' fullcount: ',fullcount,' tnf: ', + tnf,' n_triang: ',n_triang); + writeln; + writeln('tnp: ',tnp,' tnf: ',tnf); + writeln; + +{tri --> hiddenl.:} + for i:= 1 to tnp do p[np+i]:= tpoint[i].p; + for i:= 1 to tnf do + with face[nf+i] do + begin + npf:= 3; + with tface[i] do + begin fp[1]:= np+p1; fp[2]:= np+p2; fp[3]:= np+p3; end; + end; + np:=np+tnp; nf:= nf+tnf; + aux_polyhedron; + writeln('np: ',np); writeln('nf: ',nf); writeln('ne: ',ne); + for i:= ne0+1 to ne do + with edge[i] do begin color:=green; linew:=1; end; + ne0:= ne; + +{--------------------------------} + +{5. cylinder: with QUADRANGLES} + x3:= -2; y3:= 5; r3:= 2; + n1:= 40; n2:= 10; + u1:= 0; u2:= pi2; + v1:=-2; v2:= 5; + du:= (u2-u1)/n1; dv:= (v2-v1)/(n2-1); + v:= v1; + for k:= 1 to n2 do + begin + u:= u1; + for i:= 1 to n1 do + begin + ik:=i + (k-1)*n1; + put3d(x3+r3*cos(u),y3+r3*sin(u),v, p[np+ik]); + u:= u+du; + end; + v:= v+dv; + end; + aux_cylinder(n1,n2,np,ne,nf); + for i:= ne0+1 to ne do + with edge[i] do begin color:=cyan; linew:=1; end; + ne0:= ne; + +{--------------------------------------------------------------------} + repeat + init_centralparallel_projection(2); + +{ for drawing : } + draw_area(250,250,120,120,10); + +{hiddenline:} + oriented_faces:= false; is_permitted:= true; newstyles:= true; + cp_lines_before_convex_faces(oriented_faces,is_permitted,newstyles); + + draw_end; writeln ; + + writeln('Another projection? (yes: 1, no: 0)'); + readln(ipro); + until ipro=0; + + writeln('Run again ? (yes: 1, no: 0)'); + readln(ianf); + until ianf=0; + + graph_off; + end. + + + + + + + + + diff --git a/cdg0gv-2010/include/geoconst.pas b/cdg0gv-2010/include/geoconst.pas new file mode 100644 index 0000000..7ca624a --- /dev/null +++ b/cdg0gv-2010/include/geoconst.pas @@ -0,0 +1,9 @@ +{geoconst.pas:} + array_size = 10000; { < array_size in driver/g_const.h !!!!} + pi= 3.14159265358; pi2= 6.2831853; pih= 1.5707963; + eps1=0.1; eps2=0.01; eps3=0.001; eps4=0.0001; + eps5=0.00001; eps6=0.000001; eps7=0.0000001; eps8=0.00000001; + default=-1; black=0; blue=1; green=2; cyan=3; red=4; magenta=5; brown=6; + lightgray=7; darkgray=8; lightblue=9; lightgreen=10; lightcyan=11; + lightred=12; lightmagenta=13; yellow=14; white=15; + diff --git a/cdg0gv-2010/include/geoproc.pas b/cdg0gv-2010/include/geoproc.pas new file mode 100644 index 0000000..e7da9c7 --- /dev/null +++ b/cdg0gv-2010/include/geoproc.pas @@ -0,0 +1,232 @@ +{##############################} +{ geoproc.pas for FREE-PASCAL } +{##############################} + +const + GeoPLDcommand : Boolean = false; + GeoPLDinteraktiv : Boolean = false; + GeoBild : Boolean = true; + GeoMono : Boolean = false; + +var + GeoPLDFilename : string; + GeoEpsFilename : string; + +{*****************************************************} +{*** A: For Generation of a PLD-file ***} +{*****************************************************} +{ i include/geoinit.pas} +{$i pld.pas} +{$i postscr.pas} + +{***********************************************************************} + {*** B: for the generation of an EPS-file of the drawing and ....***} +{***********************************************************************} + +procedure graph_on(mode : integer); +begin + null2d.x:= 0; null2d.y:= 0; + null3d.x:= 0; null3d.y:= 0; null3d.z:= 0; +(* if GeoBild then + begin + GeoEpsFilename:= 'geodummy.eps'; + ps_graph_on(GeoEpsFilename, true); + end; *) + GeoPLDinteraktiv := (mode <> 0); + plot_it := GeoPLDinteraktiv or GeoPLDcommand; + if plot_it then plot_init; +end; { graph_on } +{*************} + +procedure draw_area(width,height,x0,y0,sfac : real); +{.... and opens geodummy.eps} +begin + if plot_it then plot_area(width, height); + scalefactor:= sfac; + origin2d.x:=x0; origin2d.y:=y0; + if scalefactor<>1 then writeln('scalefactor is:',scalefactor:3:2); + if GeoBild then + begin + GeoEpsFilename:= 'geodummy.eps'; + ps_graph_on(GeoEpsFilename, true); + ps_draw_area(width,height,x0,y0, true); + end; + end; { draw_area} +{*************} + +procedure draw_end; +{closes the eps-file and displays it} +var s : longint; +begin + if plot_it then plot_end; + if GeoBild then + begin + ps_draw_end; + writeln('###: show drawing (with gv):'); + writeln('###: (continue after quitting gv)'); + s:=fpsystem('gv geodummy.eps'); +{ writeln('shell beendet mit: ',s);} + end; +end; { draw_end } +{*************} + +procedure graph_off; +begin + if GeoBild then + begin + ps_graph_off; + end; +end; {graph_off} +{**************} + +procedure new_color(color: integer); +begin + if not GeoMono then + begin + if plot_it then plot_new_color(color); + if color = default then color := black; + if GeoBild then + begin + ps_new_color(color); + end; + end; +end; { new_color } +{**************} + +procedure new_linewidth(factor: real); +const + default = 3.0; +begin + if plot_it then plot_new_linewidth(factor); + if GeoBild then + begin + ps_new_linewidth(factor); + end; +end; + +procedure linec2d(x1,y1,x2,y2 : real; style : integer); +{draws the line (x1,y1)(x2,y2)} +begin + x1 := x1*scalefactor; + x2 := x2*scalefactor; + y1 := y1*scalefactor; + y2 := y2*scalefactor; + if style > 3 then style := 0; + if plot_it then plot_linec2d(x1,y1, x2,y2,style); + if GeoBild then + begin + ps_linec2d(x1,y1,x2,y2, style); + end; +end; {linec2d} +{*************} + +procedure line2d(p1,p2 : vt2d; style : integer); +begin + linec2d(p1.x,p1.y,p2.x,p2.y,style); +end; {line2d} +{*************} + +procedure pointc2d(x,y : real; style : integer); +{draws a point} +begin + x:= x*scalefactor; + y:= y*scalefactor; + if plot_it then plot_pointc2d(x,y,style); + if GeoBild then + begin + ps_pointc2d(x,y,style); + end; +end; { pointc2d } +{*************} + +procedure point2d(p : vt2d; style: integer); +begin + pointc2d(p.x,p.y,style); +end; {point2d} +{**************} + +procedure curve2d(var p: vts2d; n1,n2,style : integer); +{draws the polyline (x(n1),y(n1))... (x(n2),y(n2))} +var + i : integer; + pp : vts2d; +begin + for i:= n1 to n2 do + begin + pp[i].x := p[i].x * scalefactor; + pp[i].y := p[i].y * scalefactor; + end; + if style > 3 then style := 0; + if plot_it then plot_curve2d(pp,n1,n2,style); + if GeoBild then + begin + ps_curve2d(pp,n1,n2,style); + end; +end; {curve2d} +{*************} + +procedure curve2d_vis(var p: vts2d; n1,n2,style: integer; visible: b_array ); +{neighbored "visible" points are connected. + if style=10: "invisible" lines are dashed. } + var i,i1 : integer; + vis : boolean; + begin + + i1 := n1; + i := i1; + vis := visible[i1]; + + repeat + i := i+1; + if (i>n2) or (vis <> visible[i]) then + begin + if vis then curve2d(p,i1,i-1,style) + else if style=10 then curve2d(p,i1,i-1,1); + i1 := i; + vis := visible[i]; + end; + until i>n2; + + end; { curve2d_vis } +{*************} + +procedure arrowc2d(x1,y1,x2,y2 : real; style : integer); +{draws an arrow} + var x21,y21,x3,y3,x4,y4,d,sl,sb,sld,sbd : real; + begin + x21:= x2-x1; y21:= y2-y1; + d:= sqrt(x21*x21+y21*y21); + sl:= 3/scalefactor; {Laenge der Spitze} + sb:= 1/scalefactor; {Breite ..} + if d>=sl then {Pfeilspitze} + begin + sld:= sl/d; sbd:= sb/d; + x3:= x2-sld*x21-sbd*y21 ; y3:= y2-sld*y21+sbd*x21 ; + x4:= x2-sld*x21+sbd*y21 ; y4:= y2-sld*y21-sbd*x21 ; + linec2d(x2,y2,x3,y3,0) ; linec2d(x2,y2,x4,y4,0) ; + end; + linec2d(x1,y1,x2,y2,style); + end; { arrowc2d } +{**************} + +procedure arrow2d(p1,p2 : vt2d; style : integer); + begin + arrowc2d(p1.x,p1.y,p2.x,p2.y,style); + end; { arrow2d } +{**********************************************************************} + +procedure read_integer_file(file_name: string; n_dat: integer; + var int_var: i_array); +var text_var : text; + i : integer; +begin + assign(text_var,file_name); + reset(text_var); + for i:= 1 to n_dat do read(text_var, int_var[i]); + close(text_var); +end; { read_integer_file } +{***********} + + + + diff --git a/cdg0gv-2010/include/geotype.pas b/cdg0gv-2010/include/geotype.pas new file mode 100644 index 0000000..feb842a --- /dev/null +++ b/cdg0gv-2010/include/geotype.pas @@ -0,0 +1,10 @@ +{geotype.pas:} + + r_array = array [0..array_size] of real; + i_array = array [0..array_size] of integer; + b_array = array [0..array_size] of boolean; + vt2d = record x: real; y: real; end; + vt3d = record x: real; y: real; z: real; end; + vts2d = array[0..array_size] of vt2d; + vts3d = array[0..array_size] of vt3d; + matrix3d= array[1..3,1..3] of real; diff --git a/cdg0gv-2010/include/geovar.pas b/cdg0gv-2010/include/geovar.pas new file mode 100644 index 0000000..4062e9c --- /dev/null +++ b/cdg0gv-2010/include/geovar.pas @@ -0,0 +1,19 @@ + {geovar.pas:} + + null2d : vt2d; null3d : vt3d; {Nullvektoren} + scalefactor: real; + + {**fuer area_2d and curve2d:} + origin2d : vt2d; + + {**fuer Parallel- und Zentral-Projektion:} + u_angle,v_angle, {Projektionswinkel} + rad_u,rad_v, {rad(u), rad(v)} + sin_u,cos_u,sin_v,cos_v : real; {sin-,cos- Werte von u, v} + e1vt,e2vt,n0vt : vt3d; {Basis-Vektoren} + {Normalen-Vektor der Bildebene} + {**fuer Zentral-Projektion:} + mainpt, {Hauptpunkt} + centre : vt3d; {Zentrum} + distance : real; {Distanz Hauptpunkt-Zentrum} + diff --git a/cdg0gv-2010/include/head_ag.pas b/cdg0gv-2010/include/head_ag.pas new file mode 100644 index 0000000..8e4ee93 --- /dev/null +++ b/cdg0gv-2010/include/head_ag.pas @@ -0,0 +1,75 @@ +{**********************************************} +{********* H E A D _ A G *********************} +{*** Prozedur-Koepfe der Datei proc_ag.pas ***} +{**********************************************} + +function sign(a: real) : integer; +function max(a,b : real) : real; +function min(a,b : real) : real; +procedure change1d(var a,b: real); +procedure change2d(var v1,v2: vt2d); +procedure change3d(var v1,v2: vt3d); +procedure put2d(x,y : real; var v: vt2d); +procedure put3d(x,y,z : real; var v: vt3d); +procedure get3d(v : vt3d; var x,y,z: real); +procedure scale2d(r : real; v: vt2d; var vs: vt2d); +procedure scale3d(r : real; v: vt3d; var vs: vt3d); +procedure scaleco2d(r1,r2 : real; v: vt2d; var vs: vt2d); +procedure scaleco3d(r1,r2,r3 : real; v: vt3d; var vs: vt3d); +procedure sum2d(v1,v2 : vt2d; var vs : vt2d); +procedure sum3d(v1,v2 : vt3d; var vs : vt3d); +procedure diff2d(v1,v2 : vt2d; var vs : vt2d); +procedure diff3d(v1,v2 : vt3d; var vs : vt3d); +procedure lcomb2vt2d(r1: real; v1: vt2d; r2: real; v2: vt2d; var vlc : vt2d); +procedure lcomb2vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; var vlc : vt3d); +procedure lcomb3vt2d(r1: real; v1: vt2d; r2: real; v2: vt2d; + r3: real; v3: vt2d; var vlc : vt2d); +procedure lcomb3vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; + r3: real; v3: vt3d; var vlc : vt3d); +procedure lcomb4vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; + r3: real; v3: vt3d; r4: real; v4: vt3d; var vlc : vt3d); +function abs2d(v : vt2d) : real; +function abs3d(v : vt3d) : real; +function length2d(v : vt2d) : real; +function length3d(v : vt3d) : real; +function scalarp2d(p1,p2 : vt2d) : real; +function scalarp3d(p1,p2 : vt3d) : real; +procedure normalize2d(var p: vt2d); +procedure normalize3d(var p: vt3d); +function distance2d(p,q : vt2d): real; +function distance3d(p,q : vt3d): real; +function distance2d_square(p,q : vt2d) : real; +function distance3d_square(p,q : vt3d) : real; +procedure vectorp(v1,v2 : vt3d; var vp : vt3d); +function determ3d(v1,v2,v3: vt3d) : real; +procedure rotor2d(cos_rota,sin_rota : real; p : vt2d; var pr: vt2d); +procedure rotp02d(cos_rota,sin_rota : real; p0,p : vt2d; var pr: vt2d); +procedure rotorz(cos_rota,sin_rota : real; p : vt3d; var pr: vt3d); +procedure rotp0z(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); +procedure rotp0x(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); +procedure rotp0y(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); +function polar_angle(x,y : real) : real; +procedure equation_degree1(a,b :real; var x : real ; var ns : integer); +procedure equation_degree2(a,b,c:real; var x1,x2:real ;var ns:integer); +procedure is_line_line(a1,b1,c1, a2,b2,c2 : real; var xs,ys : real; + var nis : integer); +procedure is_unitcircle_line(a,b,c: real; var x1,y1,x2,y2 : real; + var nis : integer); +procedure is_circle_line(xm,ym,r, a,b,c: real; var x1,y1,x2,y2 : real; + var nis : integer); +procedure is_circle_circle(xm1,ym1,r1,xm2,ym2,r2: real; + var x1,y1,x2,y2: real; var nis: integer); +function pt_before_plane(p,nv: vt3d; d: real) : boolean; +procedure plane_equ(p1,p2,p3 : vt3d; var nv : vt3d; var d: real; + var error : boolean); +procedure is_line_plane(p,rv,nv: vt3d; d : real; var pis : vt3d; + var nis : integer); +procedure is_3_planes(nv1: vt3d; d1: real; nv2: vt3d; d2: real; + nv3: vt3d; d3: real; + var pis : vt3d; var error: boolean); +procedure is_plane_plane(nv1: vt3d; d1: real; nv2: vt3d; d2: real; + var p,rv : vt3d; var error: boolean); +procedure ptco_plane3d(p0,v1,v2,p: vt3d; var xi,eta: real; var error: boolean); +procedure newcoordinates3d(p,b0,b1,b2,b3: vt3d; var pnew: vt3d); + + diff --git a/cdg0gv-2010/include/head_geo.pas b/cdg0gv-2010/include/head_geo.pas new file mode 100644 index 0000000..b3a693e --- /dev/null +++ b/cdg0gv-2010/include/head_geo.pas @@ -0,0 +1,21 @@ +{***************************} +{*** H E A D _ G E O ***} +{***************************} + +(*procedure GeoInit;*) +procedure graph_on(mode : integer); +procedure draw_area(width,height,x0,y0,sfac : real); +procedure draw_end; +procedure graph_off; +procedure new_color(color: integer); +procedure new_linewidth(factor :real); +procedure linec2d(x1,y1,x2,y2 : real; style : integer); +procedure line2d(p1,p2 : vt2d; style : integer); +procedure pointc2d(x,y : real; style : integer); +procedure point2d(p : vt2d; style: integer); +procedure curve2d(var p: vts2d; n1,n2,style : integer); +procedure curve2d_vis(var p: vts2d; n1,n2,style: integer; visible: b_array ); +procedure arrowc2d(x1,y1,x2,y2 : real; style : integer); +procedure arrow2d(p1,p2 : vt2d; style : integer); +procedure read_integer_file(file_name: string; n_dat: integer; + var int_var: i_array); diff --git a/cdg0gv-2010/include/head_pp.pas b/cdg0gv-2010/include/head_pp.pas new file mode 100644 index 0000000..45202da --- /dev/null +++ b/cdg0gv-2010/include/head_pp.pas @@ -0,0 +1,17 @@ +{***********************} +{*** H E A D _ P P ***} +{***********************} + +procedure init_parallel_projection; +procedure pp_vt3d_vt2d(p : vt3d; var pp: vt2d); +procedure pp_point(p: vt3d; style: integer); +procedure pp_line(p1,p2 : vt3d ; style : integer); +procedure pp_arrow(p1,p2 : vt3d; style : integer); +procedure pp_axes(al : real); +procedure pp_vts3d_vts2d(var p: vts3d; n1,n2 : integer; var pp : vts2d); +procedure pp_curve(var p: vts3d; n1,n2,style : integer); +procedure pp_curve_vis(var p : vts3d; n1,n2,style : integer; visible: b_array ); +procedure pp_line_before_plane(p1,p2,nv: vt3d; d : real; side,style: integer); +procedure pp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; d: real; + side,style : integer); + diff --git a/cdg0gv-2010/include/head_zp.pas b/cdg0gv-2010/include/head_zp.pas new file mode 100644 index 0000000..847cccb --- /dev/null +++ b/cdg0gv-2010/include/head_zp.pas @@ -0,0 +1,48 @@ +{*******************************} +{***** H E A D _ Z P *****} +{***** Zentralprojektion *****} +{***** OHNE Clipping *****} +{*******************************} + +procedure init_central_projection; +{**************} + +procedure init_centralparallel_projection(ind : integer); +{**************} + +procedure transf_to_e1e2n0_base(p : vt3d; var pm : vt3d); +{***************} + +procedure cp_vt3d_vt2d(p: vt3d; var pp : vt2d); +{**************} + +procedure cp_point(p: vt3d; style: integer); +{*************} + +procedure cp_line(p1,p2 : vt3d ; style : integer); +{*************} + +procedure cp_arrow(p1,p2 : vt3d; style : integer); +{*************} + +procedure cp_axes(al : real); +{*************} + +procedure cp_vts3d_vts2d(var p: vts3d; n1,n2 : integer; var pp : vts2d); +{*************} + +procedure cp_curve(var p: vts3d; n1,n2,style : integer); +{*************} + + + procedure cp_curve_vis(var p : vts3d; n1,n2,style : integer; visible: b_array ); +{*************} + +procedure cp_line_before_plane(p1,p2,nv: vt3d; d : real; side,style: integer); +{**************} + +procedure cp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; d: real; + side,style : integer); +{*************} + + diff --git a/cdg0gv-2010/include/head_zpo.pas b/cdg0gv-2010/include/head_zpo.pas new file mode 100644 index 0000000..88a09eb --- /dev/null +++ b/cdg0gv-2010/include/head_zpo.pas @@ -0,0 +1,27 @@ +{*****************} +{*** HEAD_ZPO ***} +{*****************} + +procedure aux_polyhedron; +procedure cp_vts3d_vts2d_spez(var p: vts3d; n1,n2: integer; + var pp: vts2d; var pdist: r_array); +procedure aux_quadrangle(n1,n2,np0,ne0,nf0: integer); +procedure aux_quadrangle_triang(n1,n2: integer; + show_triangles: boolean); +procedure aux_cylinder(n1,n2,np0,ne0,nf0: integer); +procedure aux_torus(n1,n2,np0,ne0,nf0: integer); +procedure is_line_convex_polygon(p1,p2 : vt2d; p_pol : vts2d_pol; np : integer; + var t1,t2 : real; var ind : integer); +procedure intmint(a,b,c,d: real; var e1,f1,e2,f2: real; var ind: integer); +procedure cp_lines_before_convex_faces(oriented_faces,is_permitted,newstyles : boolean); +procedure is_interv_interv(var a,b,c,d,aa,bb : real; var inters: boolean); +procedure box3d_of_pts(var p : vts3d_pol; np: integer; var box : box3d_dat); +function is_two_boxes3d(var box1,box2 : box3d_dat) : boolean; +procedure is_line_conv_pol_in_plane3d(var pl,rl: vt3d; var pp : vts3d_pol; + npp : integer; + var t1,t2 : real; var inters : boolean); +procedure is_n1gon_n2gon3d(var pp1,pp2: vts3d_pol; np1,np2: integer; + var ps1,ps2 : vt3d; var intersection : boolean); +procedure boxes_of_faces; +procedure is_face_face(i,k: integer; var ps1,ps2 : vt3d; + var intersection: boolean); diff --git a/cdg0gv-2010/include/pld.pas b/cdg0gv-2010/include/pld.pas new file mode 100644 index 0000000..a767220 --- /dev/null +++ b/cdg0gv-2010/include/pld.pas @@ -0,0 +1,99 @@ +{pld.pas} + +{******************************************************} +{*** A: Procedures for the generation of a PLD-file ***} +{******************************************************} + +const + pt_per_mm : real = 10.0; + pld_ver = 'Ver1.0'; + +var + plotdatei : text; + plot_it : boolean; + +procedure plot_init; + var i : integer; + begin + writeln('*************************************************************'); + writeln('** A PLD-file (point-line-description) will be generated ****'); + writeln('*************************************************************'); + writeln; + writeln; + end; { plot_init } + +{*************} + +procedure plot_area(width,height: real); +{ for PLD-file } + var datei : string; + begin + if GeoPLDinteraktiv then begin + writeln('name of PLD-file ? (... .pld)'); + readln(datei); + end; + if GeoPLDcommand then datei:=GeoPLDFilename; + assign(plotdatei,datei); + rewrite(plotdatei); + writeln(plotdatei,pld_ver); + Write(plotdatei,width:10:3,' ',height:10:3,' '); + end; { plot_area } +{*************} + +procedure plot_end; + begin + Write(plotdatei,'*'); + Close(plotdatei); + end; +{*************} + +procedure plot_linec2d(x1,y1,x2,y2 : real; style : integer); +{draws the line (x1,y1)(x2,y2)} + var px1,py1,px2,py2 : longint; + begin + px1:=round((x1+origin2d.x)*pt_per_mm); + py1:=round((y1+origin2d.y)*pt_per_mm); + px2:=round((x2+origin2d.x)*pt_per_mm); + py2:=round((y2+origin2d.y)*pt_per_mm); + if style > 3 then style := 0; + Write(plotdatei,'L ',px1,' ',py1,' ',px2,' ',py2,' ',style,' '); + end; { plot_linec2d } +{*************} + +procedure plot_curve2d(var p: vts2d; n1,n2,style : integer); +{draws the polyline (x(n1),y(n1))... (x(n2),y(n2))} +var + i : integer; + px1,py1 : longint; +begin + if style > 3 then style := 0; + Write(plotdatei,'K ',n2-n1+1,' ',style,' '); + for i := n1 to n2 do + begin + px1:=round((p[i].x+origin2d.x)*pt_per_mm); + py1:=round((p[i].y+origin2d.y)*pt_per_mm); + Write(plotdatei,px1,' ',py1,' '); + end; +end; {plot_curve2d} +{*************} + +procedure plot_pointc2d(x,y : real; style : integer); +{draws a points} + var ix,iy : longint; + begin + ix:=round((x+origin2d.x)*pt_per_mm); + iy:=round((y+origin2d.y)*pt_per_mm); + Write(plotdatei, 'P ',ix,' ',iy,' ',style,' ') + end; { plot_pointc2d} +{*************} + +procedure plot_new_color(color:integer); +begin + Writeln(plotdatei, 'C',color) + end; { plot_new_color} +{*************} + +procedure plot_new_linewidth(factor : real); +begin + Writeln(plotdatei, 'W', round(factor*10)); +end; diff --git a/cdg0gv-2010/include/postscr.pas b/cdg0gv-2010/include/postscr.pas new file mode 100644 index 0000000..92d5c7a --- /dev/null +++ b/cdg0gv-2010/include/postscr.pas @@ -0,0 +1,228 @@ +{postscr.pas:} + +const + ps_style : Integer = 99; + +var + psfile : text; + + +procedure ps_set_style(style :integer); +begin + if (style <> ps_style) then + begin + Case style of + 0 : writeln(psfile,'[] 0 setdash'); + 1 : writeln(psfile,'[2 1.5] 0 setdash'); + 3 : writeln(psfile,'[.2 1.5] 0 setdash'); + 2 : writeln(psfile,'[3 1 .2 1] 0 setdash'); + end; + ps_style := style; + end; +end; + + +procedure ps_graph_on(fname:string;eps:boolean); +begin + assign(psfile,fname); + rewrite(psfile); + if not eps then + begin + writeln(psfile, '%!PS-Adobe-2.0 PSF-2.0'); + writeln(psfile, '%%Creator: pldv'); + writeln(psfile, '/Rahmen{newpath'); + writeln(psfile, 'wx neg wy neg moveto '); + writeln(psfile, '0 hoehe rlineto '); + writeln(psfile, 'breite 0 rlineto '); + writeln(psfile, '0 hoehe neg rlineto '); + writeln(psfile, 'closepath '); + writeln(psfile, '/lw currentlinewidth def '); + writeln(psfile, '0 setlinewidth '); + writeln(psfile, 'stroke '); + writeln(psfile, 'lw setlinewidth '); + writeln(psfile, 'wx neg wy neg 5 sub moveto '); + writeln(psfile, 'titel show '); +(* writeln(psfile, '/seite seite 1 add def '); + writeln(psfile, 'wx 20 sub wy 5 add neg moveto '); + writeln(psfile, '(Seite ) show '); + writeln(psfile, 'seite str cvs ');*) + writeln(psfile, 'str show '); + writeln(psfile, '}def '); + writeln(psfile, '/titel (',fname ,') def'); + end else {EPS} + begin + writeln(psfile, '%!PS-Adobe-2.0 EPSF-2.0'); + writeln(psfile, '%%Creator: pldv'); + end; + ps_style := 99; +end; + +procedure ps_graph_off; +begin +end; + +procedure ps_draw_end; +begin + writeln(psfile,'grestore'); + writeln(psfile,'showpage'); + close(psfile); +end; + + +procedure ps_draw_area(world_width,world_height,x,y:real;eps:boolean); +const + f=2.8346; +begin + if eps then begin + writeln(psfile,'%%BoundingBox: ', + trunc(-x*f) ,' ', + trunc(-y*f) ,' ', + round((-x+world_width)*f),' ', + round((-y+world_height)*f) ); + writeln(psfile,'%%EndComments'); + end; + writeln(psfile, 'gsave '); + writeln(psfile, '2.8346 2.8346 scale '); + if not eps then writeln(psfile, '90 rotate '); + writeln(psfile, '0.15 setlinewidth '); + writeln(psfile, '1 setlinejoin '); + writeln(psfile); + if not eps then + begin + writeln(psfile, '/Times-Roman findfont 5 scalefont setfont '); + writeln(psfile, '/seite 0 def '); + writeln(psfile, '/str 3 string def '); + writeln(psfile, '/breite ',world_width:8:2,' def' ); + writeln(psfile, '/hoehe ',world_height:8:2,' def' ); + writeln(psfile, '/wx ',x:8:2, ' def'); + writeln(psfile, '/wy ',y:8:2, ' def'); + writeln(psfile,'17 wx add -9 hoehe sub wy add translate'); + writeln(psfile,'Rahmen'); + end; + writeln(psfile); +end; + +procedure ps_newpage; +begin + writeln(psfile,'gsave'); + writeln(psfile,'showpage'); + writeln(psfile,'grestore'); + writeln(psfile,'Rahmen'); writeln(psfile); +end; + +procedure ps_new_color(color:integer); +begin + if color= default then color := black; + if color= black then writeln(psfile,'0 0 0 setrgbcolor'); + if color= blue then writeln(psfile,'0 0 .8 setrgbcolor'); + if color= green then writeln(psfile,'0 .8 0 setrgbcolor'); + if color= cyan then writeln(psfile,'0 .8 .8 setrgbcolor'); + if color= red then writeln(psfile,'.8 0 0 setrgbcolor'); + if color= magenta then writeln(psfile,'.8 0 .8 setrgbcolor'); + if color= brown then writeln(psfile,'.65 .16 .16 setrgbcolor'); + if color= lightgray then writeln(psfile,'.8 .8 .8 setrgbcolor'); + if color= darkgray then writeln(psfile,'.6 .6 .6 setrgbcolor'); + if color= lightblue then writeln(psfile,'0 0 1 setrgbcolor'); + if color= lightgreen then writeln(psfile,'0 1 0 setrgbcolor'); + if color= lightcyan then writeln(psfile,'0 1 1 setrgbcolor'); + if color= lightred then writeln(psfile,'1 0 0 setrgbcolor'); + if color= lightmagenta then writeln(psfile,'1 0 1 setrgbcolor'); + if color= yellow then writeln(psfile,'1 1 0 setrgbcolor'); + if color= white then writeln(psfile,'1 1 1 setrgbcolor'); +end; + +procedure ps_set_linewidth( width : real); +begin + writeln(psfile,width:8:2,' setlinewidth'); +end; + +procedure ps_new_linewidth(factor : real); +const + default = 0.15; +begin + ps_set_linewidth(default*factor); +end; + + +procedure ps_linec2d( x1,y1,x2,y2: real; style:integer); +begin + ps_set_style(style); + writeln(psfile,x1:8:2,' ',y1:8:2,' moveto'); + writeln(psfile,x2:8:2,' ',y2:8:2,' lineto'); + writeln(psfile,'stroke'); +end; + +procedure ps_pointc2d(x,y :real; marker:integer); +begin + writeln(psfile,'/lw currentlinewidth def'); +(* writeln(psfile,'0 setlinewidth');*) + writeln(psfile,'[] 0 setdash'); + + (* if marker > 3 then marker := 3; *) + Case marker of + 100 {PIXEL}, + 3 {DOT} : begin + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y:8:2,' .2 0 360 arc'); + writeln(psfile, 'fill'); + end; + 1 {PLUS} : begin + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y+1:8:2,' moveto'); + writeln(psfile,' 0 -2 rlineto'); + writeln(psfile,'-1 1 rmoveto'); + writeln(psfile,' 2 0 rlineto'); + writeln(psfile,'stroke'); + end; + 10 {SMALLPLUS} : begin +(* + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y+1:8:2,' moveto'); + writeln(psfile,' 0 -1 rlineto'); + writeln(psfile,'-0.5 0.5 rmoveto'); + writeln(psfile,' 1 0 rlineto'); + writeln(psfile,'stroke'); +*) + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y:8:2,' .5 0 360 arc'); + writeln(psfile, 'fill'); + end; + 50 {BIGPIXEL} : begin + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y:8:2,' .35 0 360 arc'); + writeln(psfile, 'fill'); + end; + 2 {CROSS} : begin + writeln(psfile, 'newpath'); + writeln(psfile, x+0.707:8:2,' ',y+0.707:8:2,' moveto'); + writeln(psfile, '-1.414 -1.414 rlineto'); + writeln(psfile, '1.414 0 rmoveto'); + writeln(psfile, '-1.414 1.414 rlineto'); + writeln(psfile, 'stroke'); + end; + 0 {circle} : begin + writeln(psfile, 'newpath'); + writeln(psfile, x:8:2,' ',y:8:2,' .8 0 360 arc'); + writeln(psfile, 'stroke'); + end; + end; + writeln(psfile,'lw setlinewidth'); + ps_style := 0; +end; + +procedure ps_curve2d(var p:vts2d; n1,n2,style:integer); +var + i : integer; +begin + ps_set_style(style); + writeln(psfile, 'newpath'); + writeln(psfile, p[n1].x:8:2,' ',p[n1].y:8:2,' moveto'); + writeln(psfile, '['); + for i:=n1+1 to n2 do + writeln(psfile,' [', p[i].x:8:2,' ',p[i].y:8:2, ']'); + writeln(psfile, ']'); + writeln(psfile,'{aload pop lineto} forall'); + writeln(psfile,'stroke'); +end; + + diff --git a/cdg0gv-2010/include/proc_ag.pas b/cdg0gv-2010/include/proc_ag.pas new file mode 100644 index 0000000..623bd7f --- /dev/null +++ b/cdg0gv-2010/include/proc_ag.pas @@ -0,0 +1,424 @@ +{*********************************} +{********* P R O C _ A G *******} +{*********************************} + +function sign(a : real) : integer; + begin if a<0 then sign:= -1 else sign:= 1; end; {sign} +{*************} +function max(a,b : real) : real; + begin if a>=b then max:= a else max:= b; end; {max} +{*************} +function min(a,b : real) : real; + begin if a<=b then min:= a else min:= b; end; {min} +{*************} + +procedure put2d(x,y : real; var v: vt2d); + begin v.x:= x; v.y:= y; end; +{*************} +procedure put3d(x,y,z : real; var v: vt3d); + begin v.x:= x; v.y:= y; v.z:= z; end; +{*************} + +procedure get3d(v : vt3d; var x,y,z: real); + begin x:= v.x; y:= v.y; z:= v.z; end; +{*************} + +procedure scale2d(r : real; v: vt2d; var vs: vt2d); + begin vs.x:= r*v.x; vs.y:= r*v.y; end; +{*************} +procedure scale3d(r : real; v: vt3d; var vs: vt3d); + begin vs.x:= r*v.x; vs.y:= r*v.y; vs.z:= r*v.z; end; +{*************} + +procedure scaleco2d(r1,r2 : real; v: vt2d; var vs: vt2d); + begin vs.x:= r1*v.x; vs.y:= r2*v.y; end; +{*************} +procedure scaleco3d(r1,r2,r3 : real; v: vt3d; var vs: vt3d); + begin vs.x:= r1*v.x; vs.y:= r2*v.y; vs.z:= r3*v.z; end; +{*************} + + +procedure sum2d(v1,v2 : vt2d; var vs : vt2d); + begin vs.x:= v1.x + v2.x; vs.y:= v1.y + v2.y; end; +{*************} +procedure sum3d(v1,v2 : vt3d; var vs : vt3d); + begin vs.x:= v1.x + v2.x; vs.y:= v1.y + v2.y; vs.z:= v1.z + v2.z; end; +{*************} + +procedure diff2d(v1,v2 : vt2d; var vs : vt2d); + begin vs.x:= v1.x - v2.x; vs.y:= v1.y - v2.y; end; +{*************} +procedure diff3d(v1,v2 : vt3d; var vs : vt3d); + begin vs.x:= v1.x - v2.x; vs.y:= v1.y - v2.y; vs.z:= v1.z - v2.z; end; +{*************} + +procedure lcomb2vt2d(r1: real; v1: vt2d; r2: real; v2: vt2d; var vlc : vt2d); + begin vlc.x:= r1*v1.x + r2*v2.x; vlc.y:= r1*v1.y + r2*v2.y; end; +{*************} +procedure lcomb2vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; var vlc : vt3d); + begin + vlc.x:= r1*v1.x + r2*v2.x; vlc.y:= r1*v1.y + r2*v2.y; vlc.z:= r1*v1.z + r2*v2.z; + end; +{*************} + +procedure lcomb3vt2d(r1: real; v1: vt2d; r2: real; v2: vt2d; + r3: real; v3: vt2d; var vlc : vt2d); + begin + vlc.x:= r1*v1.x + r2*v2.x + r3*v3.x; + vlc.y:= r1*v1.y + r2*v2.y + r3*v3.y; + end; +{*************} +procedure lcomb3vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; + r3: real; v3: vt3d; var vlc : vt3d); + begin + vlc.x:= r1*v1.x + r2*v2.x + r3*v3.x; + vlc.y:= r1*v1.y + r2*v2.y + r3*v3.y; + vlc.z:= r1*v1.z + r2*v2.z + r3*v3.z; + end; +{*************} + +procedure lcomb4vt3d(r1: real; v1: vt3d; r2: real; v2: vt3d; + r3: real; v3: vt3d; r4: real; v4: vt3d; var vlc : vt3d); + begin + vlc.x:= r1*v1.x + r2*v2.x + r3*v3.x + r4*v4.x; + vlc.y:= r1*v1.y + r2*v2.y + r3*v3.y + r4*v4.y; + vlc.z:= r1*v1.z + r2*v2.z + r3*v3.z + r4*v4.z; + end; +{*************} + +function abs2d(v : vt2d) : real; + begin abs2d:= abs(v.x) + abs(v.y); end; +{*************} +function abs3d(v : vt3d) : real; + begin abs3d:= abs(v.x) + abs(v.y) + abs(v.z); end; +{*************} + +function length2d(v : vt2d) : real; + begin length2d:= sqrt( sqr(v.x) + sqr(v.y) ); end; +{*************} +function length3d(v : vt3d) : real; + begin length3d:= sqrt( sqr(v.x) + sqr(v.y) + sqr(v.z)); end; +{*************} + +procedure normalize2d(var p: vt2d); +var c : real; +begin c:= 1/length2d(p); p.x:= c*p.x; p.y:= c*p.y; end; +{************} +procedure normalize3d(var p: vt3d); +var c : real; +begin c:= 1/length3d(p); p.x:= c*p.x; p.y:= c*p.y; p.z:= c*p.z end; +{************} + +function scalarp2d(p1,p2 : vt2d) : real; + begin scalarp2d:= p1.x*p2.x + p1.y*p2.y; end; +{*************} +function scalarp3d(p1,p2 : vt3d) : real; + begin scalarp3d:= p1.x*p2.x + p1.y*p2.y + p1.z*p2.z; end; +{*************} + +function distance2d(p,q : vt2d): real; +begin distance2d:= sqrt( sqr(p.x-q.x) + sqr(p.y-q.y) ); end; +{*************} +function distance3d(p,q : vt3d): real; +begin distance3d:= sqrt( sqr(p.x-q.x) + sqr(p.y-q.y) + sqr(p.z-q.z) ); end; +{*************} +function distance2d_square(p,q : vt2d) : real; +begin distance2d_square:= sqr(p.x-q.x) + sqr(p.y-q.y); end; +{**************} +function distance3d_square(p,q : vt3d) : real; +begin distance3d_square:= sqr(p.x-q.x) + sqr(p.y-q.y) + sqr(p.z-q.z); end; +{**************} + +procedure vectorp(v1,v2 : vt3d; var vp : vt3d); +{Berechnet das Kreuzprodukt von (x1,y1,z1) und (x2,y2,z2). } + begin + vp.x:= v1.y*v2.z - v1.z*v2.y ; + vp.y:= -v1.x*v2.z + v2.x*v1.z ; + vp.z:= v1.x*v2.y - v2.x*v1.y ; + end; {vectorp} +{*************} + +function determ3d(v1,v2,v3: vt3d) : real; +{Berechnet die Determinante einer 3x3-Matrix.} + begin + determ3d:= v1.x*v2.y*v3.z + v1.y*v2.z*v3.x + v1.z*v2.x*v3.y + - v1.z*v2.y*v3.x - v1.x*v2.z*v3.y - v1.y*v2.x*v3.z; + end; {determ3d} +{*************} + +procedure rotor2d(cos_rota,sin_rota : real; p : vt2d; var pr: vt2d); + begin + pr.x:= p.x*cos_rota - p.y*sin_rota; + pr.y:= p.x*sin_rota + p.y*cos_rota; + end; {rotor2d} +{*************} + +procedure rotp02d(cos_rota,sin_rota : real; p0,p : vt2d; var pr: vt2d); + begin + pr.x:= p0.x + (p.x-p0.x)*cos_rota - (p.y-p0.y)*sin_rota; + pr.y:= p0.y + (p.x-p0.x)*sin_rota + (p.y-p0.y)*cos_rota; + end; {rotor2d} +{*************} + +procedure rotorz(cos_rota,sin_rota : real; p : vt3d; var pr: vt3d); + begin + pr.x:= p.x*cos_rota - p.y*sin_rota; + pr.y:= p.x*sin_rota + p.y*cos_rota; pr.z:= p.z; + end; {rotorz} +{*************} +procedure rotp0z(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); + begin + pr.x:= p0.x + (p.x-p0.x)*cos_rota - (p.y-p0.y)*sin_rota; + pr.y:= p0.y + (p.x-p0.x)*sin_rota + (p.y-p0.y)*cos_rota; pr.z:= p.z; + end; {rotp0z} +{*************} +procedure rotp0x(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); +{Rotation um eine zur x-Achse parallele Achse durch p0} + begin + pr.y:= p0.y + (p.y-p0.y)*cos_rota - (p.z-p0.z)*sin_rota; + pr.z:= p0.z + (p.y-p0.y)*sin_rota + (p.z-p0.z)*cos_rota; pr.x:= p.x; + end; {rotp0x} +{*************} +procedure rotp0y(cos_rota,sin_rota : real; p0,p: vt3d; var pr: vt3d); +{Rotation um eine zur y-Achse parallele Achse durch p0} + begin + pr.x:= p0.x + (p.x-p0.x)*cos_rota - (p.z-p0.z)*sin_rota; + pr.z:= p0.z + (p.x-p0.x)*sin_rota + (p.z-p0.z)*cos_rota; pr.y:= p.y; + end; {rotp0y} +{*************} + +procedure change1d(var a,b: real); +var aa: real; +begin aa:= a; a:= b; b:= aa; end; +{*********} +procedure change2d(var v1,v2: vt2d); +var vv: vt2d; +begin vv:= v1; v1:= v2; v2:= vv; end; +{**********} +procedure change3d(var v1,v2: vt3d); +var vv: vt3d; +begin vv:= v1; v1:= v2; v2:= vv; end; +{**********} + +{polar_angles fuer altes p2c: (SUSE 6.4)} +function polar_angle(x,y : real) : real; + var w : real; + begin + if (x=0) and (y=0) then w:= 0 + else + begin + if abs(y)<=abs(x) then + begin + w:= arctan(y/x); + if x<0 then w:=pi+w + else if (y<0) and( w<>0) then w:= pi2+w; + end + else + begin + w:= pih-arctan(x/y); + if y<0 then w:= pi+w; + end; {if} + end; {if} + polar_angle:= w; + end; { polar_angle } +{******************} + +procedure equation_degree1(a,b :real; var x : real ; var ns : integer); + {Gleichung 1.Grades: a*x + b = 0 } + begin + if abs(a)=0 {-eps6*abs(b)) then dis:=0; + if dis<0 then ns:= 0 + else + begin + if abs(dis)=0} + end; {a<>0} +{Umordnen nach Groesse:} + if ns=2 then if x2=0 then + begin + nis:= 2; + wu:= sqrt(dis); if abs(wu)=0 then + begin + nis:= 2; + wu:= sqrt(dis); if abs(wu)=0 then pt_before_plane:= true + else pt_before_plane:= false; end; +{*************} + +procedure plane_equ(p1,p2,p3 : vt3d; var nv : vt3d; var d: real; + var error : boolean); +{Berechnet die Gleichung nv*x=d der Ebene durch die Punkte p1,p2,p3. + error=true: die Punkte spannen keine Ebene auf.} + var p21,p31 : vt3d; + begin + diff3d(p2,p1,p21); diff3d(p3,p1,p31); + vectorp(p21,p31,nv); d:= scalarp3d(nv,p1); + if abs3d(nv)= 0 ist und strichelt den Rest, falls style = 10 ist. } + var dis1,dis2,t : real; p3 : vt3d; + begin + dis1:= scalarp3d(nv,p1) - d; dis2:= scalarp3d(nv,p2) - d; + if side<0 then begin dis1:= -dis1; dis2:= -dis2; end; + if (dis1>=0) and (dis2>=0) then pp_line(p1,p2,0) + else + if (dis1<0) and (dis2<0) then + begin + if style=10 then pp_line(p1,p2,1); + end + else + begin + t := -dis1/(dis2-dis1); + lcomb2vt3d(1-t,p1, t,p2, p3); {Schnittpunkt} + if dis1>=0 then {p1 vor der Ebene} + begin + pp_line(p1,p3,0); + if style=10 then pp_line(p3,p2,1); + end + else + begin + pp_line(p3,p2,0); + if style=10 then pp_line(p1,p3,1); + end; + end; + end; { pp_line_before_plane } +{**************} + +procedure pp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; + d: real; side,style : integer); + {Projiziert eine Kurve (Polygonzug) "vor" der Ebene nv*x = d und strichelt + den Rest, falls style=10 .} + var i,k,nis : integer; nvv,p_i,p_i1,rvt,pis : vt3d; visi,visi1 : boolean; + pp : vts3d; vis : b_array; dd : real; + begin + if side<0 then begin scale3d(-1,nv,nvv); dd:= -d; end + else begin nvv:= nv; dd:= d; end; + k:= n1-1; + for i:= n1 to n2 do + begin + p_i:= p[i]; k:= k+1; + if scalarp3d(p_i,nvv)-dd >= 0 then visi:= true + else visi:= false; + pp[k]:= p_i; vis[k]:= visi; + if (i>n1) and (visi<>visi1) then + begin + diff3d(p_i,p_i1, rvt); + is_line_plane(p_i1,rvt, nvv,dd, pis,nis); + k:= k+1; pp[k]:= pis; vis[k]:= true; + end; + p_i1:= p_i; visi1:= visi; + end; { for i } + pp_curve_vis(pp,n1,k,style,vis); + end; { pp_curve_before_plane } +{*************} +(* + +procedure pp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; d: real; + side,style : integer); +{Projiziert eine Kurve (Polygonzug) "vor" der Ebene nv*x = d und strichelt + den Rest, falls style=10 .} + var i : integer; + begin + for i:= n1 to n2-1 do + pp_line_before_plane(p[i],p[i+1],nv,d,side,style); + end; { pp_curve_before_plane } +{*************} + +procedure pp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; + d: real; side,style : integer); + {Projiziert eine Kurve (Polygonzug) "vor" der Ebene nv*x = d und strichelt + den Rest, falls style=10 .} + var i : integer; nvv : vt3d; pp1,pp2 : vt2d; + vis1,vis2 : boolean; dd : real; + begin + if side<0 then begin scale3d(-1,nv,nvv); dd:= -d; end + else begin nvv:= nv; dd:= d; end; + for i:= n1 to n2 do + begin + if scalarp3d(p[i],nvv)-dd >= 0 then + begin + vis2:=true; pp_vt3d_vt2d(p[i],pp2); + end + else + begin + vis2:= false; if style=10 then pp_vt3d_vt2d(p[i],pp2); + end; + if i>n1 then + begin + if vis1 and vis2 then line2d(pp1,pp2,style); + if (style=10) and (not vis1) and (not vis2) then line2d(pp1,pp2,1); + if (vis1 and not vis2) or (not vis1 and vis2) + then pp_line_before_plane(p[i-1],p[i],nv,d,side,style); + end; + pp1:= pp2; vis1:= vis2; + end; + end; { pp_curve_before_plane } +{*************} + +*) diff --git a/cdg0gv-2010/include/proc_zp.pas b/cdg0gv-2010/include/proc_zp.pas new file mode 100644 index 0000000..a82f53e --- /dev/null +++ b/cdg0gv-2010/include/proc_zp.pas @@ -0,0 +1,171 @@ +{*******************************} +{***** P R O C _ C P *****} +{***** Zentralprojektion *****} +{*******************************} + +procedure init_central_projection; + begin + writeln('*** CENTRAL-PROJECTION ***'); + writeln; + writeln('mainpoint ?'); readln(mainpt.x,mainpt.y,mainpt.z); + writeln('distance ?'); readln(distance); + writeln('angles u, v ? (in degree)'); readln(u_angle,v_angle); + rad_u:= u_angle*pi/180; rad_v:= v_angle*pi/180; + sin_u:= sin(rad_u); cos_u:= cos(rad_u); + sin_v:= sin(rad_v); cos_v:= cos(rad_v); +{base e1,e2 and normal n0 of image plane:} + e1vt.x:= -sin_u; e1vt.y:= cos_u; e1vt.z:= 0; + e2vt.x:= -cos_u*sin_v; e2vt.y:=-sin_u*sin_v; e2vt.z:= cos_v; + n0vt.x:= cos_u*cos_v; n0vt.y:= sin_u*cos_v; n0vt.z:= sin_v; +{centre:} + lcomb2vt3d(1,mainpt, distance,n0vt, centre); + end; { init_central_projection } +{**************} + +procedure init_centralparallel_projection(ind : integer); + begin + if ind=1 then + begin + writeln('*** CENTRAL-projection ***'); + writeln('mainpoint ?'); readln(mainpt.x,mainpt.y,mainpt.z); + writeln('distance ?'); readln(distance); + end + else + begin + writeln('*** PARALLEL-projection ***'); + mainpt:= null3d; distance:= 1000000000; + end; + writeln('angles u, v ? (in degree)'); readln(u_angle,v_angle); + rad_u:= u_angle*pi/180; rad_v:= v_angle*pi/180; + sin_u:= sin(rad_u); cos_u:= cos(rad_u); + sin_v:= sin(rad_v); cos_v:= cos(rad_v); +{base e1,e2 and normal n0 of image plane:} + e1vt.x:= -sin_u; e1vt.y:= cos_u; e1vt.z:= 0; + e2vt.x:= -cos_u*sin_v; e2vt.y:=-sin_u*sin_v; e2vt.z:= cos_v; + n0vt.x:= cos_u*cos_v; n0vt.y:= sin_u*cos_v; n0vt.z:= sin_v; +{centre:} + lcomb2vt3d(1,mainpt, distance,n0vt, centre); + end; { init_centralparallel_projection } +{**************} + +procedure transf_to_e1e2n0_base(p : vt3d; var pm : vt3d); +{coordinates in system "mainpoint, e1,e2,n0".} + var pd : vt3d; + begin + diff3d(p,mainpt, pd); + pm.x:= scalarp3d(pd,e1vt); + pm.y:= scalarp3d(pd,e2vt); + pm.z:= scalarp3d(pd,n0vt); + end; { transf_to_e1e2n0_base } +{***************} + +procedure cp_vt3d_vt2d(p: vt3d; var pp : vt2d); +{central projetion (coordinates) of a point} + var xe,ye,ze,cc : real; pm : vt3d; + begin + diff3d(p,mainpt, pm); + xe:= scalarp3d(pm,e1vt); { coordinates von p in system: } + ye:= scalarp3d(pm,e2vt); { origin = mainpoint } + ze:= scalarp3d(pm,n0vt); { and base vectors e1,e2,n0 } + cc:= 1-ze/distance; + if cc>eps6 then begin pp.x:= xe/cc; pp.y:= ye/cc; end { projection } + else + writeln('central proj.: point not in front of vanishing plane !!'); + end; { cp_vt3d_vt2d } +{**************} + +procedure cp_point(p: vt3d; style: integer); + var pp : vt2d; + begin + cp_vt3d_vt2d(p,pp); point2d(pp,style); + end; { cp_point } +{**************} + +procedure cp_line(p1,p2 : vt3d ; style : integer); + var pp1,pp2 : vt2d; + begin + cp_vt3d_vt2d(p1,pp1); cp_vt3d_vt2d(p2,pp2); line2d(pp1,pp2,style); + end; {cp_line} +{**************} + +procedure cp_arrow(p1,p2 : vt3d; style : integer); + var pp1,pp2: vt2d; + begin + cp_vt3d_vt2d(p1,pp1); cp_vt3d_vt2d(p2,pp2); arrow2d(pp1,pp2,style); + end; { cp_arrow } +{**************} + +procedure cp_axes(al : real); + var p0,p1,p2,p3 : vt3d; + begin + put3d(0,0,0,p0); put3d(al,0,0,p1); + put3d(0,al,0,p2); put3d(0,0,al,p3); + cp_arrow(p0,p1, 2); cp_arrow(p0,p2, 2); cp_arrow(p0,p3, 2); + end; { cp_axes } +{**************} + +procedure cp_vts3d_vts2d(var p: vts3d; n1,n2 : integer; var pp : vts2d); + var i : integer; + begin + for i:= n1 to n2 do cp_vt3d_vt2d(p[i],pp[i]); + end; { cp_vts3d_vts2d } +{*************} + +procedure cp_curve(var p: vts3d; n1,n2,style : integer); + var pp : vts2d; + begin + cp_vts3d_vts2d(p,n1,n2,pp); curve2d(pp,n1,n2,style); + end; { cp_curve } +{*************} + +procedure cp_curve_vis(var p : vts3d; n1,n2,style : integer; visible: b_array ); +{connects neighbored visible points.} + var pp : vts2d; + begin + cp_vts3d_vts2d(p,n1,n2,pp); curve2d_vis(pp,n1,n2,style,visible); + end; { cp_curve_vis } +{*************} + +procedure cp_line_before_plane(p1,p2,nv: vt3d; d : real; side,style: integer); +{style=0: draws visible part of the line p1p2 (visible: side*(nv*x - d) >= 0). + Dash-dots the invisible part if style = 10 .} +var dis1,dis2,t : real; p3 : vt3d; + begin + dis1:= scalarp3d(nv,p1) - d; dis2:= scalarp3d(nv,p2) - d; + if side<0 then begin dis1:= -dis1; dis2:= -dis2; end; + if (dis1>=0) and (dis2>=0) then cp_line(p1,p2,0) + else + if (dis1<0) and (dis2<0) then + begin + if style=10 then cp_line(p1,p2,1); + end + else + begin + t := -dis1/(dis2-dis1); + lcomb2vt3d(1-t,p1, t,p2, p3); {Schnittpunkt} + if dis1>=0 then {p1 vor der Ebene} + begin + cp_line(p1,p3,0); + if style=10 then cp_line(p3,p2,1); + end + else + begin + cp_line(p3,p2,0); + if style=10 then cp_line(p1,p3,1); + end; + end; + end; { cp_line_before_plane } +{**************} + +procedure cp_curve_before_plane(var p: vts3d ; n1,n2: integer; nv: vt3d; d: real; + side,style : integer); +{see cp_line_before_plane} + var i : integer; + begin + for i:= n1 to n2-1 do + cp_line_before_plane(p[i],p[i+1],nv,d,side,style); + end; { cp_curve_before_plane } +{*************} + + + diff --git a/cdg0gv-2010/include/proc_zpo.pas b/cdg0gv-2010/include/proc_zpo.pas new file mode 100644 index 0000000..4b38888 --- /dev/null +++ b/cdg0gv-2010/include/proc_zpo.pas @@ -0,0 +1,668 @@ +{*****************} +{*** PROC_ZPO ***} +{*****************} + +procedure aux_polyhedron; +{ne, nf : Anzahl der Punkte,Kanten,Flaechen + face[i].npf : Anzahl der Punkte (Kanten) der i-ten Flaeche + edge.ep1, ep2 : Anfangs- bzw. Endpunkt der k-ten Kante + face[i].fp[k] : k-ter Punkt der i-ten Flaeche (positiv orientiert!!!) + face[i].fe[k] : k-te Kante der i-ten Flaeche + ! Dieses UP berechnet aus nf,face[i].fp und face[i].npf: + ne, face[i].fe[k], edge[i].ep1 und edge[i].ep2 !.} + type sedge = record p1,p2,nr: integer; end; + sedges = array[1..nemax] of sedge; + var i,k,i1,i2,i_edge : integer; + new_edge : sedge; + sorted_edges: sedges; + new_is_old,error: boolean; +{***} +procedure search_insert_edge(var sorted_edges: sedges; new_edge: sedge; + var i_edge: integer; var new_is_old: boolean); +{Prueft, ob new_edge in sorted_edges enthalten ist und fuegt new_edge + gegebenenfalls ein.} +var found: boolean; left,right,middle: integer; i : integer; +{**} +function edge1_smaller_edge2(var edge1,edge2 : sedge) : boolean; +begin + if (edge1.p1right); + if found then begin i_edge:= middle; new_is_old:= true; end + else + begin + new_is_old:= false; if left>middle then middle:= middle+1; + for i:= ne downto middle do sorted_edges[i+1]:= sorted_edges[i]; + sorted_edges[middle]:= new_edge; + sorted_edges[middle].nr:= ne+1; + end; { if } +end; { search_insert_edge } +{***} + begin { aux_polyhedron } + ne:= 0; + for i:= 1 to nf do + with face[i] do + begin + i1:= fp[1]; + for k:= 1 to npf do + begin + if kp2 then begin p1:= i2; p2:= i1; end; + search_insert_edge(sorted_edges,new_edge, i_edge,new_is_old); + if new_is_old then fe[k]:= sorted_edges[i_edge].nr + else + begin + ne:= ne+1; fe[k]:= ne; + with edge[ne] do begin ep1:= i1; ep2:= i2; vis:= true end; + end; { if } + i1:= i2; + end; { for k } + nef:= npf; + plane_equ(p[fp[1]],p[fp[2]],p[fp[3]], nv,d,error); + end; { with face } + end; { aux_lines_before_faces } +{*************} + +procedure cp_vts3d_vts2d_spez(var p: vts3d; n1,n2: integer; + var pp: vts2d; var pdist: r_array); +{Zentralprojektion (Koordinaten) einer Punktreihe. + pdist[i]: Distanz des Punktes p[i] von der Bildtafel. } + var xe,ye,ze,cc : real; pm : vt3d; i : integer; + begin + for i:= n1 to n2 do + begin + diff3d(p[i],mainpt, pm); + xe:= scalarp3d(pm,e1vt); { Koordinaten von p bzgl. dem Koord.-System: } + ye:= scalarp3d(pm,e2vt); { Nullpunkt = Hauptpunkt } + ze:= scalarp3d(pm,n0vt); { und Basis e1,e2,n0 } + cc:= 1-ze/distance; pdist[i]:= ze; { Abstand zur Bildebene } + if cc>eps6 then begin pp[i].x:= xe/cc; pp[i].y:= ye/cc; end + else + writeln('Punkt liegt in oder hinter der Verschwindungsebene !!'); + end; { for } + end; { cp_vts3d_vts2d_spez } +{**************} + +procedure aux_quadrangle(n1,n2,np0,ne0,nf0: integer); + var ne1,i,k : integer; error : boolean; +{***} +function f(i,k :integer) : integer; begin f := (k-1)*(n1-1)+i+nf0; end; +function pt(i,k:integer) : integer; begin pt:= (k-1)*n1+i+np0; end; +function e1(i,k:integer) : integer; begin e1:= (k-1)*(n1-1)+i+ne0; end; +function e2(i,k:integer) : integer; begin e2:= ne1+(i-1)*(n2-1)+k+ne0; end; +{****} + begin + ne1:= (n1-1)*n2; + for k:= 1 to n2 do + begin + for i:= 1 to n1 do + begin + if (ieps6 then + begin + s:= (x21*(yi-y1) - y21*(xi-x1))/det; + if (-eps7<=s) and (s<=1+eps7) then + begin + t:= ((yi-y1)*(xi1-xi)-(xi-x1)*(yi1-yi))/det; + if ns=0 then + begin + t1:= t; ns:= 1; + end + else {ns=1} + begin + t2:= t; if abs(t2-t1)>eps6 then ns:= 2; + end; + end; { if } + end; { if } + xi:= xi1; yi:= yi1; i:= i+1; + end; { while } + ind:= 2; + if ns=2 then + begin + ind:= 1; {Strecke schneidet wenigstens eine Seite} + if t2=1) then ind:= 0; {Strecke innerh.} + if (t1>=1) or (t2<=0) then ind:= 2; {Strecke ausserh.} + end; + end; { is_line_convex_polygon } +{*************} + +procedure intmint(a,b,c,d: real; var e1,f1,e2,f2: real; var ind: integer); +{Berechnet die Intervall-Differenz [a,b] \ [c,d] . + ind=0: leer, ind=1: 1 Interv., ind=2: 2 Interv.} + var aa,bb,cc,dd : real; + begin + aa:= min(a,b); bb:= max(a,b); + cc:= min(c,d); dd:= max(c,d); + e1:= aa; f1:= bb; ind:= 1; + if (cc<=aa) and (dd>=bb) then ind:=0 + else + begin + if (cc<=aa) and (dd>aa) then e1:= dd; + if (dd>=bb) and (ccaa) and (dd100 then + begin + writeln; writeln('####: wait !!! (for hiddenline-alg.) '); writeln; + end; + if oriented_faces then + begin + for i:= 1 to nf do face[i].vis:= false; + for i:= 1 to ne do edge[i].vis:= false; + end; +{ Koordinaten der Bildpunkte: } + cp_vts3d_vts2d_spez(p,1,np, pp,pdist); +{ Fenster und Normalentest fuer die Flaechen: } + for i:= 1 to nf do + begin + with face[i] do + begin + discentre:= scalarp3d(nv,centre) - d; + if ((discentre>=0) or (not oriented_faces)) then + begin + if oriented_faces then + begin { Normalentest: Flaeche ist sichtbar } + vis:= true; + for k:= 1 to nef do edge[fe[k]].vis:= true; + end; + with box do + begin + with pp[fp[1]] do { Anfangswerte } + begin xmin:= x; xmax:= x; ymin:= y; ymax:= y; end; + zmax:= pdist[fp[1]]; + for k:= 2 to npf do + begin + with pp[fp[k]] do { Flaechenfenster } + begin + xmin:= min(xmin,x); ymin:= min(ymin,y); + xmax:= max(xmax,x); ymax:= max(ymax,y); + end; { with } + zmax:= max(zmax,pdist[fp[k]]); + end; { for k } + end; { with box } + end; { if } + end; { with face } + end; { for i } +{ Test und Zeichnen der Kanten(-teile):} + for i:= 1 to ne do { Beginn der KANTENschleife } + begin + if not edge[i].vis then goto 10; + par1[1]:= 0; par2[1]:= 1; nseg:= 1; { : 1 sichtb. Anfangsintervall} + { Punkte und Fenster der Kante : } + i1:= edge[i].ep1; i2:= edge[i].ep2; + p1:= p[i1]; p2:= p[i2]; pp1:= pp[i1]; pp2:= pp[i2]; + xemax:= max(pp1.x,pp2.x); yemax:= max(pp1.y,pp2.y); + xemin:= min(pp1.x,pp2.x); yemin:= min(pp1.y,pp2.y); + zemin:= min(pdist[i1],pdist[i2]); + for j:= 1 to nf do { Beginn der FLAECHENschleife } + with face[j] do + begin + if not vis and oriented_faces then goto 5; + { Fenstertest mit j-ter Flaeche: } + if (xemax<=box.xmin) or (xemin>=box.xmax) + or (yemax<=box.ymin) or (yemin>=box.ymax) or (box.zmax<=zemin) + then goto 5; { Kante wird nicht von j-ter Flaeche verdeckt } + { Kante i Kante von j-ter Flaeche ?:} + for k:= 1 to nef do if i=fe[k] then goto 5; { naechste Flaeche} + { Schnitt der Kante mit dem (konvexen) Flaechenpolygon in der Bildtafel: } + for k:= 1 to npf do p_pol[k]:= pp[fp[k]]; p_pol[0]:= p_pol[npf]; + is_line_convex_polygon(pp1,pp2,p_pol,npf,t1,t2,ind); + if ind=2 then goto 5 ; {Kante nicht verdeckt=> naechste Flaeche } + d1:= distance3d(p1,centre); d2:= distance3d(p2,centre); + with pp1 do dd1:=sqrt(x*x+y*y+sqr(distance)); {fuer Testpunkte} + with pp2 do dd2:=sqrt(x*x+y*y+sqr(distance)); + a:= d1/dd1; b:= d2/dd2; + if not is_permitted then {Kante darf die Flaeche NICHT durchdr.} + { Testpunkt und Test, ob Kante vor oder hinter der Flaeche : } + begin + tt:= ( max(0,t1) + min(1,t2) )/2; diff3d(p2,p1, pd); + tt:= a*tt/(b+tt*(a-b)); {Korrekt. (Zentralproj. keine lin. Abb.)} + lcomb2vt3d(1,p1, tt,pd, pt); + dispt:= scalarp3d(nv,pt) - d; {Distanz Testpunkt-Ebene} + if (dispt*discentre>0) then goto 5; + { Kante vor der Ebene => naechste Flaeche } + end; { if not is_permitted } + if is_permitted then { Kante darf die Flaeche durchdringen } + { Bestimmung des Teils der Kante, der hinter der Flaeche liegt: } + begin + tt1:= max(0,t1); tt2:= min(1,t2); diff3d(p2,p1, pd); + tt1:= a*tt1/(b+tt1*(a-b));{Korrekt. (Zentralproj. keine lin. Abb.)} + tt2:= a*tt2/(b+tt2*(a-b));{ " } + lcomb2vt3d(1,p1,tt1,pd, pt1); lcomb2vt3d(1,p1,tt2,pd, pt2); + dispt1:= scalarp3d(nv,pt1) - d; {Distanz 1.Testpunkt-Ebene} + dispt2:= scalarp3d(nv,pt2) - d; {Distanz 2.Testpunkt-Ebene} + test1:= dispt1*discentre; test2:= dispt2*discentre; + if ((test1>=0) and (test2>=0)) then goto 5; + { Kante vor der Ebene => naechste Flaeche } + if dispt1*dispt2<0 then + begin + disp1:= scalarp3d(nv,p1) - d; disp2:= scalarp3d(nv,p2) - d; + ts:= disp1/(disp1-disp2); + lcomb2vt3d(1,p1,ts,pd, ps); cp_vt3d_vt2d(ps,pps); + diff2d(pp2,pp1, ppd); {Zentralproj. ist keine lin. Abb. !!!} + ts:= (scalarp2d(pps,ppd)-scalarp2d(pp1,ppd))/scalarp2d(ppd,ppd); + if test1<0 then t2:= ts else t1:= ts; + end; + end; { if is_permitted} + for l:= 1 to nseg do {weiterhin sichtbare Intervalle:} + intmint(par1[l],par2[l],t1,t2, + pa1[l],pa2[l],pa3[l],pa4[l],nt[l]); + nseg0:= nseg; m:= 0; + for l:= 1 to nseg0 do { neue Intervallteilung } + begin + if nt[l]=0 then nseg:= nseg-1 { 1 Segment weniger } + else + begin + m:= m+1; + par1[m]:= pa1[l]; par2[m]:= pa2[l]; + if nt[l]=2 then { 1 Segment mehr } + begin + m:= m+1; nseg:= nseg+1; + par1[m]:= pa3[l]; par2[m]:= pa4[l]; + end; + end; { if } + end; { for l } + if nseg<1 then goto 10; +5: end; { with } + for k:=1 to nseg do { Zeichnen der sichtb. Segmente der i-ten Kante} + begin + diff2d(pp2,pp1, ppd); + lcomb2vt2d(1,pp1, par1[k],ppd, qq1); + lcomb2vt2d(1,pp1, par2[k],ppd, qq2); + if newstyles then + with edge[i] do begin new_color(color); new_linewidth(linew); end; + line2d(qq1,qq2,0); + end; +10: end; { for i (Kantenschleife) } + end; { cp_lines_before_convex_faces } +{*************} + + + +procedure is_interv_interv(var a,b,c,d,aa,bb : real; var inters: boolean); +{Berechnet den Schnitt der Intervalle [a,b], [c,d] .} +var a1,a2,b1,b2 : real; +begin + a1:= min(a,b); b1:= max(a,b); + a2:= min(c,d); b2:= max(c,d); + aa:= max(a1,a2); bb:= min(b1,b2); + if bb<=aa then inters:= false else inters:= true; +end; {is_interv_interv} +{*****} + +procedure box3d_of_pts(var p : vts3d_pol; np: integer; var box : box3d_dat); +var i: integer; +{Bestimmt den zugehoerigen (kleinsten) achsenparallelen Quader.} +begin + with box do + begin + with p[1] do + begin + xmin:= x; xmax:= x; ymin:= y; ymax:= y; zmin:= z; zmax:= z; + end; + for i:= 2 to np do with p[i] do + begin + xmin:= min(xmin,x); xmax:= max(xmax,x); + ymin:= min(ymin,y); ymax:= max(ymax,y); + zmin:= min(zmin,z); zmax:= max(zmax,z); + end; { for } + end; { with } +end; { box3d_of_pts } +{************} +(* +function is_two_boxes3d(var box1,box2 : box3d_dat) : boolean; +{Schnitt zweier achsenparalleler Quader.} +begin + is_two_boxes3d:= false; + if (box1.xmax>box2.xmin) then if (box1.xminbox2.ymin) then if (box1.yminbox2.zmin) then if (box1.zminbox2.xmin) and (box1.xminbox2.ymin) and (box1.yminbox2.zmin) and (box1.zmint2 then inters:= true else inters:= false; +end; { is_line_conv_pol_in_plane3d } +{***********} +procedure is_n1gon_n2gon3d(var pp1,pp2: vts3d_pol; np1,np2: integer; + var ps1,ps2 : vt3d; var intersection : boolean); +{Berechnet die Schnittstrecke zweier ebener konvexer Polygone im Raum, die + NICHT in einer Ebene liegen.} +var box1,box2 : box3d_dat; t1,t2,s1,s2,s,t : real; + nv1,nv2,ps,rs : vt3d; d1,d2 : real; + inters1,inters2,error,inters : boolean; +begin + intersection:= false; + box3d_of_pts(pp1,np1, box1); box3d_of_pts(pp2,np2, box2); + if is_two_boxes3d(box1,box2) then + begin + plane_equ(pp1[1],pp1[2],pp1[3], nv1,d1,error); + plane_equ(pp2[1],pp2[2],pp2[3], nv2,d2,error); + is_plane_plane(nv1,d1,nv2,d2, ps,rs, error); + if not error then + begin + is_line_conv_pol_in_plane3d(ps,rs,pp1,np1, t1,t2,inters1); + is_line_conv_pol_in_plane3d(ps,rs,pp2,np2, s1,s2,inters2); + if inters1 and inters2 then + begin + is_interv_interv(t1,t2,s1,s2, s,t,inters); + if inters then + begin + lcomb2vt3d(1,ps,s,rs, ps1); + lcomb2vt3d(1,ps,t,rs, ps2); + intersection:= true; + end; { if inters } + end; { if inters1,inters2 } + end; { if not error } + end; { if is_boxes } +end; { is_n1gon_n2gon } +{**************} + +procedure boxes_of_faces; +var i,j : integer; pp : vts3d_pol; +begin + for i:= 1 to nf do + with face[i] do + begin + for j:= 1 to npf do pp[j]:= p[fp[j]]; + box3d_of_pts(pp,npf, box); + end; +end; { boxes_of_faces } +{************} + +procedure is_face_face(i,k: integer; var ps1,ps2 : vt3d; + var intersection: boolean); +{Berechnet die Schnittstrecke zweier nicht in einer Ebene liegenden + (konvexen) Flaechen eines Polyeders.} +var t1,t2,s1,s2,s,t : real; ps,rs : vt3d; ppf: vts3d_pol; + error,inters1,inters2,inters : boolean; j: integer; +begin + intersection:= false; + if is_two_boxes3d(face[i].box,face[k].box) then + begin + is_plane_plane(face[i].nv,face[i].d,face[k].nv,face[k].d, ps,rs, error); + if not error then + begin + with face[i] do for j:= 1 to npf do ppf[j]:= p[fp[j]]; + is_line_conv_pol_in_plane3d(ps,rs,ppf,face[i].npf, t1,t2,inters1); + with face[k] do for j:= 1 to npf do ppf[j]:= p[fp[j]]; + is_line_conv_pol_in_plane3d(ps,rs,ppf,face[k].npf, s1,s2,inters2); + if inters1 and inters2 then + begin + is_interv_interv(t1,t2,s1,s2, s,t,inters); + if inters then + begin + lcomb2vt3d(1,ps,s,rs, ps1); + lcomb2vt3d(1,ps,t,rs, ps2); + intersection:= true; + end; { if inters } + end; { if inters1,inters2 } + end; { if not error } + end; { if is_boxes } +end; { is_face_face } +{**************} diff --git a/cdg0gv-2010/tools/Makefile b/cdg0gv-2010/tools/Makefile new file mode 100644 index 0000000..106d13a --- /dev/null +++ b/cdg0gv-2010/tools/Makefile @@ -0,0 +1,22 @@ +#PC= ppc386 +PC= ppcx64 + +CDGDIR= .. +INCLDIR= $(CDGDIR)/include +UNITDIR= $(CDGDIR)/units +TOOLDIR= $(CDGDIR)/tools + +PFLAGS= -So -Fu../units -I../include + +%: %.p + $(PC) $(PFLAGS) $< + +tools: + $(PC) $(PFLAGS) pldv.p + rm -f *~ *.o + +clean: + rm -f *~ *.o pldv + + + diff --git a/cdg0gv-2010/tools/include b/cdg0gv-2010/tools/include new file mode 120000 index 0000000..f5030fe --- /dev/null +++ b/cdg0gv-2010/tools/include @@ -0,0 +1 @@ +../include \ No newline at end of file diff --git a/cdg0gv-2010/tools/pldv b/cdg0gv-2010/tools/pldv new file mode 100755 index 0000000..427d84a Binary files /dev/null and b/cdg0gv-2010/tools/pldv differ diff --git a/cdg0gv-2010/tools/pldv.p b/cdg0gv-2010/tools/pldv.p new file mode 100644 index 0000000..c28f94e --- /dev/null +++ b/cdg0gv-2010/tools/pldv.p @@ -0,0 +1,319 @@ +program pldv; +uses Unix {linux}; +const +{$i include/geoconst.pas} + +type +{$i include/geotype.pas} + +var +{$i include/geovar.pas} + +const + AutoScale : Boolean = false; + Frame : Boolean = false; + Fixed_X_Size : Boolean = false; + Fixed_Y_Size : Boolean = false; + Postscript : Boolean = false; + eps : Boolean = false; + mono : Boolean = false; + RandDefault : Boolean = true; + +var + breite,hoehe, + xnullp,ynullp, + xmin,xmax, + ymin,ymax,r, + x_size,y_size, + faktor, + Rand, + x1,y1,x2,y2 : Real; + anz, + ind,i,idummy : Integer; + C : Char; + PLDFileName, + PSFileName : string; + PLDFILE : text; + s : String; + color : integer; + Option_Error, + anfang,newname : Boolean; + p : vts2d; + + +{$i include/geoproc.pas} +{$i include/proc_ag.pas} +{i postscr.pas} + + +procedure remapx(var x:real); +begin + x := (x/pt_per_mm + xnullp) * faktor + Rand; +end; + +procedure remapy(var y:real); +begin + y := (y/pt_per_mm + ynullp) * faktor + Rand; +end; + +{******************} + +begin {main} + + PLDFilename:=''; + PSFilename:='geodummy.eps'; + faktor:=1.0; +{ Postscript:= true;} + eps := true; + newname := false; + + { Parser for options } + + for i := 1 to ParamCount do + begin + Option_Error := False; + s := ParamStr(i); + if length(s) > 0 then + begin + Case s[1] of + '-' : begin + if length(s) > 1 then + Case s[2] of + 'o' : begin + s := Copy(s,3,length(s)-2); + PSFileName:=s; newname:= true; + end; + 'p' : begin + Postscript:= true; + s := Copy(s,3,length(s)-2); + if s='ps' then eps:= false + end; + 'z' : begin + s := Copy(s,3,length(s)-2); + Val(s,idummy,ind); + if ind <> 0 then begin + faktor := 1; + Option_Error := True; + end else faktor := idummy / 100.0; + end; + 'a' : AutoScale := True; + 'm' : mono := True; + 'x' : begin + Fixed_X_Size := True; + Fixed_Y_Size := false; + s := Copy(s,3,length(s)-2); + Val(s,idummy,ind); + if ind <> 0 then begin + Fixed_X_size := false; + Option_Error := True; + end else x_size := idummy *1.0; + end; + 'y' : begin + Fixed_Y_Size := True; + Fixed_X_Size := false; + s := Copy(s,3,length(s)-2); + Val(s,idummy,ind); + if ind <> 0 then begin + Fixed_Y_size := false; + Option_Error := True; + end else y_size := idummy *1.0; + end; + 'r' : begin + RandDefault := False; + s := Copy(s,3,length(s)-2); + Val(s,idummy,ind); + if ind <> 0 then begin + RandDefault := True; + Option_Error := True; + end else Rand := idummy *1.0; + end; + else Option_Error := True; { nur - } + end; + end; + else PLDFileName:=s; + end { Case } + end; {if} + + if Option_Error then + begin + Writeln('inadmissible option : ', ParamStr(i) ); + halt; + end; + end; { For } + + if PLDFileName='' then begin + writeln; + writeln('PLDV by Andreas Goerg / Erich Hartmann (Version: 10.12.2002)'); + writeln('for PLD-files version >=1.0 '); + writeln('call: PLDV {PLD-file-name} [-p{ps,eps}] [-o{file}] [-z{%}] [-a]'); + writeln(' [-x{width}] [-y{height}] [-r{border}] '); + writeln(' -p : a ps/eps-file is generated with the same name as the pld-file'); + writeln(' or the name specified in -o.... '); + writeln(' -z : zoom (per cent) '); + writeln(' -a : adjust the drawing area '); + writeln(' -x : drawing scaled to {width} mm '); + writeln(' -y : drawing scaled to {height} mm '); + writeln(' -m : (monochrome) ignoring colors'); +{ writeln(' -q : keine Grafikausgabe');} + writeln(' -r : border width= {border} mm around the drawing'); + halt; + end; + + if (not newname) and (Postscript) then + begin + s:= Copy(pldfilename,1,length(pldfilename)-3); + if eps then s:= s+'eps' else s:= s+'ps'; + psfilename:= s; + end; + + writeln('PLDV: A Postscript-file ',PSFileName, ' is generated'); + + assign(PLDFile,PLDFilename); + reset(PLDFile); + + Readln(PLDFile,s); + if s <> 'Ver1.0' then + begin + Writeln('This PLD-File is not of version >= Ver 1.0'); + halt; + end; + + xnullp := 0; + ynullp := 0; + + if AutoScale or Fixed_X_Size or Fixed_Y_Size then + begin + Read(PLDFile,breite,hoehe); + anfang := True; + repeat + Read(PLDFile,C); + Case C of + 'P' : begin + Read(PLDFile,x1,y1,ind); + if anfang then + begin + xmax := x1; xmin := xmax; + ymax := y1; ymin := ymax; + anfang := false; + end + else + begin + if x1 > xmax then xmax := x1; + if x1 < xmin then xmin := x1; + if y1 > ymax then ymax := y1; + if y1 < ymin then ymin := y1; + end; + end; + 'L' : begin + Read(PLDFile,x1,y1,x2,y2,ind); + if anfang then + begin + xmax := x1; xmin := xmax; + ymax := y1; ymin := ymax; + anfang := false; + end + else + begin + if x1 > xmax then xmax := x1; + if x1 < xmin then xmin := x1; + if y1 > ymax then ymax := y1; + if y1 < ymin then ymin := y1; + if x2 > xmax then xmax := x2; + if x2 < xmin then xmin := x2; + if y2 > ymax then ymax := y2; + if y2 < ymin then ymin := y2; + end; + end; + 'K' : begin + Read(PLDFile,anz,ind); + for i:= 1 to anz do + begin + Read(PLDFile,x1,y1); + if anfang then + begin + xmax := x1; xmin := xmax; + ymax := y1; ymin := ymax; + anfang := false; + end + else + begin + if x1 > xmax then xmax := x1; + if x1 < xmin then xmin := x1; + if y1 > ymax then ymax := y1; + if y1 < ymin then ymin := y1; + end; + end; + end; + end; + until (C = '*') or EOF(PLDFile); + + Reset(PLDFile); + Readln(PLDFile,s); + + Breite := (xmax-xmin)/pt_per_mm; + Hoehe := (ymax-ymin)/pt_per_mm; + xnullp := -xmin/pt_per_mm; + ynullp := -ymin/pt_per_mm; + + if RandDefault then Rand := 3; + + end + else + begin + if RandDefault then Rand := 0; + end; + + if Fixed_Y_Size then faktor := pt_per_mm*y_size/(ymax-ymin); + if Fixed_X_Size then faktor := pt_per_mm*x_size/(xmax-xmin); + + ps_graph_on(PSFilename,eps); + + if AutoScale or Fixed_X_size or Fixed_Y_Size then Read(PLDFile,r,r) + else Read(PLDFile,breite,hoehe); + ps_Draw_Area(breite*faktor+2*Rand,hoehe*faktor+2*Rand,0,0,eps); + + repeat + Read(PLDFile,C); + Case C of + 'P' : begin + Read(PLDFile,x1,y1,ind); remapx(x1); remapy(y1); + ps_pointc2d(x1,y1,ind); + end; + 'L' : begin + Read(PLDFile,x1,y1,x2,y2,ind); remapx(x1); remapy(y1); remapx(x2); remapy(y2); + ps_linec2d(x1,y1,x2,y2,ind); + end; + 'K' : begin + Read(PLDFile,anz,ind); + for i:= 1 to anz do + begin + Read(PLDFile,x1,y1); remapx(x1); remapy(y1); + put2d(x1,y1,p[i-1]); + end; + ps_curve2d(p,0,anz-1,ind); + end; + 'C' : begin + Read(PLDFile,color); + if not mono then + begin + ps_new_color(color); + end; + end; + 'W' : begin + Read(PLDFile,i); + ps_new_linewidth(i/10.0); + end; + end; + until (C = '*') or EOF(PLDFile); + + ps_Draw_end; + ps_Graph_Off; + +{Show psfile:} + s:= 'gv '; s:= s+psfilename; + writeln('### display: ',s); + {* shell(s); *} + fpSystem(s); + +end. + diff --git a/cdg0gv-2010/units/Makefile b/cdg0gv-2010/units/Makefile new file mode 100644 index 0000000..bcfc7df --- /dev/null +++ b/cdg0gv-2010/units/Makefile @@ -0,0 +1,20 @@ +#PC= ppc386 +PC= ppcx64 + +CDGDIR= .. +INCLDIR= $(CDGDIR)/include +UNITDIR= $(CDGDIR)/units +TOOLDIR= $(CDGDIR)/tools + +PFLAGS= -So -Fu../units -I../include + +%: %.p + $(PC) $(PFLAGS) $< +units: + $(PC) $(PFLAGS) geograph.p + $(PC) $(PFLAGS) hiddenl.p +clean: + rm -f *~ *.o *.ppu + + + diff --git a/cdg0gv-2010/units/geograph.o b/cdg0gv-2010/units/geograph.o new file mode 100644 index 0000000..5f85935 Binary files /dev/null and b/cdg0gv-2010/units/geograph.o differ diff --git a/cdg0gv-2010/units/geograph.p b/cdg0gv-2010/units/geograph.p new file mode 100644 index 0000000..cb35719 --- /dev/null +++ b/cdg0gv-2010/units/geograph.p @@ -0,0 +1,36 @@ +UNIT geograph; + +{SMARTLINK ON} + +INTERFACE + +USES Unix {linux}; +{************************} +{*** g e o g r a p h ***} +{************************} + +const {$i include/geoconst.pas} +type {$i include/geotype.pas} +var {$i include/geovar.pas} + +{$i include/head_geo.pas} +{$i include/head_ag.pas} +{$i include/head_pp.pas} +{ i include/head_ks.pas} +{ i include/head_pks.pas} +{ i include/head_qua.pas} +{ i include/head_pqu.pas} +{$i include/head_zp.pas} + +IMPLEMENTATION + +{$i include/geoproc.pas} +{$i include/proc_ag.pas} +{$i include/proc_pp.pas} +{ i include/proc_ks.pas} +{ i include/proc_pks.pas} +{ i include/proc_qua.pas} +{ i include/proc_pqu.pas} +{$i include/proc_zp.pas} + +END. {of IMPLEMENTATION} diff --git a/cdg0gv-2010/units/geograph.ppu b/cdg0gv-2010/units/geograph.ppu new file mode 100644 index 0000000..7f42009 Binary files /dev/null and b/cdg0gv-2010/units/geograph.ppu differ diff --git a/cdg0gv-2010/units/hiddenl.o b/cdg0gv-2010/units/hiddenl.o new file mode 100644 index 0000000..356d005 Binary files /dev/null and b/cdg0gv-2010/units/hiddenl.o differ diff --git a/cdg0gv-2010/units/hiddenl.p b/cdg0gv-2010/units/hiddenl.p new file mode 100644 index 0000000..4d472f0 --- /dev/null +++ b/cdg0gv-2010/units/hiddenl.p @@ -0,0 +1,47 @@ +UNIT hiddenl; + +INTERFACE + +USES GEOGRAPH; +{************************} +{*** h i d d e n l ***} +{************************} + +{fuer Hiddenline:} + +const {Achtung: es muss array_size>=nfmax sein !!!} + nfmax= 10000; nemax=20000; nsegmax=10; npfmax=10; + +type vts2d_pol = array[0..npfmax] of vt2d; + vts3d_pol = array[0..npfmax] of vt3d; + r_array_seg = array[0..nsegmax] of real; + i_array_seg = array[0..nsegmax] of integer; + box3d_dat = record + xmin,xmax,ymin,ymax,zmin,zmax : real; + end; + face_dat = record + npf,nef : integer; + fp,fe : array[1..npfmax] of integer; + vis : boolean; + box : box3d_dat; + discentre,d : real; + nv : vt3d; + end; + edge_dat = record + vis : boolean; + ep1,ep2,color,linew : integer; + end; + +var ne,nf,np: integer; {Anzahl der Kanten, Facetten,Punkte} + p : vts3d; {Punkte des Polyeders} + face : array[1..nfmax] of face_dat; + edge : array[1..nemax] of edge_dat; + pdist: r_array; {pdist[i]: Abstand d. i-ten Punktes von d. Bildeb.} + error,oriented_faces,is_permitted,newstyles: boolean; +{$i include/head_zpo.pas} + +IMPLEMENTATION + +{$i include/proc_zpo.pas} + +END. {of IMPLEMENTATION} diff --git a/cdg0gv-2010/units/hiddenl.ppu b/cdg0gv-2010/units/hiddenl.ppu new file mode 100644 index 0000000..92d1dcc Binary files /dev/null and b/cdg0gv-2010/units/hiddenl.ppu differ diff --git a/cdg0gv-2010/units/include b/cdg0gv-2010/units/include new file mode 120000 index 0000000..f5030fe --- /dev/null +++ b/cdg0gv-2010/units/include @@ -0,0 +1 @@ +../include \ No newline at end of file diff --git a/cdg0n.pdf b/cdg0n.pdf new file mode 100644 index 0000000..6c5980b Binary files /dev/null and b/cdg0n.pdf differ diff --git a/cdgen0104.pdf b/cdgen0104.pdf new file mode 100644 index 0000000..ffad5f7 Binary files /dev/null and b/cdgen0104.pdf differ