ConvertToBezier Not a facetious answer as Iâll explain below.
A set of single span, non-rational curves or surfaces, presumably with appropriate level of continuity between them.
I sometimes have a polycurve or a polysurface which could be a single multi-span curve or multi-span surface without multi-knots or stacked control points. Currently using Match with the Merge option for curves or MergeSrf for surfaces usually resulst in more control points and more spans then the sum of the components of the original polycurve or polysurface. If a BezierToNurbs command existed which creates a multi-span curve with the minimum necessary number of spans and control points from a set of Bezier curves, or which creates a multi-span surface with the minimum necessary number of spans and control points from a set of Bezier surfaces then I would use ConvertToBezier to change the polycurve or polysurface into a set of Bezier curves or surfaces, and use BezierToNurbs to obtain the multi-span curve or surface with minimum number of spans and control pointsâŚ
Ah yes, there is the ConvertToBeziers command, which does convert each span of a NURBS curve or surface into itâs Bezier form. In the end, however, the Bezier end up in the Rhino document as NURBS, as Rhino does not have a Bezier object.
If a Bezier curve and a non-rational single span curve with clamped end knots have the same control points, then they have the same curve geometry and normalized parameterization.
If a Bezier surface with degree (d1,d2) and a non-rational single span NURBS surface with degree (d1,d2) with clamped end knots have the same control points (bez.CV(i,j) == srf.CV(i,j)), then they have the same surface geometry and normalized parameterization.
I donât believe Rhino has a command that does this.
might be that I donât get it all cause of missing knowledge of Rhinocommon and or non native Speaker:
When Rhino is based on Rhinocommon: what command is using the function beziercurvetonurbs? What is this for? How does it work? Does it reduce the amount of controlpoints as much as I mentioned before to the minimum?
As I mention in my last reply, after the ConvertToBeziers command converts each span of a NURBS object into itâs Bezier form, the Beziers are added to the document as NURBS objects. Thus, there is no need for a BezierToNurbs Rhino command - there are no Bezier objects to pick and/or convert.
@dale What is the use of the beziercurvetonurbs function if Rhino does not have specific Bezier objects? Is it used when importing geometry from other systems? Iâm just curious.
i can remember reading some interesting approach by iteratively approximating the curvature with few CPs. here smarter-rebuild-nurbs-curves-and-surfaces the definition was unfortunately not posted, maybe @maje90 would be so kind?
simplifying higher degree Curves other than circles or lines is something which should be natively implemented into Rhino, i am sure thats on the wishlist of many. other software packages have âsimplerâ rebuild functions either.
The difference between the Bezier format and Nurbs format of your single span curve is that the Bezier form has no knot vector. Beziers are defined by just the control points. Of course making a knot list for a Bezier is trivial.
In order to evaluate or calculate with a curve, Rhino apparently needs to have the knot list in the data base. The alternative would be to treat a Bezier curve as a special case which it seems they do not want to do.
Make sure to use RemoveKnot which rearranges the control points so the shape is not changed if the continuity between spans is one degree less than the degree of the curves
works great. Two times removal of the middle knots and i get exactly the control point location of the 5x5 points deg 3 nurbs surface that I had converted to bezier. Would be great if this could be done in grasshopper automatically, but I donât see an easy way to do that. Do you have a an idea?
I think there is still some confusion about what we want. We donât care if the beast is called Bezier Curve or Surface or single Span unweighted nurbs or whatever. We are just interested in reversing the nurbstobezier command. I might have better called it "polysurface made from singlespan surfaces to single multispan nurbs, instead of using the word bezier.
Can we step back a little? I Want to understand more about what you are trying to and, perhaps more importantly, why? What problem are you trying to solve? Why did you âconvert to Bezier?â Why do you want to go back? Feel free to upload any models, images, etc., that help illustrate your problem.
The basic idea is to have a function that removes fully multiple knots when those knots are not contributing anything useful and are getting in the way.
It doesnât matter how those fully multiple knots were created. There are numerous ways that the multiple knots could be created. It could be as a result of merging, but it also could be as a result of offsetting or it could be as a result of using ExtrudeTapered. How the superfluous knots came to be is irrelevant. If the surface or curve shape remains the same (within tolerance), there should be a function to get rid of them easily.
The user can use Removeknot but that can be a long process that is both tedious and not always reliable.
Any chance you tried fit surface after merge? (It doesnât always work) There is the command in Rhino and also Pufferfish has a component for it. You can also find it in Rhinocommon.
If the knots are truly not useful to the shape it should get rid of them I think.
well, to take a nurbs surface with 5x5 controlpoints, convert this to bezier, and try to reverse this process is just a sample for trying out the process. In reality we sometimes get polysurfaces, that are made of 4x4 cp âbezierâ surfaces as a result from export of other software. In order to manipulate these polysurfaces - lets say modify these complete surfaces, and or fair these shapes (manually - moving cps) it is easier if we have this polysurface converted to one single nurbs surface with as few cps as possible, while not changing the shape of that surface. The alternative is to build comletely new surfaces while taking the polysurface only as a reference. But this can take weeks to perform - depending on tolerances. As we already have all the data we need, just in a wrong format this does not make too much sense.