From 987f58de3a7e03462117ff59f53ac3354c502598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20S=C3=A1nchez=20de=20Le=C3=B3n=20Peque?= Date: Sun, 27 Nov 2016 20:41:11 +0100 Subject: [PATCH] Add some scad-utils operations Those operations include inset, outset, fillet and rounding. --- solid/solidpython.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/solid/solidpython.py b/solid/solidpython.py index cc3fbcd4..68cee7f5 100755 --- a/solid/solidpython.py +++ b/solid/solidpython.py @@ -1000,6 +1000,50 @@ def __init__(self): OpenSCADObject.__init__(self, 'hull', {}) +class inset(OpenSCADObject): + ''' + Creates a polygon at an offset `d` inside a 2D shape. + + :param d: offset + :type d: number + ''' + def __init__(self, d=None): + OpenSCADObject.__init__(self, 'inset', {'d': d}) + + +class outset(OpenSCADObject): + ''' + Creates a polygon at an offset `d` outside a 2D shape. + + :param d: offset + :type d: number + ''' + def __init__(self, d=None): + OpenSCADObject.__init__(self, 'outset', {'d': d}) + + +class fillet(OpenSCADObject): + ''' + Adds fillets of radius `r` to all concave corners of a 2D shape. + + :param r: radius + :type r: number + ''' + def __init__(self, r=None): + OpenSCADObject.__init__(self, 'fillet', {'r': r}) + + +class rounding(OpenSCADObject): + ''' + Adds rounding of radius `r` to all convex corners of a 2D shape. + + :param r: radius + :type r: number + ''' + def __init__(self, r=None): + OpenSCADObject.__init__(self, 'rounding', {'r': r}) + + class render(OpenSCADObject): ''' Always calculate the CSG model for this tree (even in OpenCSG preview