-
Notifications
You must be signed in to change notification settings - Fork 73
union seams during mesh export #145
Comments
There are workarounds. You can slightly overlap the two cubes, a workaround I am familiar with from OpenSCAD. Evidently the seam must exist in the SDF, even if it isn't visible using the viewer (the seam is even invisible using |
I have added a new mesh generator based on libfive Dual Contouring. The two mesh generators are:
The #sharp mesh generator does not exhibit the problem of union seams. If the shape given in the original bug report is meshed using the #sharp generator, then the results look perfect, exactly as they look in the viewer, with sharp edges and no seam. However, there are some models for which #sharp is not appropriate, and for which you still need to use #smooth. And I still haven't diagnosed the underlying problem that causes union seams in the #smooth generator. |
@doug-moen this issue is apparent because of marching cubes right? Maybe if we forced an external offset on the models (while devving) it'd make this problem more apparent. I'm thinking depending on the export method picked (by default it'll be smooth), curv will apply or not apply this transformation. At least then users can adjust their models accordingly. In this example that'd equate to moving the boxes over N units that reflect the effects of what'd happen on smooth rendering. |
I do not fully grok why union seams appear. I believe that it is related to how the distance field looks at short distances away from the surface. The surface itself does not have this seam. The union seams are coming from the Although I generally like the algorithm compared to many others that I have tried, there is this union seam problem. I think the problem would be solved by a variant of Dual Marching Cubes that places the triangle vertices directly on the surface of the shape. Most SDF meshing algorithms available on the internet take as input a 3D grid of regularly sampled distance values. It's usually the case that none of these sampled distance values lies directly on the surface of the shape, so the surface has to be found by interpolation. My ideal solution is a variant of the algorithm that takes a function as an argument, instead of presampled values. The algorithm will initially sample the distance field in a grid pattern, then it will make hypotheses about the location of the shape's surface and call the distance function additional times to test these hypotheses. It will ask for more samples in regions where there is sharp curvature, and ask for fewer samples in areas where there is low curvature. Libfive is sort of like this, in that you give it a function as an argument, except that it wants me to tell it what the gradient of the distance field is at a given point, and where the edges are, and I do not have this information, so I have to give it dummy or estimated information, and the results are not the best. I want an algorithm that figures out this information itself by sampling the distance field based on its own internal requirements. I just found an algorithm that I haven't seen before by Roberto Grosso. It's a variant of Dual Marching Cubes that positions the triangle vertices on the surface of the shape. That's what I said I wanted above, right? https://link.springer.com/article/10.1007/s00371-021-02139-w Grosso has iterated this algorithm a number of times. I tested his first iteration a number of years ago, but the quality of output was less than OpenVDB, so I didn't use it. This latest iteration is supposed to be an improvement, so it's worth checking out. What I liked about Grosso's code on github (back then) was that it was very small and simple (C++), and that there was a fast variant that runs on GPUs. Grosso's new algorithm still works from regularly sampled distance data, you can't pass it a function, so it still isn't the algorithm that I really want. Usually when I have a great idea, somebody on the internet has already thought about it and implemented it. Not in this case, unless something new has appeared that I haven't seen yet, or I'm using the wrong search keywords. |
https://github.com/rogrosso/tmc seems that latest paper's implementation is available here under the And yeah; my comment is not about solving the problem but making it very obvious during development. If we can resolve it entirely that's awesome. |
Never mind, I have already tested Grosso's latest version. |
Do you know if this small space is determinable before rendering? Seriously it will be largely beneficial for me to apply an offset to make it visible during development than see it unexpectedly after rendering. |
This model,
seam.curv
:In the viewer:
When converted to an STL file using
curv seam.curv -o seam.stl
:The problem is the seam down the middle, only visible in the exported mesh. The request is to modify mesh export so that the seam doesn't get get generated.
Originally reported by @lf94
The text was updated successfully, but these errors were encountered: