There are any tool or functions to have a “smarter” rebuild curve?
Sometimes I need a smooth curve (curvature continuity) … and I just set something like degree=5 , a not-too-high division count and end it like that…
But when I need a light curve/surface I have to use few control points and then I manually correct the curve to the original (pre-rebuild) curve.
curves.3dm (49.6 KB)
Red is rhino rebuild curve function; there are some “great” gap
Green is manually adjusted in 30 sec… by instinct or “heuristically”…
Has it ever been done a function/command/plug-in to do this automatically?
Please tell if I was not clear enough.
Edit: I’m interested to know also if any other software have a function of something like this… do someone know?
Actually no. I’ve never used that command (either in rhino or grasshopper).
Thanks for pointing it out.
But… tooltip in grasshopper says “Fit a curve along another curve”… and there is only one curve input…
In rhino too: you just feed it a curve and a tolerance.
I’m not getting at all how it should be used…
There are some examples?
Edit: also it seems it drastically increase control point count… not what i’m searching for…
That too is new stuff for me. Thanks.
But results are somehow very similar to normal rebuild.
I’ve tested just now some curves: again results are “improvable” manually (by dragging control points).
I hope to not offend anyone in mcneel… but those functions do not seem “smart” in any way (and maybe were never designed to be).
I often find myself rebuilding curves made of arcs from some “designer”… and we all know that a degree 4+ curve is much smoother (and better to see) than a poly-arc curve.
Rebuiding with just many points add small “waves” and such in the shape… fewer but well-placed control points are always better… that’s my idea.
I’m asking because I have some idea in mind for an automatism… but I didn’t want to waste time on it if someone already done something similar somewhere… (even outside rhino environment)
I don’t think anyone will get offended by you pointing out the limitations of math. You are telling rhino to rebuild something with fewer points/higher degree and it will follow your input as close (even down to the kinks and ugly transitions) or as smooth (interpolation and deviating from the not so great input) as you want.
Fit curve description is a little confusing. What it means is its fitting a new curve along your input curve. Essentially it redistributes control points based on curvature so that the newly generated curve only deviates from the input curve by a set tolerance. It is great for making better structured curves especially if you plan to loft or tween (that’s why loft has a refit option). The downside is it may make many control points depending on your curvature.
So I would say fit curve is best used for when you have many curves that need to do something together (loft) but the profiles are important to keep.
It seems like rhino/grasshopper rebuild function “waste” points at the start/end of the curve (even if “preserve tangents” is turned off).
As just said, at first I still used the rhino rebuilt curve as first step of the re-fitting… but then I’ve found that using point from evenly dividing the original curve is advantageous.
This is slow, iterating … (and my code is completely messed up, no closed curve support, etc, etc…)
Something better than this?
Even just some theory behind…
I never actually though about 3d curves! … serendipidly it seems it works just the same.
Static ones are standard rhino rebuild (with again same point count and degree).
At first i’m doing some single step in the iteration (so there’s actually chance for a “light” function), but then i let the iteration go as rightest curve needed more fitting…
(indeed i’m choosing the minimum amount of control point so the curve actually can be rebuilt without significant shape lost, like again doing it manually… almost voluntarily putting contrast to rhino rebuild function… if I put too few points both give ugly result, as well as with too many points both give good results)
I wasn’t sure if I should (or wanted to) be jealous and keep for myself this… oh well…
Basically the idea was to pull a “portion” of the fitting-curve to the reciprocal “portion” of the original curve.
Like, the start point with the other start point, end with end, mid with mid… and so on.
I randomly discovered Greville points… (didn’t know the name).
For every iteration it:
-make a list of vectors from fitting curve to original, as said above (by equally lenght-subdividing both curves)
-for every Greville point making a sub-list of the vector list, picking only the near ones (near by curve parameter)
-for every Greville point, moving the corrispective control-point by the average of the vector sub-list
The Greville points “know” where to go by looking at the local vectors… so if a part of a curve is “shifted” behind of where it should be the vectors clearly tells it out.
Probably gifs tell more than all the words…
(vectors scaled down for the sake of human view; vectors 1x give decent results in few iterations)
Just as background, the big difference between most curve fitting/rebuild algorithms and what you’ve implemented is that you’re changing the curve parameterization.
The advantage of keeping the parameterization the same is that the refit is a linear system, which makes it have a single solution, and fast to compute - you can use a direct solver instead of an iterative solver. The disadvantage is that the fits might not be optimal (if you don’t care about curve parameterization).
Now that CPUs are so much faster than they used to be, it makes sense that nonlinear solvers are more feasible.
One thing you might want to try is translating the original curve out of the plane, and then loft between the original and the refit. That will show you how much the parameterization is changing between the two.
Riccardo,
As interesting as this discussion is, it might be in your best interest to fall silent on the Forum and pursue the matter privately. A smart(er) Rebuild command could be (in my view as an endlessly frustrated rebuilder) a real Godsend.
Michael
That make sense.
I think the “problem” here is my personal viewpoint of Nurbs curves.
As I knew them time ago, I really appreciate them for the smoothness of the shape (for a natural shape I always want a degree=5 one, not less).
So, everytime I rebuild a curve with many points (to avoid shape-loss) I end up with a curve with, indeed, linear parametrization (useful for loft and many other situations), but with also many “wrinkles” in the curvature…
It’s a compromise for me.
Using a nurbs curve in that way seems a waste for me, an improper use of a tool… or even worse like: “we have nurbs, but let’s use high-detailed polylines anyway”.
I found myself always capable of re-drawing a complex shape with so many points, tanks to nurbs.
Using back again many points seems like going back in time.
(I am being redundant?)
So in the lack of the other counterpart, I made the opposite of that compromise: another compromise where linear parametrization is lost, but shape is kept and curvature is smooth… with few points!
Maybe working with weights would… no, maybe knowing what weights are would help in this matter… I have no clue.
(again, maybe what I’m writing here is total nonsense… I have just high-school math knowledge)
I’m almost doing this for fun, for hobby.
It started with me searching for something… and then I found myself creating what I was searching for in an afternoon.
I’m seeing a lot of free tools (plug-ins and such) in this environment… I’ve learnt so much stuff just messing around in the forum, the more I share the more I get. (is it so? )
I’d very like to use this stuff (grasshopper in general) for a living, but I have no idea where to start with.