Closed ebak closed 3 years ago
Hi Endre - This issue has come up before, but I think this is a possible way forward that would allow us to use imported OpenSCAD code to make calculations as well as create geometry, which is how I wrote this in the first place.
Thanks for your code here! I think this has promise for dealing with polygon()
, and I think we may be able to apply it in a few other parts of the code so that all the functions that could take non-geometry arguments could reasonably accept imported OpenSCAD calculations (instances of IncludedOpenSCADObject
). More here soon...
Give the version released on PyPI as SolidPython 1.0.3 a try; it should have resolved this issue. In addition, any SolidPython object should be able to take imported OpenSCAD code as an argument to a function, so this should be a general solution to the problem.
There are, I think some complexities to this approach. If you did a set of nested calculations with imported OpenSCAD code, I'm not certain this would represent them correctly. BUT, for most purposes, which is "Somebody did some calculations I need in this OpenSCAD module-- can I just use them in SolidPython?", this should do the trick.
Hi,
I have verified this with the polygon stuffs. Works great. Thanks!
Hi,
Thanks for creating
SolidPython
! It is a very useful tool forOpenSCAD
. I have recently started to use itsImporting OpenSCAD code
feature (https://solidpython.readthedocs.io/en/latest/#importing-openscad-code), and luckily I started with a case which doesn't seem to be supported.I had problem with the
Round-Anything
module'spolyRound()
function: https://kurthutten.com/blog/round-anything-api/An example
OpenSCAD
code looks like:Calling it from
SolidPython
would look like:Unfortunately it doesn't work since the constructor of
solid.polygon
, which cannot take onOpenSCADObject
parameters:It would be very nice to support
OpenSCADObject
s as paramters.I have created a very ugly draft patch for myself to make it work:
Would it be possible to implement a nice solution for this use-case?
Best Regards, Endre