Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cascade Studio: A Full Live-Scripted CAD Kernel and IDE in the Browser (github.com/zalo)
61 points by ArtWomb on Jan 21, 2021 | hide | past | favorite | 11 comments


I've used it, it's very good.

I've started my own programmable cad after using openscad, I just couldn't look at aliased lines and weird colors anymore, plus making complex models is slow, and bevels are hard.

My own cad is still far from working, probably because I had the brilliant idea to start my own csg kernel. In the meanwhile I've stumbled upon CascadeStudio.

Cascade Studio is fast, looks good, available everywhere via browser. I was able to do a non-trivial model, add bom generation via console.log. It would be great if there was a standalone version as well, so larger projects can be built directly from the filesystem.

Anyway, it's good stuff, whishing the project all the best.


>> My own cad is still far from working, probably because I had the brilliant idea to start my own csg kernel.

SolveSpace maintainer here. After fixing a number of things in the SS Nurbs kernel, I've added "do this over in Rust" to my bucket list. It may never happen, but if you want to talk algorithms or strategy drop me an email. Same ID at gmail.

AFAICT there is currently no other Free Software for trimmed NURBS other than Cascade and SolveSpace.


Yes, my plan is to do it in Rust.

I did start it in luajit first, because I thought that it will be a faster feedback loop. I created an OpenGL window, and set up nodemon to restart the luajit app on changes. It is quite fast, but still not as smooth as I imagined it. Doing it Rust from the start, with a TDD approach, might have been a better idea. Things got quite messy quite quickly because of the luajit OpenGL bindings.

The goal is to do difference, addition, intersection first between basic 3d volumes: sphere, cuboids, cylinders. And then yes, some extruded splines. I was thinking about starting with beziers, as this is the only spline I've implement before.

I haven't built a cad before, so I went with a data oriented approach, defined the data needed to represent each of the basic volumes, and 2d shapes, as well as the relationships(diff, union, intersection). Something like a normalized SQL database. A table (array), for positions, rotations, bounding boxes and so on. I'm yet to see how well this scales up to more complex models.

It is very much in the beginning. I've started from first principles, not looking up existing approaches and see what I can come up with. That's the reason it probably won't become something serious, but it's still fun to explore.

Thank you for offering help, might have a closer look at SolveSpace if I get to something serious that I cannot come up with a solution on my own.


I'm generally less interested in browser-hosted applications for 3D stuff (compared to desktop apps) but this is written with an interesting combination of technologies that span desktop and web. For example, OpenCASCADE, the same library used in FreeCAD, is emscripten-compiled to run in javascript. There's a number of support libraries that make web development look much more like application development (window management, etc), controller/gui library.

It's a view of how the web could have evolved (to be a sort of transparent desktop-like application support) earlier, with greater standardization on application-style GUIs.


Yeah, I'm not impressed by performance here, did you try this? https://donalffons.github.io/opencascade.js-examples/index.h...

It takes ages to load (probably gigantic wasm file), and ages to re-generate that silly bottle. I could live with the initial loading hog, but the performance of the actual kernel has to be there.


This project is unbelievably good!

And created only with vanillaJS, that is the incredible thing!


should probably mention, if you're looking for a local solution, there are at least 2 OpenCascade wrappers for python:

CadQuery ( https://github.com/CadQuery/cadquery )

PythonOCC ( https://github.com/tpaviot/pythonocc-core )


I've used CadQuery a lot and found it to be a terrific tool. Sadly, its still very buggy and has not been updated in almost a year...


Cadquery is continually updated. Maybe you where looking at the old repo?


what are the advantages of this compared to using freecads gui approach to modelling?


The way I see it, this is what programmers do, they turns things into programs. A good example are hardware description languages, where hardware designers write programs, and at the end a very complex chip design is generated. Which is then taped out. Those are very complex systems with very complex constraints. The output of these are locations of hunderds of billions of transistors with their interconnects.

Assuming you know JavaScript, you get some advantages over doing it via gui:

* Source control support: the model is text and can be stored in git. Multiple people can work incrementally in a branch. I assume cad models are binary, or very complex text. Having readble code will also allow for code reviews.

* Parametric modeling: you can define components (parts) as functions with function parameters to customize the behavior. You can have if else statements inside the functions to change the behavior. For example you can have a bolt function that can generate any type of bolt based on parameters

* Automation : In a programming language you can have loops that can generate any amount of components, and you can customize position, and object parameters in the loop. Making grids if objects is trivial.

* Testing : if you're using a full language like JavaScript, you can write unit tests for your more complicated parametric models. This can help with edgecases, and make your models more resilient.

* Code reuse : you can create a standard library of parametric models, ex: pipes, bricks, bolts and so on, and use them quickly on new projects

* IDE support : programming languages often have ide support that make reafactoring, code navigation, code exploration much simpler

* Familiarity : learning a complex gui app can take time, especially when the GUI is very complex. If the person already knows JavaScript, and can use an ide, with fuzzy searching through the symbols. In my opinion this is much simpler to start and get complex results than searching for some obscure feature in a deeply nested GUI. Of course this can be alleviated by a fuzzy search of UI functionality from a single place, ex: GIMP / command, and the new blender searchable menus.

Anyway, these are a few from the top of my head. There are probably many more. Of course, there are disadvantages, mainly that not everyone can program, and of course the people who use CADs are less likely to be familiar with coding. But capable people can learn quickly.

I'm looking at this as a software developer than wants to design some complex models, but doesn't want to learn a complex UI of a cad system. I'm quite familiar with working on complex systems in code, and find this approach much more suitable for me.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: