-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rounded union results in a bump and a missing face #34
Comments
In general the blending functions that can be used on a union (ie changing the underlying minimum function) can generate undesirable artifacts. E,g, if you try to fillet a union the surface can bump out on the opposite side. If those artifacts are outside the bounding box of the top level entity then you end up with a hole because only triangles within the bounding box are rendered. The simple fix/work-around for this is to intersect the entity with a box that matches the bounding box of the entity. This cuts-off any artifacts outside of the bounding-box and gives you a clean render. Example: sdfx/examples/cylinder_head/main.go Line 371 in 7d6a54f
Having said that it might me useful to have a function that takes an sdf and returns an sdf for the bounding box of that entity. |
Have you considered Haskell-Things/ImplicitCAD#204 (comment) instead of trying to patch up the result after the damage is done? |
Meanwhile the bounding box hack won't work when the entity doesn't share a surface with the bounding box (when it's rotated for instance). |
The essential problem is that altering the min function to blend the two objects is a neat hack that doesn't really change the underlying geometry of the model. ie - you get what you get, and because it's a spatial field thing it may have an influence where you don't want it. You don't have to use the BB to clean up the faces. You can use whatever you like. ie - some other box, surface, envelope- whatever. If you do an intersect it will cleanup the external faces and remove inadvertant bumps. I'll grant you that the aesthetic appeal of doing this (from a coding sense) is not high. It feels hacky. However- building fillets as actual geometric objects is not trivial, indeed a principal motivation for writing this code was to generate filleted intersections without doing too much work. |
Probably related to Haskell-Things/ImplicitCAD#204 except your implementation miscalculates the bounding box.
Example code:
Result:
The text was updated successfully, but these errors were encountered: