Bezier to Nurbs

unhandled
#1

Hallo,

Rhino includes converttobezier, so I can convert curves and surfaces in this direction. But what if I want to convert from bezier to nurbs? I can do that manually for curves, but thats too much work. Does anBody have a script or gh definition for that?

Joerg

#2

Beziers are a subset of NURBS, there’s no way to go “back,” it already is NURBS just of a particular arrangement, whatever information was lost in the conversion process is gone.

#3

Hallo Jim,

I’m sorry, I meant simple unweighted Bsplines.
I know that the curves must be continius to do the conversion…It’s only meant for these simple cases.

(David Cockey) #4

In regular Rhino use Match with Curvature continuity checked and Merge checked, followed by RemoveMultiKnots.

(David Cockey) #5

@JoergH This thread is in the “Hardware” category. You may want to change it to “Grasshopper”.

#6

Hallo David,

I’ve tried this, but the surfaces seem to get a lot more control points than necessary, and the form changes.

best regards

Joerg

(David Cockey) #7

I was talking about curves, not surfaces. I’ll look into surfaces.

#8

Ok, thanks - changed

#9

Great.

Let’s say I have 4 simple Bezier deg 3 Surface with each 4 control points=16x4 =64 control points, and I would love to get the same 5x5 Bspline Surface with 25 controlpoints. The idea is to reduce the number of control points, and get the"free" continuity between spans by doing this.

(David Cockey) #10

MergeSrf with Smooth=No and Roundness=0
RemoveKnot repeatedly in each direction until the surface changes shape. Experimentation may be needed to discover where and how many times to remove knots.

If the surface started as a non-rational surface and was converted using ConvertToBezier the original surface should be able to be recovered.

(Dale Fugier) #11

Hi @JoergH,

If you are comfortable with RhinoCommon, you can use BezierCurve.ToNurbsCurve.

– Dale

(David Cockey) #12

@dale

Will there be a regular Rhino BezierToNurbs command in the future?

#13

Thanks a lot.

Tried it for a planar surface, and it seems to work. One needs to know the pattern to understand which controlpoints have to be removed. Will try it later for some more real surfaces.

#14

Thanks for that information.
I am new to Rhinocommon. What is the best way to start using it?

(David Cockey) #15

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 (G2 between spans for degree 3 curves.) . Do not use RemoveControlPt which does not affect the remaining control points and the shape will be changed.

#16

Ok, I’ll try that later.

(Dale Fugier) #17

Using just Rhino command, how would you create a Bezier curve?

– Dale

(Dale Fugier) #18

I’d use a C# Script component. But a GhPython Script or VB Script component would work too.

– Dale

#19

Ok, thanks a lot. I’ll try that. But this is only for curves? Or could it be possible to extend this to work with surfaces?

(Dale Fugier) #20

RhinoCommon doesn’t expose a Bezier surface object, although there is on in Rhino. The the quick answer is no I guess.

– Dale