SubD shrinks the object

General discussion on SUbD for SketchUp

SubD shrinks the object

Postby uwesketch » Thu Jan 24, 2019 8:39 pm

Hi,

I model obejcts with low poly count and use SubD to create a nice looking Version. This is perfect for models with a large number of components - The high poly components can be generated on the fly when needed with one command.

Now I have some components that are by design touching each other at a point. But SubD shrinks the objects when sub-dividing and then the components are not close to each other anymore.
How can I avoid this shrinking? Or can SubD "inflate" them in the end, so that the points in the original mesh are on the surface of the sub-divided mesh (only the points, not the edges)?


Kind Regards
Uwe
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Thu Jan 24, 2019 9:10 pm

The Catmull-Clark based subdivision that OpenSubdiv uses does cause shrinking. There are no options to have it lie on the surface of the control mesh. That would also be somewhat ambiguous because the coarse mesh is very different from the smooth one. If you where to scale it up you'd probably find that some points would end up too large.

Do you have some screenshots of what kind of meshes you deal with? I'm curious if there's some auxiliary tools that could help.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SubD shrinks the object

Postby uwesketch » Fri Jan 25, 2019 1:14 am

Hi Thom


here a screenshot of the original and subdivided mesh:

Original_Mesh.jpg



SubDivided_Mesh.jpg



Maybe SubD could check where the mesh touches other components and then preserve the location of these points. Or the points to be kept on the surface could be defined by the user like the "crease edges" are defined.

I realized, that when in above example placing the touch point on the sphere on a very small plane, that then the sphere is not shrinked at that point (the blue line touches the surface before and after sub-dividing).
Could such a plane be added programmatically to avoid shrinking at a point?

Screenshot of the "chopped" sphere before and after sub-dividing:

Original_chopped_Mesh.jpg


SubDivided_chopped_Mesh.jpg
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby Box » Fri Jan 25, 2019 1:32 am

If you use the crease tool on the top vertex it will stay in place, or a small face.
1
User avatar
Box 
 

Re: SubD shrinks the object

Postby uwesketch » Fri Jan 25, 2019 9:15 am

Agree, crease will keep the point in place, but the sub-divided surface is then not a sphere anymore. I would like both.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby uwesketch » Sun Jan 27, 2019 10:46 pm

Hi Thomas
The Catmull-Clark based subdivision that OpenSubdiv uses does cause shrinking. There are no options to have it lie on the surface of the control mesh


As I mentioned initially, I like the concept of SubD a lot.
From my point of view it delivers a major missing functionality in Sketchup:
  • Model and work with low poly producing a small file size
  • When needed, with the press of a button, switch all components between the low and a high poly version back and forth as often as you want.
Simply great!


Therefore my question: Would you consider extending the SubD plugin to provide an additional option "CatMull-Interpolation" (as opposed to the existing CatMull-Clark approximation that shrinks)?
(Remark: In technical design and architecture, objects like walls should not shrink in a high poly version)

I did some tests using the BZ-spline plugin (from Fredo6) offering a CatMull curve Interpolation.
The results are in attached pictures. It shows, that the CatMull interpolation yields the same results as the SubD CatMull-Clark SubDiv algorithm, just that it does not shrink the object and all vertices are on the subdivided Surface.
What I did is basically use the two top and bottom loops ("circles") and generated a CatMull interpolation using the plugin. (It added a middle point outside each edge). Then I manually connected all new edges to get the quads for the subdiveded cone.

The original cone with slanted chopped head:
Cone_8Corners_ChoppedHead.jpg


Subdivided cone with SubD level 1. The wire-diagram of the original cone shows the "shrinking":
Cone_8Corners_ChoppedHead_SubDCatmull_Aproximation.jpg



Manually subdivided cone using CatMull curve interpolation (added 1 point for each edge) and the wire diagram of the original cone:
Cone_8Corners_ChoppedHead_ManaulCatMull_Interpolation.jpg



Manually vs SubD subdivided Cone. SubD Version has the same shape, just a bit smaller:
Cone_8Corners_ChoppedHead_Manual_vs_SubD.jpg



The example I did does not cover subdividing in all three dimensions (it would be a lot of manual work), but I hope it shows the idea.


Best Regards
Uwe
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Mon Jan 28, 2019 11:10 am

SUbD is using OpenSubdiv: http://graphics.pixar.com/opensubdiv/docs/intro.html
So I don't control the subdivision features of that.

As for "CatMull-Interpolation", is there an formula that works in 3D? What you describe you did manually sounds like running two 2D interpolation operations on the top and bottom ends of your shape. But I don't see how one could apply this generically to any arbitrary mesh... You got some references for that?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SubD shrinks the object

Postby uwesketch » Mon Jan 28, 2019 8:19 pm

According to the doc, it should be 3D Catmull interpolation. I will test.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby uwesketch » Tue Jan 29, 2019 9:35 pm

Hi thomthom,
I have checked the Catmull-Rom Spline in 3D and it works very ice.

The object used as a starting point is a regular cube that was subdiveded with SubD on the first level. This contains planar circles with 8 segments as well as non-planar "circles".
The CatMull interpolation was done with all corner points as control points. Each loop on the object was interpolated. The interpolation added one point to each existing segment (like increasing the level by one with SubD). Then the interpolated loops were manually connected to form the subdivided mesh.

For comparision, below screenshots also show the result when using SubD with level 2 subdividing on the cube.

CatMull_Interpolation.jpg


CatMull_Interpolation_front.jpg


The red circle below shows how the coarse 8 corner circle from the subdivided cube is smoothed.
Also good to see is, that the SubD subdivided cube is not yet a sphere (compare with the red circle).
As all corner points of the Level 1 SubD cube were used as control Points for the CatMull-Rom spline, the interpolated object is getting smoother, but will not become a sphere, since the starting object is not spherical.

CatMull_8_Corner_Sphere_Front_jpg.jpg




Could this interpolation be added to SubD as a "none shrinking" option?


I also have attached the sketchup model from which these images were created.

Kind Regards
Uwe
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Tue Feb 05, 2019 6:01 pm

How would you apply this to an arbitrary mesh? A cube is quite a simple example. You describe you worked on the loops of the cube - but in an arbitrary mesh it's not going to be as clean and simple as a cube.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SubD shrinks the object

Postby uwesketch » Tue Feb 05, 2019 8:41 pm

Do you have an example mesh that you consider complex enough to play with? I wiill take that mesh and subdivide it manually to show / develop the idea.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Tue Feb 05, 2019 9:05 pm

I can look for more, but here is one for starters: viewtopic.php?f=397&t=63826#p584981
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SubD shrinks the object

Postby uwesketch » Fri Feb 08, 2019 11:31 pm

I only did the Bell for now. But I hope it shows the idea/Concept.

The task is to keep the dimensions of the objects the same but still making the surface smooth.
For the bell this means that the sharp edges have to be smoothed and the less curved areas should be become round. As the less curved areas are the top of the bell.


Bell_FreThom.png
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby uwesketch » Thu Feb 14, 2019 8:52 pm

I did some further testing with Catmull Interpolation. I found that in principle it works, but in the area of sharper edges/corners the Catmull Interpolation (by definition) will "inflate" the area on both sides around the edge/corner quite a bit. This could be solved in a similar way as in SubD where one can define a crease value.

But instead of defining how an edge/corner shall be interpolated, there is another way to obtain smooth edges and corners without shrinking: FredoCorner.
Combining FredoCorner and SubD in a workflow, will not solve the shrinking issue completely.
But using FreeoCorner in areas where no shrinking shall apply and use SubD on top to smooth the remaining areas, is a good compromise giving a lot of flexibility in subdividing.

An open point is, that FredoCorner does not (yet) offer a toggle on/off feature like SubD.

@Thom: Not sure if there is a collaboration/exchange between you and Fredo, but this would be a perfect combination :-)


My last question on this "shrinking" topic: Will or is there an option in SubD to exclude areas from being subdivided in a group/component? Like you can define a crease as infinitely sharp, an area enclosed by sharp edges could be excluded for instance.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Sat Feb 16, 2019 11:11 am

uwesketch wrote:Combining FredoCorner and SubD in a workflow, will not solve the shrinking issue completely.
But using FreeoCorner in areas where no shrinking shall apply and use SubD on top to smooth the remaining areas, is a good compromise giving a lot of flexibility in subdividing.

Yea, for cases where you only want bevel/chamfer then other tools like FredoCorner is better - provides a leaner mesh. Hard edge modelling with SUbD will leave you with lots of extra faces that isn't really needed. At least in the form SUbD have to work inside of SU - uniform subdivision.
OpenSubdiv supports adaptive subdivision, but it's view based. Since SU doesn't have an API to override how an object appear it can't really be used for the purpose of SUbD.

uwesketch wrote:An open point is, that FredoCorner does not (yet) offer a toggle on/off feature like SubD.

I know the old RoundCorner didn't. But I thought the new FredoCorner had an edit feature. Pretty sure I at least saw a function to revert bevel/chamfer.

uwesketch wrote:@Thom: Not sure if there is a collaboration/exchange between you and Fredo, but this would be a perfect combination :-)

We talk. :) Some of his recent extensions are starting to have support for QuadFace Tools quads.

uwesketch wrote:My last question on this "shrinking" topic: Will or is there an option in SubD to exclude areas from being subdivided in a group/component? Like you can define a crease as infinitely sharp, an area enclosed by sharp edges could be excluded for instance.

Afraid not. Bridging the subdivided geometry with the not subdivided isn't really doable without artefacts. The shrinking effect of the subdivided mesh is one reason for this.

Originally I created planar quads as a single face instead of two triangles - in an attempt to optimise the face count. But when you came to perform crease adjustments etc it'd be causing lag when the planar native quad had to be broken into triangles.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: SubD shrinks the object

Postby uwesketch » Mon Feb 18, 2019 9:03 pm

thomthom wrote:
I know the old RoundCorner didn't. But I thought the new FredoCorner had an edit feature. Pretty sure I at least saw a function to revert bevel/chamfer.


Yes, there is an Undo/Edit function. Which is a great feature and a good starting point for a (global) Toggle On/Off like in SubD.
But such a toggle on/off is not there yet.
Another issue is, that when using SubD on a group/component where FredoCorner has been applied, the FredoCorner Undo/Edit does not work anymore. Seem like SubD overwrites some information used by FredoCorner.
Would be great, if both tools could work together. Kind of a "FreThom tool" :-)


thomthom wrote:
Afraid not. Bridging the subdivided geometry with the not subdivided isn't really doable without artefacts. The shrinking effect of the subdivided mesh is one reason for this.

Originally I created planar quads as a single face instead of two triangles - in an attempt to optimise the face count. But when you came to perform crease adjustments etc it'd be causing lag when the planar native quad had to be broken into triangles.


I see. Then I have another idea (since the adaptive Subdivision feature from OpenSubDiv also cannot be applied in SU):
As an option selectable by the user in SubD, could you run at the end of the subdivision process the "remove triangulation" from Quadface tool and then the "Merge Faces" Tool from your CleanUp3 (or the "Remove coplanar edges" command from Fredos "EdgeControl" tool)?
Like this, the still planar faces after subdivision would not contain so many coplanar edges.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby Box » Tue Feb 19, 2019 3:59 am

You mean something like this?
0
User avatar
Box 
 

Re: SubD shrinks the object

Postby uwesketch » Tue Feb 19, 2019 8:42 am

Yes, exactly.
But in a way, that afterwards you can toggle off the subdivision again.
I think when converting to a simple mesh, you cannot un-subd anymore.
0
User avatar
uwesketch 
 

Re: SubD shrinks the object

Postby thomthom » Sat Feb 23, 2019 4:13 pm

I've logged that as an enhancement request. Need to investigate a but further regarding some techincal details of applying creasing when the mesh isn't all triangles.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SUbD

Who is online

Users browsing this forum: No registered users and 4 guests

Visit our sponsors: