Changeset 86

Show
Ignore:
Timestamp:
07/10/08 14:21:50 (6 months ago)
Author:
jpv
Message:

Modif des droites 2d et de certains clipping de projection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/solides.pro

    r81 r86  
    11%! 
    22% PostScript prologue for pst-solides3d.tex. 
    3 % Version 4.0, 2008/07/06 
     3% Version 4.01, 2008/07/09 
    44% 
    55%% COPYRIGHT 2008 by Jean-Paul Vignault 
     
    314314/sysfill {systemdict /fill get exec} def 
    315315/sysatan {systemdict /atan get exec} def 
    316 /atan {2 copy 0 0 eqp {0} {sysatan} ifelse} def 
     316/atan {2 copy 0 0 eqp {pop pop 0} {sysatan} ifelse} def 
    317317% Mise en place de la nouvelle procedure 
    318318/stroke { 
     
    12201220 
    12211221%%%%% ### droite ### 
     1222%% %% syntaxe : A B droite 
     1223%% /droite { 
     1224%% gsave 
     1225%% 6 dict begin 
     1226%%    /yB exch def 
     1227%%    /xB exch def 
     1228%%    /yA exch def 
     1229%%    /xA exch def 
     1230%%    xA yA xB yB 
     1231%%    eqp 
     1232%%       {} 
     1233%%       {  
     1234%%          xA yA xB yB 
     1235%%       verticale? 
     1236%%       { 
     1237%%       newpath 
     1238%%          xA ymin smoveto 
     1239%%          xA ymax slineto 
     1240%%             stockcurrentcpath 
     1241%%       stroke 
     1242%%       } 
     1243%%       { 
     1244%%       newpath 
     1245%%          /alpha xA yA xB yB coeffdir def 
     1246%%          /beta xA yA xB yB ordorig def 
     1247%%          xmin dup alpha mul beta add smoveto 
     1248%%          xmax dup alpha mul beta add slineto 
     1249%%             stockcurrentcpath 
     1250%%       stroke 
     1251%%       } 
     1252%%       ifelse 
     1253%%       } 
     1254%%    ifelse 
     1255%% end 
     1256%% grestore 
     1257%% } def 
     1258 
    12221259%% syntaxe : A B droite 
    12231260/droite { 
    12241261gsave 
    122512626 dict begin 
    1226    /yB exch def 
    1227    /xB exch def 
    1228    /yA exch def 
    1229    /xA exch def 
    1230    xA yA xB yB 
    1231    eqp 
    1232       {} 
    1233       {  
    1234          xA yA xB yB 
    1235          verticale? 
    1236          { 
    1237          newpath 
    1238             xA ymin smoveto 
    1239             xA ymax slineto 
    1240             stockcurrentcpath 
    1241          stroke 
    1242          } 
    1243          { 
    1244          newpath 
    1245             /alpha xA yA xB yB coeffdir def 
    1246             /beta xA yA xB yB ordorig def 
    1247             xmin dup alpha mul beta add smoveto 
    1248             xmax dup alpha mul beta add slineto 
    1249             stockcurrentcpath 
    1250          stroke 
    1251          } 
    1252          ifelse 
    1253       } 
    1254    ifelse 
     1263   /B defpoint 
     1264   /A defpoint 
     1265   A pop B pop eq { 
     1266      %% droite verticale 
     1267      newpath 
     1268         A pop ymin smoveto 
     1269         A pop ymax slineto 
     1270         stockcurrentcpath 
     1271      stroke 
     1272   } { 
     1273      %% on cherche le point le + a gauche 
     1274      xmin A B xdpoint /C defpoint 
     1275      C exch pop ymin lt { 
     1276         %% trop a gauche 
     1277         ymin A B ydpoint /C defpoint 
     1278      } if 
     1279      C exch pop ymax gt { 
     1280         %% trop a gauche 
     1281         ymax A B ydpoint /C defpoint 
     1282      } if 
     1283      %% on cherche le point le + a droite 
     1284      xmax A B xdpoint /D defpoint 
     1285      D exch pop ymin lt { 
     1286         %% trop a droite 
     1287         ymin A B ydpoint /D defpoint 
     1288      } if 
     1289      D exch pop ymax gt { 
     1290         %% trop a gauche 
     1291         ymax A B ydpoint /D defpoint 
     1292      } if 
     1293      newpath 
     1294         C smoveto 
     1295         D slineto 
     1296         stockcurrentcpath 
     1297     stroke 
     1298   } ifelse 
    12551299end 
    12561300grestore 
     
    1092210966   } if 
    1092310967   proj-action (none) eqstring not { 
     10968      gsave 
    1092410969      l@pl@n plangetrange aload pop  
    1092510970      setyrange setxrange 
    10926       newpath 
    10927          xmin ymin l@pl@n pointplan smoveto 
    10928          xmin ymax l@pl@n pointplan slineto 
    10929          xmax ymax l@pl@n pointplan slineto 
    10930          xmax ymin l@pl@n pointplan slineto 
    10931          xmin ymin l@pl@n pointplan smoveto 
    10932       clip 
    10933 %      planprojpst bprojscene 
     10971%%       newpath 
     10972%%          xmin ymin l@pl@n pointplan smoveto 
     10973%%          xmin ymax l@pl@n pointplan slineto 
     10974%%          xmax ymax l@pl@n pointplan slineto 
     10975%%          xmax ymin l@pl@n pointplan slineto 
     10976%%          xmin ymin l@pl@n pointplan smoveto 
     10977%%       clip 
     10978      planprojpst bprojscene 
    1093410979      solidlinewidth setlinewidth 
    1093510980      linestyle 
     
    1093810983      newpath 
    1093910984      range aload pop proj-args 
    10940       proj-definition cvx exec Cercle_ 
     10985      proj-definition cvx exec Cercle 
    1094110986      planprojpst projectionsifacevisible projpath 
    10942 %      eprojscene 
     10987      eprojscene 
     10988      grestore 
    1094310989   } if 
    1094410990} def