PixarAnimationStudios / OpenSubdiv

An Open-Source subdivision surface library.
graphics.pixar.com/opensubdiv
Other
2.88k stars 558 forks source link

Self-intersecting results for a simple case of weight change. #1295

Closed VadiMysore closed 11 months ago

VadiMysore commented 1 year ago

CageOBJFile.txt CageSubDSurface EdgeVertexWeights.txt

Hi there, Please refer to the pictures of a simple cage, whose OBJ file is the very first one, CageOBJFile.txt. In the attached jpg file, you can see the result of subdivision after assigning an infinitely sharp weight (value = 10). The b-spline patches around the vertex mentioned, self-intersect. The edge-vertex index mapping and the edge/vertex weights are all recorded in the file EdgeVertexWeights.txt.

Is this the expected result?

Thanks!

davidgyu commented 1 year ago

Yes, this result is expected. The infinitely sharp corner weight will cause the surface to interpolate the position at that vertex, and the surrounding surface may fold over or self intersect to accommodate that constraint. If you want to have more control over the surface near such a point then you'll want to add vertices ore edge loops around that vertex.

VadiMysore commented 1 year ago

Hi David, Thanks for the response. Can you please give an example of how this can be overcome by adding "additional vertices/edge loops around that vertex"? We do have some face splitting tools, which can result in quads after splitting. I am interested in particular topologies that avoid such self-intersections as a generic workaround to suggest to end users.

Thanks for your help.

davidgyu commented 1 year ago

The essential point to understand is that the subdivision surface representation itself will not prevent you from creating a surface which has self intersections, e.g. simply moving the point locations of a mesh can cause the resulting surface to self intersect. The subdivision surface representation (especially with creases and corners) can elegantly describe complex shapes with compact topological descriptions, but as they say: with great power comes great responsibility. So, the main note is to make sure to use a mesh topology suitable the features being modeled. In the case you present, if it is important to have a sharp geometric feature at the tagged vertex, then you probably want to add topology near that vertex to help resolve the surface in the way that you want. Currently, the faces incident on that vertex are doing a lot: they each have multiple crease sharpness tags in addition to the infinitely sharp corner tag and their surface positions wrap a quarter of the way around the outside of the mesh. Where to add the additional edge loops is part of the fun and challenge of modeling!

VadiMysore commented 1 year ago

Hi David, I just wanted a clearer understanding of the issue. This case came from an end customer of ours. They may not be aware of all the nuances of SubD modeling. I understand SubD modeling is akin to modeling with b-splines. The cage is equivalent to the control net. I think wherever the cage is concave, the limiting surface happens to be "outside" the cage and the case in point has such concavities in its cage.

Since we need to suggest a workaround to the end user, I was looking for some tips to do so.

Will play around with the cage and the weights a bit more to suggest a workaround. Thanks for your inputs.