| ▲ | injidup 11 hours ago |
| These types of CAD scripting tools are great but always try to position themselves as an “alternative” to GUI-driven CAD, whereas in reality they are complementary. OnShape got it right with FeatureScript (https://cad.onshape.com/FsDoc/
), which provides a very similar experience to Build123d at the scripting level. However, the insight that OnShape got right is that these scripts automatically become available as possible nodes within the history-based modeller. The OnShape UI is infinitely extendable beyond the fixed set of tools that comes with the base modeller. Build an FOSS CAD front end using something like Build123d as the extension engine, and then add hooks so the user can select edges, surfaces, objects, etc., and feed them to inputs on the scripts. The output of the script is then the new state of the history-based modeller. That would be killer |
|
| ▲ | CountVonGuetzli 10 hours ago | parent | next [-] |
| I didn't know OnShape had such a feature. Will check it out! What you describe is one of the main reasons why I use Rhino3D. It can be scripted via the Grasshopper plugin, which integrates really nicely with Rhino and its primitives. Sadly, Rhino isn't open source and is quite pricy - https://www.rhino3d.com/
- https://www.grasshopper3d.com/ |
| |
| ▲ | injidup 10 hours ago | parent [-] | | The fun thing is that onshape itself has a very thin kernel. Most of what you see as built in features are actually featurescript based. Onshape provides the source code for their built in feature set as a reference. https://cad.onshape.com/documents/12312312345abcabcabcdeff/w...
You do need an account login ( free ) to view it. | | |
| ▲ | aaronblohowiak 8 hours ago | parent [-] | | Kernel here is ambiguous.. I get what you mean, but parasolid is usually the thing described as the cad kernel. | | |
| ▲ | injidup 8 hours ago | parent [-] | | You are right but I also kind of did mean it that way. I believe that Parasolid is at heart of Onshape, the true kernel. Then on top of that is a compatibility layer describing the set of low level operations available to featurescript. I'm sure that not everything in Parasolid is available to featurescript and perhaps there are some things added that are not in Parasolid. Featurescript also contains the selector/query logic for programatically picking geometry. Whether that comes from Parasolid I am not sure. I haven't worked with featurescript for a number of years now but when I did I was amazed. I managed to make an operation for taking any solid from the UI and generating customized interlocking ribbing. The idea was hollow surfboard design. It worked and I left it at that. Never built the surfboard! However the downside with featurescript and I think a big mistake on their part was to use a custom language rather than python or javascript. Featurescript is almost javascript but with some syntax changes and magic DSL's. You are also forced to use the inbuilt editor which is horrible and if you have burned VIM keybinding into your nerve endings, going back to non modal editing is horrible. Also the discovery of featurescript modules in the community has terrible UX. It's super weird that they have such a great system but finding useful extensions is horrible. |
|
|
|
|
| ▲ | rao-v 10 hours ago | parent | prev | next [-] |
| I’d love to see this. It was a frustrating learning curve for me to realize that I couldn’t STEP export work from OpenSCAD to something like Fusion. Build123d is much better (supports STEP export and import) but a tightly integrated CAD frontend would be ideal! |
| |
|
| ▲ | alnwlsn 9 hours ago | parent | prev [-] |
| I think most GUI CADs have some kind of API like this. In FreeCAD it's Python. In Solidworks, it's VBA or C#. I don't think any are particularly well documented or supported by tutorials. |
| |
| ▲ | unholiness 7 hours ago | parent | next [-] | | Solidworks has VBA macros, which (on top of being poorly documented and unstable) subvert to the whole benefit of parametric CAD. Once you're creating features with a macro, you naturally want to edit them, but you also naturally want to rerun the macro itself to create them differently. It's like editing generated code and it's not a viable long-term setup. FeatureScript is a different beast. It actually runs as part of regeneration in Onshape. Standard features (extrude, loft...) are also defined in FeatureScript, so your custom features are the same first-class citizens with a interactive GUIs and stable updates to upstream changes. You can freely mix interactive CAD and custom code by adding standard features and custom features. | | | |
| ▲ | injidup 8 hours ago | parent | prev [-] | | https://cad.onshape.com/FsDoc/ |
|