import sys rel = [ 'blendscad', 'blendscad.math', 'blendscad.core', 'blendscad.primitives', 'blendscad.impexp', 'blendscad.shapes' ] for mo in rel: if mo in sys.modules.keys(): print('reloading: ' + mo + ' -> ' + sys.modules[mo].__file__) imp.reload(sys.modules[mo]) ######################## import blendscad #from blendscad.shapes import * # optional blendscad.initns(globals( )) # to avoid prefixing all calls, we make "aliases" in current namespace ############################### import time import datetime st = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S') echo("BEGIN", st) ############################## ## List loaded blendscad related (sub)modules def list_modules(): for mod in sys.modules.values(): str1 = "|" + str(mod) + "|"
# OpenSCAD example, ported by Michael Mlivoncic #import sys #sys.path.append("O:/BlenderStuff") from mathutils import Vector # using Vector type below... import blendscad blendscad.initns( globals() ) # try to add BlendSCAD names to current namespace .. as if they would be in this file... ## Clear the open .blend file!!! #clearAllObjects() ###### End of Header ############################################################################## def example003(): difference( union(cube([30, 30, 30], center=true), cube([40, 15, 15], center=true), cube([15, 40, 15], center=true), cube([15, 15, 40], center=true)), union(cube([50, 10, 10], center=true), cube([10, 50, 10], center=true), cube([10, 10, 50], center=true))) example003()