r/compsci • u/rvizzz • Nov 15 '20
A comparison between a few subdivision algorithms (Catmull-Clark, Doo-Sabin, and Midedge). Source code in comments
38
u/Extension-Fan5083 Nov 16 '20
Catmull-Clark is used everywhere in visual effects.
4
u/AbsentAesthetic Nov 16 '20
Yeah but I like Doo-Sabin better, it just looks like it makes more sense.
23
u/_selfishPersonReborn Nov 16 '20
what's the "purpose" of a subdivision algorithm?
26
u/Extension-Fan5083 Nov 16 '20
It is used in 3D applications that artists use like Maya, Houdini, and more to model characters, objects, environments, etc. Modelers can model using low resolution geometry, then smooth it out using subdivision.
30
Nov 16 '20
Maybe for use in divide-and-conquer algorithmsLooked it up, Catmull-Clark seems specifically to be for usage in 3-D graphical modeling for generating spheres. The gif represents its purpose pretty well actually
9
u/leoasa1 Nov 16 '20
Subdivide a mesh?
3
u/TheAcanthopterygian Nov 16 '20
What for?
7
u/pineapple_slut Nov 16 '20
Making 3d models look more smooth or realistic. Used all the time in software like blender.
9
u/bajsejohannes Nov 16 '20
As explained by pixar: https://www.khanacademy.org/computing/pixar/modeling-character/modeling-subdivision/v/cm-start
(Probably for a younger audience, but hey, it's still pretty useful)
3
u/IQueryVisiC Nov 16 '20
when you need to model a streamlined surface (exhaust pipe, road, wing), or a surface which doesn't chip corners when it bounces into something ( you know: living things, cars ), you need to smooth it out ( C2 continuity ). Still you only want to store the minimal amount of data ( control vertices ). I hate sculpturing.
Only r/architecture (Doom) does not subdivide.
2
u/PM_ME_UR_OBSIDIAN Nov 16 '20
Complete travesty that mathematical geometers stole the word "smooth" to mean Cinf instead of C2.
2
4
7
u/djwikki Nov 16 '20
By the looks of it, it seems Midedge is the least efficient of the three. Why would someone pick midedge over the other two
24
u/trimeta Nov 16 '20
If it's easier to compute? It looks like every two iterations of Midedge is the same as one iteration of Doo-Sabin, so if you can make your Midedge algorithm over twice as efficient as your Doo-Sabin algorithm, then Midedge would be better.
5
u/CodenameLambda Nov 16 '20
Well, similar, but not the same, from the looks of it. The double speed midedge version has smaller tris in the corners for each iteration after the first.
1
u/vanderZwan Nov 16 '20
Could that be rounding errors?
1
u/CodenameLambda Nov 16 '20
It could, but given how big the difference becomes, I doubt it. Though it could just compound easily for one reason or another I suppose...
1
1
1
u/StochasticTinkr Nov 16 '20
These are neat. Is there a practical application for these? Texture mapping or something?
1
33
u/rvizzz Nov 15 '20
Source code to make 2D or 3D subdivision animations on my Github
Performing subdivisions in 2D can make some pretty cool patterns. Here are some examples:
2D Midedge subdivision
2D Doo-Sabin subdivision