/[gzz]/gzz/gfx/libpaper/texcoords.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/texcoords.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by jvk, Thu Oct 10 13:36:45 2002 UTC revision 1.15 by jvk, Wed Oct 16 09:14:10 2002 UTC
# Line 62  class TexGenXYRepeatUnit: Line 62  class TexGenXYRepeatUnit:
62      """      """
63      def __init__(self, rnd=None,      def __init__(self, rnd=None,
64              vecs = None,              vecs = None,
65                scale = .3,
66                scale_log_stddev = 0.4,
67              angle_stddev = .065,              angle_stddev = .065,
             avg_length_mean = .3,  
             avg_length_stddev = .06,  
68              lendiff_mean = 0,              lendiff_mean = 0,
69              lendiff_stddev = .1):              lendiff_stddev = .1):
70    
# Line 76  class TexGenXYRepeatUnit: Line 76  class TexGenXYRepeatUnit:
76          angle = (.25 + angle_stddev*rnd.nextGaussian()) * 2 * math.pi          angle = (.25 + angle_stddev*rnd.nextGaussian()) * 2 * math.pi
77          angle *= 1 - 2 * rnd.nextBoolean()          angle *= 1 - 2 * rnd.nextBoolean()
78    
   
79          # The angle of the first basis vector          # The angle of the first basis vector
80          as = rnd.nextDouble() * 2 * math.pi          as = rnd.nextDouble() * 2 * math.pi
81          # And the angle of the second basis vector          # And the angle of the second basis vector
82          at = as + angle          at = as + angle
83    
84            # Logarightm of the random scale factor
85          # The (geometric) average of the basis vector lengths          m0 = scale_log_stddev * rnd.nextGaussian()
         r = avg_length_mean + avg_length_stddev*rnd.nextGaussian()  
86    
87          # The difference between basis vector lengths          # The difference between basis vector lengths
88          m = lendiff_mean + lendiff_stddev * rnd.nextGaussian()          m = lendiff_mean + lendiff_stddev * rnd.nextGaussian()
89    
90          # The basis vector lengths          # The basis vector lengths
91          rs = r * math.exp(m)          rs = scale * math.exp(m0 + m)
92          rt = r * math.exp(-m)          rt = scale * math.exp(m0 - m)
93    
94          # The vectors that give x and y when dotted with (s, t, 0, 1)          # The vectors that give x and y when dotted with (s, t, 0, 1)
95          self.vecs = [[ rs * math.cos(as), rt * math.cos(at)],          self.vecs = [[ rs * math.cos(as), rt * math.cos(at)],

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26