Replies: 2 comments 1 reply
-
Hey, aaaeeehh... well.... If I understand you correctly the question whether we could plugin a different backend (as I would call it) for example cadquery, right? I had the same idea (changing backends) a couple of times, but in the end always discarded it. The main reason is bosl2. Even though we could probably map the basics of solid python ( From my point of view it would probably make most sense to completely get rid of any "intermediate" code (or library) and directly use a csg library to render the models. But again, we would loose all high level (bosl2) functionality and I don't want to maintain those modeling features in SolidPython. Therefor openscad + bosl2 seems to be a "optimal" backend (a local minimum). Furthermore I think the SolidPython "design-flow" is tied pretty close to openscad. I don't know cadquery, but I had a brief view at their examples and it is not obvious to me how to map this "SolidPython design flow" to it. Their design flow seems different to me (at least on the first glance). Btw: SolidPython can not translate openscad code to python and back to openscad. It can generate openscad code from a python "object-tree" and it can import openscad code that can be used in this object-tree, but this is more like a importing a header file. It only extracts the module signatures and create python wrappers for them to be callable from withing SolidPython. SolidPython has no idea what's actually in a module or what it actually does, it only knows the name and the parameters of imported modules. This is not enough to translate it to any other backend. |
Beta Was this translation helpful? Give feedback.
-
A quick update on this topic... I reached out the gugulele developer, and I have started contributing to a new python-based implementation that supports several backends (cadquery, blender, trimesh, solidpython2). Here the solidpython2 code, just in case So basically we now have a multi-backend thingy that is capable of generating consitent basic geometries with different libraries. In this context I have implemented .stl import with solidpython2: based on openscad documentation, both ascii and binary .stl import should work, but for me only binary seems to work. Have you experience that too ? On the other hand, I would also like to import .scad files, so that we can scrap other designs from the internet... I understand from the examples solidpython supports importing .scad that include modules and functions that can be called 'natively' in python. But... is there a method to import a scad file that simply defines a geometry (without a method) ? I know I could convert the scad to .stl, then import the .stl, but that seems a convoluted technique... Thanks again for the support! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thank you for sharing this, it seems some really nice work.
I have started looking into some relatively complex openscad project ( https://github.com/bguan/gugulele ), but after discussing with the developer, he told me that he is disappointed with openscad rendering performances, and moved to onshape FeatureScript instead.
Since I prefer the open source nature of openscad, and I am familiar with python, I like SolidPython in terms of syntax and environment.
However, the main rendered of SolidPython is still openscad, so it has the rendering issue. I implicitCAD can also be used, that claims to be better in performances, but it does not support the hull function.
After further reviewing the available projects, i bumped into CadQuery ( https://cadquery.readthedocs.io/en/latest/ ) that allows to export .step and .stl format with better performance.
So I write to ask you if you think it would be feasible to write a SolidPython extension that imports existing scad code, and exports cadquery? It seems to me the primitives should be compatible, and this should therefore also allow to generate designs in SolidPython syntax and export with the "renderer" of choice. I would say yes by browsing the code, but I told myself you probably know better.
Cheers,
Bat52
Beta Was this translation helpful? Give feedback.
All reactions