use existing Catmull Clark algorithm
-
Hi @CJtheTiger ,
Just build / rebuild your base shape and then apply
Subdivide
command.
And then continue with subdivided geo, to adjust it's look.There's some logic how new points are added during subdivision.
But I'm not it sure if it's good idea to create a square mesh, subdivide it and then remap to your circle somehow.As an example I started from 4-side disc, and applied subdivision command onto it five times. And the only issue is left — is to maintain boundary size and circular shape.
-
This post is deleted! -
@baca thanks for your suggestion.
And the only issue is left — is to maintain boundary size and circular shape.
Both of these issues are the reason why I want to create the points myself. The radius needs to be exact, and the circle needs to be as perfect as possible.
I created a Python script for a Python Generator that creates this:
And subdividing that has the same result.
https://github.com/YoYoFreakCJ/C4D-NestedSquarePythonGenerator
I could do a loop selection around the outer loop and apply the fit circle command but that's hacky as hell.
-
Hi @CJtheTiger,
When you must build upon the subdivision, insert modelling steps after it, you can use SMC when build the cache of your object. But I would always try to avoid that when possible and instead use an
Osds
instead in your cache wrapping around your output.I would not recommend reimplanting the SDS, because at the end of the day, they are not that trivial to implement. Using SMC should be fairly performant here, since you do not have to clone any inputs as you construct the input yourself.
I am not sure if I understand the rest of the discussion correctly, but when you want a better circle approximation using cubic interpolation/SDS, you just need more control points, which then leads to more complex geometry when you want a nice topology and no quads. When you do want to deal with terminating quad loops in the center, you could also just cylindrically distort a plane, do what I did here:
Cheers,
Ferdinand -
To close this topic up:
No, it is not possible to use the existing Catmull Clark algorithm, I'd have to implement it myself. -
Hey @CJtheTiger,
I am glad that you found your solution. But your conclusion is not correct. I know that there sometimes can be subjective truths, but I also must keep future readers in mind which might jump right to the end of a thread to look at its outcome; and which then might be led astray by your conclusion.
Our SDS are exposed, I even provided a code example above. And while you are of course free to reimplement things, it is not recommended to do so, as you then lose all the general features of our modeling core such as UV-handling and mnemonization and the subdivision specific features such as edge weighting.
Cheers,
Ferdinand -
Hi @ferdinand,
sorry I did not mean to spread misinformation. However since I specifically asked to not use an SDS and not invoke the message pipeline this post aimed to clarify whether it's possible to reference the actual class or methods to execute the algorithm which from what I gathered in this post is not possible. Correct me if I'm wrong.
Sorry again.
Cheers,
CJ -
Hey @CJtheTiger,
No need to be sorry. Well,
SendModellingCommand
(SMC) is not a message or part of the message stream. It is just an abstraction around calling functions/commands. So instead of callingfoo(1, 2, 3)
you callcommand(ID_FOO, (1, 2, 3)
which then callsfoo
for you. There is also nodo_catmull_clark()
function in our code base which could be called. There is the subdivision command which also includes SDS routines. In the backend this is also all part of the new modeling core which does fancy things like mnemonization for you which is important for performance (a user has 100 instances of your plugin with the same settings and just pays the price of one without and explicit instance objects).SMC can sometimes be disadvantageous when the inputs are already part of an active document and oneself is bound to threading restrictions (think of a polygon object input for some generator object). When you then want SMC such input, you cannot do that because that would be a threading violation. So, you must copy the data into a dummy document to do your computations there. Which is not only expensive but can also get tricky when one then must evaluate the dependencies of that input (or do brutish things like clone the whole document).
But this does not apply in your case here since you own your input. The threading restrictions are also not a problem unique to SMC and also apply to calling functions. Calling SMC with
MCOMMAND_SUBDIVIDE
is calling our SDS function.Cheers,
Ferdinand -
Good morning @ferdinand,
thanks for clearing things up. This made it click for me:
SendModellingCommand (SMC) is not a message or part of the message stream. It is just an abstraction around calling functions/commands. So instead of calling foo(1, 2, 3) you call command(ID_FOO, (1, 2, 3) which then calls foo for you.
I was under the assumption that SMC invokes the messaging pipeline.
It's great getting all of these insights. Thank you so much!
If I could I'd mark your last response as the answer but unfortunately it seems like this is not a thing anymore in the new forums?
Have a nice day,
Daniel -
Hey @CJtheTiger,
yes, we disabled Ask as question because it was a lot of extra work for us to maintain because 60%-80% of users set their topics never as solved.
Cheers,
Ferdinand