1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

LSystem Fix

Posted by Stu on Sep 23, 2010

Hi,
I was having a bit of trouble with lsystem1.py from the lsystem library in shoebot + made a fix.

It seemed like zero getting passed in as a time parameter was confusing things, so I put in some explicit checks for None.

If this makes sense I'd like it incorperated as we want all our changes to make it back upstream to nodebox ideally.


--- a/lib/lsystem/__init__.py Thu Sep 16 00:30:16 2010 +0000
+++ b/lib/lsystem/__init__.py Thu Sep 23 04:16:26 2010 +0100
@@ -166,11 +166,11 @@
"""

angle = self.angle
- if time and ease:
+ if time is not None and ease:
angle = min(self.angle, self.angle * time / ease)

self._timed = True
- if not time:
+ if time is None:
self._timed = False
time = maxint