Hi.
I currently have a complex imported mesh. (.stl)
I need to create a sort of thick plastic layer on top of the mesh.
This plastic layer should have a certain fixed thickness.
The plastic layer mesh should fit perfectly on the original mesh.
So for a simple shape like a box, the end result would be:
- an empty box
- that is just a bit bigger than the original box
- and the original box fits perfectly inside this new box
Obviously for complex shapes, this will be more challenging.
I tried doing it with CSG and scaling. But this is not really correct.
A scaled up mesh doesn’t guarantee a fixed thickness in every direction.
But achieving something is better than nothing.
So:
- clone the original mesh
- scale up the cloned mesh
- create a CSG for cloned mesh and original mesh
- subtract the original CSG from the cloned CSG
- create a mesh from the result
The problem with this method is, it is way to computationally heavy.
When I do the substract call, the process just freezes.
I quit it after 5 minutes of being busy so don’t know the exact time it takes.
Subtracting 2 duplicated stock stl meshes in the playground took about 130 seconds on my pc.
This is more of a high level question. So I don’t have a playground.
But if you need one, the default .stl playground is pretty complex:
https://www.babylonjs-playground.com/#AJJ8U5#2
Another possible method would be to take al the vertices of the mesh and scale/position them in the direction of their normal. But this will probably also be very computationally heavy.
Any ideas?
Thank you very much.