Quadratic splines.

This is a new forum that can be used to discuss anything that's not directly related to JPatch.

Quadratic splines.

Postby PeterB » Fri Aug 28, 2009 7:15 am

Hi there !

I was wondering if there's a modeler out there that uses quadratic splines, instead of cubic splines ? If quadratic splines are not used, is there any special reason why ? It seems to me that cuadratic splines are a bit easier to control than cubic ones.

TIA!
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby sascha » Fri Aug 28, 2009 6:37 pm

I think the reason is that you can't join them without creases (discontinuities in the tangent planes), at least not in general.
Ok, that's only half the truth - Doo-Sabin subdivision surfaces, for example, are generalizations of (bi-)quadratic B-Splines, but these are approximating, not interpolating. I do think that Catmull-Clark SDS (which are a generalization of bicubic B-Splines) are smoother than Doo-Sabin - after all, everybody is using Catmull-Clark SDS these days.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Quadratic splines.

Postby PeterB » Sat Aug 29, 2009 2:47 am

Hi Sascha, thanks for replying =]

I've been using animation master for years, (I tried your modeler as well) and although hooks and five point patches do solve a lot of problems, it's still hard to create smooth models with low resolution meshes. The main problem (for me at least) is that adding more points means it's harder to avoid small bumps in the mesh. You can get rid of the small bumps by adjusting the tangents, but given the way tangents are handled in A:M, they have a tendency to jump around when animated.

So I was wondering if using only quadratic patches and having all the tangents explicitly controlled by the user would make things easier - probably not, that's why it's not been tried - but I still felt curious.

I wonder what sort of patches does 3Dstudio use ?

http://mroger.net/tutorials/max/divers/ ... tch_00.htm

That looks rather good, although it seems to me that the same spline layout in A:M or in your modeler would crease ?

(btw, here's a model of mine done in A:M http://www.youtube.com/watch?v=t6Ea4rDdf00 )
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby sascha » Sat Aug 29, 2009 7:59 am

I haven't looked at A:M for years now, so some of the information below might be outdated:

The "Hash-Patches" used in A:M are not really bicubic (i.e. tensor-product) patches, but according to Martin Hash's paper here a kind of subdivision surface, with a lot of problems, most of them hidden by shading (i.e. the normals used for shading are not the true surface normals, which again creates a lot of new problems).
One could use "real" Bézier Patches (and Zheng-Ball patches for the 5-sided variants), but the resulting surfaces would still not look very smooth - there's the "flat spot" problem, and a number of others (e.g. undulations when several three-sided patches meet, etc.)
There are certain things that can be done about that, but there's no real silver-bullet to consistently solve all of these problems (even Hash had to introduce questionable workarounds, like the "Porcelain" shader to smooth out some surfaces.)

I think most of the problems arise because these kind of patches are "interpolating", i.e. the surface passes through the controlpoints. This makes modeling easier, but "approximating" surfaces (like SDS) usually look much smoother - the downside is that the controlpoints float somewhere above the surface.

But long story short, almost everybody is using Catmull-Clark subdivision surfaces (SDS) now, it's sort of become the industry standard, and future versions of JPatch will use them as well.

I'd like to make very clear that I'm not saying than A:M was sort of bad, for what it's worth it's quite cool, especially its animation features. I'm just trying to explain why I switched from Hash-Patches to SDS.

JPatch will also be able to "convert" patch models to subdivision surfaces, here's for example an A:M model converted to SDS:
Image
Because the SDS "looses some volume" compared to the original patch-model (since the surface does not interpolate the controlpoints anymore, but floats somewhere below) the image on the right looks a bit odd, but I'm also working on ways to compensate that volume loss, eg:
Image
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Quadratic splines.

Postby PeterB » Sat Aug 29, 2009 7:14 pm

I suppose I'll look into subsurfs. I got the impression they are polygonal surfaces ? Or at least the cage that controls the surface is made of polys ? What I didn't find very appealing is that, as you mentioned, the surface doesn't pass through the control points...

With respect to A:M, the last version I checked is 11.1 so my information is outdated as well but what I saw is that the modeling system was not fundamentally changed. Three point patches still creased and five point patches had some artifacts as well.

The porcelain shader produces smooth looking surfaces but it destroys detail in the process so it's a trade-off...

And yet the concept behind patch modeling is pretty elegant. It's shame that apparently it can't be fixed ?

Sacha wrote:I think most of the problems arise because these kind of patches are "interpolating", i.e. the surface passes through the controlpoints. This makes modeling easier, but "approximating" surfaces (like SDS) usually look much smoother - the downside is that the controlpoints float somewhere above the surface.

I guess I need to really learn the math behind patches to get a better understanding of what's going on.

But is there some fundamental reason that prevents interpolated patches to be perfectly matched with their neighbors ?
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby John VanSickle » Sun Aug 30, 2009 1:40 am

PeterB wrote:I suppose I'll look into subsurfs. I got the impression they are polygonal surfaces ? Or at least the cage that controls the surface is made of polys ? What I didn't find very appealing is that, as you mentioned, the surface doesn't pass through the control points...

I'm working on a modeler that uses SDSs, and to get around this issue, I represent the control points differently when the limit surface is displayed. The limit points that correspond to the control points have to be calculated in order to display the limit surface, so I save and display them as if they were the control points. I do a similar thing with the limit edges vs. the hull edges.

The result is that the control points are on the surface, and not floating above or below it. The only drawback--and certainly a minor one--is that when the user clicks and drags a control point, it does not move as much as the mouse moves (although the motion is always a fraction of the mouse's movement).

As you can see in the screen shots, Sascha has done the same thing as well with JPatch.
Last edited by John VanSickle on Tue Sep 08, 2009 2:29 am, edited 1 time in total.
John VanSickle
 
Posts: 189
Joined: Sat Feb 16, 2008 2:17 am

Re: Quadratic splines.

Postby sascha » Sun Aug 30, 2009 9:52 am

The result is that the control points are on the surface, and not floating above or below it. The only drawback--and certainly a minor one--is that when the user clicks and drags a control point, it does not move as much as the mouse moves (although the motion is always a fraction of the mouse's movement).

You can actually work around that when the user moves just a single limit-controlpoint. As the weight that controlpoint on its limit-surface-peer is known (it's a function of the points valence, but is also affected by advanced things like corner- or crease- sharpness values, but anyway, once you computed the limit position you should know that weight), you just need to take the reciprocal and multiply the mouse motion vector by that value. I've used that in JPatch, and it works pretty well.

PeterB:
Yes, control surfaces for the SDS are polygonal - you can see it on the images of the cartoon rabbit above: The left side shows the polygonal control-surface, the right side shows the SDS limit surface (What you'd get when you repeat the subdivision steps an infinitely.)
Personally I find modeling with patches pretty awkward - you'll often run into problems that can only be solved by deleting a larger patch and doing it again. You get used to it, but the learning curve is steep, and newbies often have problems figuring out when to use a five-point-patch, when to use a hook, etc. and as a result get lots of creases in their models.
Polygon modeling is much more "fool prove".
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Quadratic splines.

Postby pndragon » Sun Aug 30, 2009 6:53 pm

Polygon modeling is much more "fool prove".

Are you trying to say that the original, patch version of Jpatch "would not suffer fools gladly."? :)

--- Jim
"We're so sorry, Uncle Albert,
But we haven't done a bloody thing all day."
--- Paul McCartney
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Re: Quadratic splines.

Postby PeterB » Sun Aug 30, 2009 8:23 pm

Well, I've been using patches for many years so I don't find them hard to use :P

Anyways...I'll give SDS a try though. Is there a beta version of JPatch 0.7 ? Or any other app you would recommend ? Blender maybe ?

With respect to cubic/quadratic splines, what about this :

If you want a smooth/rounded surface when using cubic splines, the splines must be C2 continuous . Now, a C2 continuous cubic spline looks no different than a C1 continuous quadratic spline, but the cubic spline is harder to work with. OTOH, using quadratic splines means one less control point that must be tweaked and also it's easier to achieve continuity - Am I missing something obvious ?
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby sascha » Mon Aug 31, 2009 12:31 pm

Are you trying to say that the original, patch version of Jpatch "would not suffer fools gladly."?

Heh. I still believe that polygon modeling is easier and more intuitive, time will tell...

Is there a beta version of JPatch 0.7

I'm afraid that there's nothing usable right now. While it's certainly a lot more than vaporware, it'll still take some more time before I can release something (I've got a daytime job and I'm a father of two kids, so my spare time is rather limited these days.)
The SDS "core" and OpenGL rendering is fully functional, as is much of the user interface, but there are also a lot of things that are still either missing or buggy.

If you want a smooth/rounded surface when using cubic splines, the splines must be C2 continuous

I'm not a mathematician, but I think that the splines used in JPatch and for that matter in A:M are just G1 continuous - there's a difference between parametric (C) and geometric (G) continuity. SDS are in a sense "better", I'm not sure, either they are C1 or G2.
The extra smoothness comes with a price though: loss of control. For an SDS to match a patch model exactly (i.e. passing through all control-points with the same tangent-planes) you'd need approx. 4 times as many vertices. So, in a sense it's like having a patch model where you can control only about 1/4th of the control-points, and the remaining points are automatically positioned to make the surface as smooth as possible: SDS are smoother, but to get extra detail you'll need to add extra vertices.

There are two tools to get by with that limitation: 1st, you can set corner and edge sharpness values for each vertex or edge respectively, gradually introducing sharp corners and edges. The 2nd thing I've introduced in JPatch is hierarchical modeling. You can basically alter the model at any subdivision level - you can create a very sparse, rough base mesh, and in the areas you need more detail you can model that detail at subdiv-level 1, 2, or even higher. You can even alter the base mesh later, and the high-level modifications will "stick" to it:
Image The base mesh.
Image At level 2...
Image ...some points are moved.
Image When the base mesh is modified again...
Image ...the level-2 modifications move with it.

For free modelers you can take a look at Blender (which IMHO is user-hostile) and Wings3D or John VanSickle's LionSnake Modeler.
There's also a demo version of Maya available, and Silo looks also interesting (both are commercial though)
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Quadratic splines.

Postby PeterB » Mon Aug 31, 2009 10:16 pm

Sascha, thanks for your message. I definitely need to try a SDS modeler myself before commenting further .

I think that the splines used in JPatch and for that matter in A:M are just G1 continuous - there's a difference between parametric (C) and geometric (G) continuity.

Damn, now I need to learn the difference between parametric and geometric continuity, too :P
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby PeterB » Tue Sep 01, 2009 7:56 am

John VanSickle wrote:I'm working on a modeler that uses SDSs,


I'm trying LionSnake right now...
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby PeterB » Sun Sep 06, 2009 9:10 pm

I just noticed (silly me!) a basic fact about patches. A 4 sided patch is controlled by all the CPs of the 4 splines plus 4 more control points which are not part of the original splines. How are those additional CPs handled by modeling software ?

Are they automatically computed so as to make the surface as continuous as possible or ?
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Re: Quadratic splines.

Postby sascha » Mon Sep 07, 2009 6:43 am

Yes, they are.
The bas thing is: there's no way of doing this "right" - while it's possible to get G1 continuity, the usual parallelogram approach produces ugly "flat spots" in the surface, and any attempt to remove them is just a compromise.
SDS are much better in this respect, you don't have to invent any extra vertices, the smoothness comes at no cost at all.
Note that A:M and later version of JPatch (including 0.4) do not use Bézier patches, but a subdivision scheme (it essentially splits each 4-sided patch into 4 sub-patches, see Martin Hash's paper mentioned above.) This subdivision scheme overcomes some of the problems you'll get with Bézier patches, but is still inferior to more widely used schemes such as Catmull-Clark.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Re: Quadratic splines.

Postby PeterB » Mon Sep 07, 2009 9:34 pm

Thanks Sascha. Now Martin's paper makes more sense. I'm looking a bit more closely into Doo Sabin subsurfs now. (Thanks for the pointer you provided in your first message =])

Come to think of it, the distinction between polygon modeling and patches becomes a bit blurry when using SDS. The points of the coarse polygonal mesh are after all CPs, and the resulting surface is similar to a patch.

I suppose that the underlying mathematical facts behind subsurfs and bezier patches/splines are similar if not identical.
Last edited by PeterB on Mon Sep 07, 2009 11:42 pm, edited 1 time in total.
PeterB
 
Posts: 18
Joined: Fri Aug 28, 2009 7:12 am

Next

Return to Off topic

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron