CSG with smoothing

I have used the Babylon CSG feature a lot - found a new library that has smoothing and a really powerful fluent API.
wwwtyro/sdf-csg: Generate meshes from signed distance functions and constructive solid geometry operations. (github.com)

Just something interesting to see at this point.

6 Likes

This is cool :slight_smile: thanks for sharing

1 Like

Hey Brian, do you have ready examples of integrating sdf-csg to create Babylon meshes? (i.e. code converting SDF instance to Babylon vertex data, including UV?)

I have a use case for creating high resolution meshes of simple shapes (cubes, cylinders…) for mesh.applyDisplacementMap() with high resolution texture that requires smooth rounded edges, or the height map breaks around the edges.

I don’t have any examples nor have I seen that library integrated with Babylonjs - I was primarily sharing how useful that library looked as it may be worthwhile consideration for somebody to port it to Babylon with some kind of adapter - should be a straight-forward mapping in and out, but I have not investigated at all. I have added a few features to the OBJ loader, so I can visualize what I think needs to happen to map to a format, apply CSG and back to arrays of data/normals/colors/UV/etc.