Bezier to Nurbs

It doesn’t have a BezierToNurbs command but perhaps it should per the discussion above.

Earlier today in this thread you mentioned:

and I responded quoting the above:

You responded, I replied, etc.

Hallo,

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.

Or perhaps I am confused.

– Dale

It’s not a Rhino command, it’s a function in the RhinoCommon API (what Grasshopper is based on).

https://developer.rhino3d.com/guides/rhinocommon/

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BezierCurve_ToNurbsCurve.htm

– Dale

@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.

Hi @davidcockey,

Our SDKs allow you to create Beziers in memory. Thus, functions exist to convert them to NURBS if needed.

– Dale

Hallo David,

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?

Hi Dale,

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.

Hi @JoergH,

Rhino’s MergeSrf command will do this. The result would have fully multiple knots everywhere.

If you inclined to use RhinoCommon, the function is Brep.MergeSurfaces.

– Dale

Hallo Dale,

thanks a lot. Is there an easy way to get rid of the fully multiple knots?

Best regards

Hi @JoergH,

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.

Thanks,

– Dale

The problem has been stated clearly and often

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.

Hi @jim,

That may be true. But I want to hear what problem, exactingly, this customer is having.

Thanks,

– Dale

Hi Dale,

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.

Hello - if your 5 by 5 surface is degree 3, then you will indeed get multiple Beziers out but if you can make them degree 4 by 4 and 5 points, your troubles should be gone… is that a possibility in your process?

-Pascal

Hi,
no, we´ve got polysurfaces made from single 4x4 deg3 (“Bezier”) Surfaces, that we want to convert into one single nurbs surface.

Hi Joerg -
OK. I was wondering really about this earlier part of the process:

I thought if you could start with degree 4 by 4…

-Pascal