Permalink
Browse files

Union blocks

  • Loading branch information...
1 parent 8f09c1e commit c77b7648eea9167b8abdb3039cb047a7ed54d39b @l0b0 l0b0 committed Oct 19, 2010
Showing with 4 additions and 2 deletions.
  1. +3 −1 img2scad/img2scad.py
  2. +1 −1 setup.py
View
@@ -74,11 +74,12 @@ def img2scad(stream, minimum):
result = ''
result += 'module topography() {\n'
+ result += ' union() {\n'
for row in range(height):
for column in range(width):
pixel = img_matrix[column, row] + minimum
if pixel != 0:
- result += ' translate([%(x)s, %(y)s, 0])' % {
+ result += ' translate([%(x)s, %(y)s, 0])' % {
'x': BLOCK_SIZE * column - width / 2,
'y': -BLOCK_SIZE * row + height / 2
}
@@ -87,6 +88,7 @@ def img2scad(stream, minimum):
'block_side': BLOCK_SIDE,
'height': pixel
}
+ result += ' }\n'
result += '}\n'
result += 'topography();'
View
@@ -10,7 +10,7 @@
setup(
name = 'img2scad',
- version = '0.1',
+ version = '0.2',
description = 'Image to OpenSCAD converter',
long_description = module_doc,
url = 'http://github.com/l0b0/img2scad',

0 comments on commit c77b764

Please sign in to comment.