I have finished the skin modifier reimplementation. I hope you guys could spend sometime reviewing it for me. It will be a great opportunity for me to learn from you. I put some more explanation in the following section, hoping that it could you understand my code. If you have any question, my email is firstname.lastname@example.org, and my Skype is khanhhh89.
The existing skin modifier performs poorly with branching (where 3+ branches meet).
This method produces a higher quality skin which is better suited as a base mesh.
- Unlike the existing skin modifier, this method only supports a single scale dimension.
- Currently the generated mesh is much higher detail then the existing skin modifier, though the option to have lower resolution versions too - needs some investigation.
- Better joints, especially with 3+ joints.
- Not limited to 4 sided cylinders.
- Should this replace the existing skin modifier?
- Should this be made into an option for the existing skin modifier? (an alternate method of skinning)
- How closely should we attempt to match the existing skin modifier?
- This is being developed in the mod-bskin branch of the staging repository. This patch is regularly updated for review purposes.
The implementation based in part off the paper "Converting skeletal
structures to quad dominant meshes" (J.A. Barentzen, M.K. Misztal,
The SQM paper is current available here:
The code also adds some features not present in the paper:
- Add mesh evolution based on two function + Move verts at intersections between cone-sphere on ellipse intersection section between two cone-sphere + Project verts onto cone-sphere' surface based paper "Fast Distance Computation Between a Point and Cylinders, Cones, Line-Swept Spheres and Cone-Spheres"
- No Catmull-Clark subdivision; intead, only subdivide faces in Catmull-Clark style
and project new verts onto cone-sphere's surface
- Add some auxiliary verts on branch skin verts' convex hull, as in reality, topology at branch verts
with more than three adjacent verts is often bad. Add a auxiliary will help isolate path vert
on skin vertex's convex hull
The imput is a skeleton with skin verts and edges. There are three types of skin verts. Leaf skin verts, connection skin verts, branch skin verts corresponds to valence values of 1, 2, 3.
The implementation includes following steps:
- Create a graph called SQM. SQM's nodes are leaf or branch skin verts. SQM's edges own leaf or branch skin verts as their extreme verts, and connection skin verts lying between such leaf or branch skin verts. There are three typles of SQM edges: edges connecting leaf-leaf skin vert, edges connecting branch-leaf skin verts, edges connecting branch-branch verts.
- Build convex hull at branch SQM nodes from intersection points between segments connecting branch skin verts and its adjacent verts. Verts on convex hull called path verts. Assign such path verts to SQM's edges adjacent to this branch skin vert.
- Subdivide each triangles on convex hull in to six sub triangles to isolate convex hull's verts from each other. This will help each original verts on convex hull have theiw own 1-ring verts.
- For each of branch-branch SQM's edges, equalize valence of path verts. This ensure that such path verts can be stiched later.
- Stiching step 5.1 Stich leaf-leaf SQM edges: create a number of verts along the circle of first leaf skin vert, bridge such circle verts with verts along connection skin verts, and finally, bridge with verts at the other leaf skni vert. 5.2 Stich branch-branch SQM edges. Kill adjacent faces of two extreme vert and the same as above. 5.3 Stich branch-leaf SQM edges.
- Evolution step
This step move verts on branch nodes to their right position. Evolution strategy for verts is based on their type, which is classified by number of skin verts connected directly to them through their adjacent edges. Such numbers only could be 0, 1, 2, 3.
For 2-typed verts mean that they lying between two cone-spheres. so, we need to project them to the ellipse intersection section of two cone-sphere
For 3-typed verts mean that they lying in the region between three cone-sphere. So we find the projection of the vert to each pair of cone-sphere, and finally, take the average of all the projection points.
For 1-typed verts, we only need to project them to the corresponding cone-sphere
- Now we have a final rough mesh, and we need to split edges connecting leaf, branch, connection skin verts to an expected resolution.
- Subdivide more in case users require a higher resolution.
- Project all new verts on their corresponding cone-sphere.