diff --git a/README.rst b/README.rst index e9a4ba07..142851da 100644 --- a/README.rst +++ b/README.rst @@ -286,6 +286,24 @@ is the same as: cylinder(r=2, h=30) ) +To assist with debugging: + +.. code:: python + + c = ~cylinder(r=10, h=5) + +is the same as: + +.. code:: python + + c = cylinder(r=10, h=5).set_modifier("#") + +which in OpenSCAD would be: + +.. code:: openscad + + #cylinder(r=10, h=5) + First-class Negative Space (Holes) ---------------------------------- diff --git a/solid/solidpython.py b/solid/solidpython.py index c8b85a33..cccf893b 100755 --- a/solid/solidpython.py +++ b/solid/solidpython.py @@ -304,6 +304,12 @@ def __call__(self, *args: "OpenSCADObject") -> "OpenSCADObject": """ return self.add(args) + def __invert__(self): + """ + Same as .set_modifier("#") + """ + return self.set_modifier("#") + def __add__(self, x: "OpenSCADObject") -> "OpenSCADObject": """ This makes u = a+b identical to: