gl-catmull-clark icon indicating copy to clipboard operation
gl-catmull-clark copied to clipboard

Add support for subdividing non-closed meshes

Open chromakode opened this issue 6 years ago • 1 comments

Thanks for the awesome library! I am using this to subdivide meshes from Blender on the client. When encountering a non-closed mesh, I found it to produce artifacts (see demo below).

This patch adds support for subdividing meshes which are non-closed or contain holes. The algorithm is based on step 3 and 4 here: https://graphics.stanford.edu/wikis/cs148-09-summer/Assignment3Description

Here's another reference (but it describes a different interpolation for edge points which mismatches Blender) https://rosettacode.org/wiki/Catmull%E2%80%93Clark_subdivision_surface

Before: before

After: after

chromakode avatar Aug 11 '17 23:08 chromakode

This patch works great for me for displaying a subdivided version of the teapot model without spikes.

ghost avatar Dec 08 '17 23:12 ghost