From 2e2d8c31225ea4109f5f37ea81623c5a78a58efa Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Fri, 19 May 2017 01:49:17 -0400 Subject: [PATCH 1/3] prepend argument variables with _ This prevents collisions with python keywords which would cause a syntax error when executing it later --- solid/solidpython.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solid/solidpython.py b/solid/solidpython.py index 1a0e89ef..6ae69129 100755 --- a/solid/solidpython.py +++ b/solid/solidpython.py @@ -247,15 +247,15 @@ def new_openscad_class_str(class_name, args=[], kwargs=[], include_file_path=Non args_pairs = '' for arg in args: - args_str += ', ' + arg - args_pairs += "'%(arg)s':%(arg)s, " % vars() + args_str += ', _' + arg + args_pairs += "'%(arg)s':_%(arg)s, " % vars() # kwargs have a default value defined in their SCAD versions. We don't # care what that default value will be (SCAD will take care of that), just # that one is defined. for kwarg in kwargs: args_str += ', %(kwarg)s=None' % vars() - args_pairs += "'%(kwarg)s':%(kwarg)s, " % vars() + args_pairs += "'%(kwarg)s':_%(kwarg)s, " % vars() if include_file_path: # include_file_path may include backslashes on Windows; escape them From 2ed03abb292ad9323d5ee9fe804d1db60229979a Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Thu, 8 Jun 2017 20:55:29 -0400 Subject: [PATCH 2/3] for openscad 2016.xx https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#Rotate_Extrude --- solid/objects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solid/objects.py b/solid/objects.py index 5149f243..c0c96024 100644 --- a/solid/objects.py +++ b/solid/objects.py @@ -408,9 +408,9 @@ class rotate_extrude(OpenSCADObject): :type segments: int ''' - def __init__(self, convexity=None, segments=None): + def __init__(self, angle=None, convexity=None, segments=None): OpenSCADObject.__init__(self, 'rotate_extrude', - {'convexity': convexity, 'segments': segments}) + {'angle':angle, 'convexity': convexity, 'segments': segments}) class dxf_linear_extrude(OpenSCADObject): From 596279a4169eebda4ab83a2c92254ee3d57fc921 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Tue, 4 Jul 2017 13:34:22 -0400 Subject: [PATCH 3/3] remove pull request 65 --- solid/objects.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/solid/objects.py b/solid/objects.py index c0c96024..52e55722 100644 --- a/solid/objects.py +++ b/solid/objects.py @@ -168,8 +168,8 @@ class union(OpenSCADObject): def __init__(self): OpenSCADObject.__init__(self, 'union', {}) - def __add__(self, x): - return self.add(x) + #def __add__(self, x): + #return self.add(x) class intersection(OpenSCADObject): @@ -180,8 +180,8 @@ class intersection(OpenSCADObject): def __init__(self): OpenSCADObject.__init__(self, 'intersection', {}) - def __mul__(self, x): - return self.add(x) + #def __mul__(self, x): + #return self.add(x) class difference(OpenSCADObject): @@ -191,8 +191,8 @@ class difference(OpenSCADObject): def __init__(self): OpenSCADObject.__init__(self, 'difference', {}) - def __sub__(self,x): - return self.add(x) + #def __sub__(self,x): + #return self.add(x) class hole(OpenSCADObject):