Wish: Add "Preserve CP flow" option in the "Rebuild surface" tool

Quite often rebuilding a surface to degree 5 results into an extremely distorted output surface whose shape and control point arrangement has nothing to do with the input geometry. A new option called Preserve CP flow" that tries to keep the control points of the output surface in relatively the same arrangement would help a lot to avoid those inconsistent weird looking results that lead to frustration and time consuming manual fix.

1 Like

This is true… Rebuild, in its current state, samples the input and then inerpolates the samples, so it can indeed wobble quite a bit at low point counts.

-Pascal

Hi Pascal, is not it more appropriate for the “Rebuild” command to take the input surface’s control point structure into consideration? That way, the resulting output surface will not look so distorted, especially if the goal is a Bezier surfaces with Degree 5 and 6 control points. The example I posted above is extremely distorted and basically unusable due to the chaotic zig-zag position of the 3rd row of control points at either end.

Hi Bobi - yep, I hear you- no dissent from me that espcially for low point counts and high degree Rebuild can make some wonky surfaces.

RH-69304 Rebuild - Keep the control point flow

-Pascal

2 Likes

Thank you for adding this bug to the pile, Pascal! Looking forward to see it fixed! :slight_smile:

My guess is it would require a significant rewrite - just a guess - but, at least it is on the pile - Mikko will tell me what he thinks…

-Pascal

The best would be to add it as an option inside the “Rebuild” panel, so that it could be switched on and off for a quick reference and decision whether to use it or not.

A Rebuild command which behaves with higher degree NURBS as Bobi is requesting will require a fundamentally different and considerably more complex algorithm than the current Rebuild. This assessment is based on experimenting with Rebuild, and my understanding of NURBS and curve fitting.

Perhaps a more general discussion about how Rebuild could be fundamentally improved would be in order.

2 Likes

Thanks for bringing this up @Rhino_Bulgaria. Indeed, I often have rebuild surfaces this way without much success. In most cases starting a new surface from scratch is faster. The same is true for curves. The attached clearly shows this. Take a degree 5 single span, rebuild to degree 3 high point count and then rebuild this back to degree 5 single span. Result is a curve with inflections near the end.
I remember @maje90 made a nice gh script that did a fine job for fitting curves.

curve_wobble.3dm (161.6 KB)

1 Like

Yeah, same problem - you’ll see that the result has the edit points quite evenly distributed - just about 20 units apart in arc length. The original does not have this even spacing - Rebuild samples at evenly spaced locations and interpolates.

-Pascal

An alternative approach for rebuilding a curve or surface would be to sample the input curve or surface at tightly spaced points, and then determine the curve or surface of the desired degree and number of control points which is the best fit to the sampled points.

The higher the degree of the interpolated curve or surface, the greater the tendency for wiggles to develop. That is how the math works and is independent of the details of the particular interpolation algorithm.

In my 2nd post here I showed a picture consisting the numbers of newly created control points that represent how a single span surface with Degree 5 and 6 control points should look like. The distance between the control points is relatively equal and they are placed along the imaginable interpolation of the original control points.

I like the idea of “preserve CP flow”-style.

but i would love to have a “nicely / equally distributed CP”-style as well.
for example when rebuilding surfaces with CV-weights - that come from Arcs - it would be great to have this.
a simple example:

left:
lofting 2 arcs with different angles will result in different “speeds”:between edge and mid-isocurve (u-direction). resulting in the bended red isocurve.(v-direction)

right
rebuilding this surface (violett) will inherit this unequal setting.
(cvs don t have same distance).
while redoing a loft from the edges will have nice CV-distribution (green)

rebuild_srf_by_arc.3dm (65.4 KB)

The VSR way of dealing with this is to offer three options for rebuilding a surface - original, arc length and curvature. The current tool does it via arc length more or less - the other two options are both very useful, very powerful and very much needed. The same options exist for rebuilding a curve and just like with the surface version I use all three and find each very useful for certain cases.

1 Like

Hi Sky - can you show, or post, or send me, a file with the various results if the surface in this file is rebuilt to degree 5, 6 pts with those options?

Rebuildme5_6.3dm (34.4 KB)

-Pascal

That’s a bit of an odd test case, and it’s frankly not really showing the usefulness. I’ll see if I can come up with something better and post it.

2 Likes

OK, thanks, that is good to know in itself.

-Pascal

Slightly tangential but related - here’s a good example where it’s very nice to rebuild with a Curvature calculated point spacing/parameterization:

I’m rebuilding these two curves - in this case these are planar intersections of laser scanned data, so the intersections curves themselves are very dense, and evenly so. The shape of the curves is best done by a non uniform point distribution, so in this case, having a “Curvature” option in VSR yields a nice result:

If I had a version of this curve that had the right point distribution - more at the top, less at the bottom - but too many points, using the “Original” option would have yielded a likely similar result - it’s really good to have all three options - MOST of the time “arc length” is the right choice, the other two options really come in handy from time to time.

1 Like

Hi Sky - - if you could send me the input curve and the various possible rebuilds you try to get the best curve, that would be very helpful.

RH-69586 Rebuild: Point spacing by curvature

-Pascal

1 Like

CurveRebuildForPascal.3dm (137.2 KB)

1 Like