Over past several months we’ve got questions about why don’t we support CSG subtraction. I know it’s very frustrating to see all those solids and not be able to subtract one from other. 😀
Well your wait is over. Today we are introducing Geometry Builder which lets you do just that. Here’s a screenshot that should explain the idea in a glance.
Now let me explain the details of how it works. But before that, let me explain why we took so long.
We have long been using the Cadmium solid modeling library that we open sourced last year to do CSG boolean operations on the server. That is how we build all the templates that you can customize and add to your models. But offering these CSG operations in interactive environments inside the browser is a different ball game.
- CSG algorithms are expensive, they are too slow for meaningful interaction
- They have to be run on server, so the interactivity suffers depending upon speed of your network connection
- The nature of boolean operations makes the interaction strategy difficult (How do you move a solid that is to be subtracted or in other words is invisible)
Of course others have already tried to solve this problem, on desktop as well as in browser. However we had to implement a solution that will solve all of the above problems and will be cheap at the same time. If we tried to run CSG algorithms on our servers while you manipulate the shapes in your browser, we will have to make them super fast and scalable, which will require very expensive hardware/software setup. And still you will get sluggish response if your network is slow.
To solve these problems we invested some quality time earlier this year implementing a completely different solution. We implemented a CSG algorithm that runs in browser and runs very quickly. I wrote about it in the past when we introduced Interactive Template Editor. Since then we have improved the algorithm further to make it produce better results and fixed some issues that makes it run on all browsers and platforms that support WebGL (previously it had problems on Windows machines running WebGL via Angle).
Now we are using the same algorithm to give you interactive CSG editing.
If you want to build custom geometries by subtracting a set of solids from other, then you can click the new button in the Shapes bar – “Make your own geometry”
That will launch the Geometry Builder dialog. This is a mini editor, similar to the main editor you use. Its purpose however is very specific. It allows you to add only primitive geometries (Cylinder, Box, Sphere, Torus). After adding them you can click on them to change their properties (radius, height, etc) and apply different transforms (rotation, shear, scale, etc.). Most importantly you will see a checkbox named “Subtract”. If you check it, the geometry will go red in editor, but in the preview section you will see it subtracted from other solid. You can keep making changes to your geometries and the preview will update immediately reflecting the changes you make.
This approach has the benefit that you can manipulate the solid to be subtracted very easily, even though it’s meant to be hollow. You do the changes in the editor where you see this solid in red and the preview shows the subtracted solid as a hollow carved into another solid.
When you are happy with the results, click the Build button. Now the geometry will be shipped to the server and will be baked into a proper mesh that you can add to your model, this should happen within seconds. You can add any number of instances of this geometry to your main model. You can perform all the regular operations on it as well. If you want to make any changes to it in future, click on it and press the Edit icon. The geometry will be opened in the Geometry Builder in the state that you left it in before.
This feature opens up possibilities for really wild solid geometries. I can’t wait to see what you make of it.
As always, if you find any bugs, please drop us a note.