[Solved] A question to someone with deeper knowledge of nurbs

plugging them in a point component is the way to take only the points out of the data. Unless I got it wrong.

If plugging 3d points in a point component projects the point in XY plane something is wrong with the component. It’s supposed to be a container without transforming them.

If plugging 3d points in a point component projects the point in XY plane something is wrong with the component. It’s supposed to be a container without transforming them.

Nothing is wrong and no transformation is happening - if used in a Point container it is literally using those coordinates which are meant for uv. They are uv Points (see output description says Greville uv points). Notice z is always 0.0 (which in this case is not actually z, it is w - which is like the z of a surfaces space, so 0.0 means on surface). They are meant to be used as uv coordinates. (uv means on surface) The z is there in case you want to use them as XYZ points which would be like a remapping to the XY Plane.

it is weird though, getting placed on the XY plane, perhaps this is what’s used when unrolling curved surfaces.

Anyways, some breakthrough, what if the original surface was not created using curves and loose loft, but rather a plane surface rebuilt to have different number of points and degree 5, then stretched. Would that make the surface impossible to re-make in GH using the control points from the surface, creating nurbs with these control points, and so on?

Here’s an example of such surface.
TST.3dm (135.6 KB)

UPDATE:
And this is what I try to do with GH:
TST.gh (66.1 KB)

If I may interfere …

Why not to use a script component and rebuild the surface from CVs, weights, degrees and knots ? :slight_smile:

BTW, If Loft works in GH like it does in Rhino, I think it should interpolate the curves.
If we build the curves from the surface’s CVs, they are not on the surface (except the first and last curve).
… Or am I missing something ? :confused:

Regards

Because then it’s not parameterizing the surface, but rather copying it to GH.
I want to re-make the surface in GH instead of taking anything from the Rhino surface (except for the coordinates). If you look at the files above, imagine the points in GH are made using “Construct Point” component. Then I’ll have full control over how these points move and restrict them so that each curve is not crossing the other to mess up the loft or create “bad” surface (ship-wise).

NURBS consist of 3 basic properties:

Control Points
Knots - they determine the degree and order, if periodic etc
Weights

If you retrieve these properties and create another surface with the same values, you will get the same shape +/- floating point tolerance and rounding error. You need to script this, gh components are insufficient here

Good point Tom, but is there a way to manipulate surface by changing only its knots, without touching the control points. Since as shown above my control points, degree and weigths are matching the original surface, the only thing different are the knots.

Could anyone move this thread to GrashopperDeveloper section, please?

Thanks in advance.

EDIT: nvm, I got it :smiley:

Knots are no points in 3d space. The knotvector is a list of floating numbers, determine where a subcurve starts and ends in relation to the parameter. Its more a parameter domain. NURBS are basically an extension to Beziersplines, where you can define a curve through more than one Bezier spline. Furthermore the ‘R’ stand for rational, meaning that you can weight the influence of each Controlpoint, however there are also rational (=weighted) Beziersplines.
The knot determines the degree of each subcurve (they are all the same) and the internal continuity between each segment. You can even modify the knotvector in a way thatthe first curve segment and the last segment are continuous as well = making a curve periodic.
Generally spoken you can modify the knotvector, but this has no design critical advantage.
It makes sense for Interpolation or Approximation(=Fitting) algorithms.
You can also modify the greville points when using an interpolation algorithm, but this topic is very complex and an advanced chapter of NURBS math. Its basically DeBoor in reverse. And because you have no Cps, you need to provide a third information, the knot layout, to solve for Cps. This is what the knotspacing refers to.

The most simple tutorial about Bezier and Nurbs out there:

Apparently it has critical influence on the final surface.

0696_

Is there RhinoCommon function that can manipulate Knots or KnotVectors?

I know how for curves, never tried for surfaces - it’s probably similar. - as @TomTom mentioned, fitting algorithms make most sense.

it is weird though, getting placed on the XY plane

It isn’t weird, makes sense. You have 3 numbers, a point is 3 numbers. The numbers are meant for uv but you plug them to point. The point just literally interprets those numbers as a point, even though they are not meant to be a point, but the point container doesn’t know that because the format of the data is the same as format of values it needs to make a point.

Edit: Here is what you need.
http://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_Geometry_NurbsSurface_KnotsU.htm
http://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_Geometry_NurbsSurface_KnotsV.htm

NurbsSurface nurbSrf = S.ToNurbsSurface();
nurbSrf.KnotsU.InsertKnot(uParam);
nurbSrf.KnotsV.InsertKnot(vParam);

True, but these are points that have not only local but also global coordinates. This particular component gives preview of the control points, but G also gives points, and there’s no way to extract (visualize) in order to find the differences between surfaces. The stream of data coming from G contains also planes. It’s quite natural to use containers for planes and points respectively to separate the data flow in order to visualize them at their global location. Instead of to transform uvw coordinates into xyz coordinates. This should be the behavior of GH.

Anyways, I figured out how to visualize them and get their location, using ‘Evaluate Surface’.

We have a winner!

GH component 0:

0696_

GH component 1:

0696_

GH component 2:

0696_

Result: Same control points, same degree, (apparently different knot vectors)

0696_

1 Like

Ah yes the control point loft (that’s a new component)

Happy Birthday :slight_smile: :birthday: @Michael_Pryor

1 Like

First off all you can create a NurbsSurface from scratch, I’ll post an example later.

Again, I think you didn’t understand what I am saying. The knotvector is the layout of the parameter domain and it has nothing to do with an physical point. You can create a point on a surface/curve at the knot location, but you cannot directly modify the shape on that point. In order to modify the handle at the knot parameter, you need to reverse the “de Boor” algorithm, which is interpolation. So whenever you modify a surface/curve at the “knot”-handlepoint, no matter if in Rhino or Catia you are doing a (special-case) interpolation. This algorithm is difficult and there is no function for surfaces in Rhinocommon or Grasshopper for it. I do have a surface interpolation algorithm, but I don’t like to share it on public.
I’m a bit confused, if you retrieve the 3 parameters (CP / Weight /Knots) and if you create a Nurbs-surface from scratch with the same parameters you 100 % recreate the same surface, because the fundamental “point-on-Nurbs” algorithm (de Boor) does only need these 3 information’s. The degree can be recovered from the knotvector, but you can feed it in as an additional parameter, depending on how the de-Boor algorithm is implemented

I understood what you’re saying and spent some time reading on the matter.

It’s a vector, it is defined by three float numbers, it has a starting point, it is a point. On surface or not, it has three coordinates (u, v, w=0), it can be transformed into the 0xyz coordinate space.

I understand what it is, the missing algorithm as a function in Rhinocommon is a bummer.

Yes, but at the beginning I did not have a way to retrieve the knots. Then I found a way with “Evaluate Surface”. But that’s irrelevant because I don’t want to just recreate the surface, I want to have control over it in GH. It should be as simple as entering coordinates of each control point and the knots should always fall at the same position since the weight is always 1.
Eventually I found that new component “Control Point Loft”.
Now the base part of my task is done (~10%)

This is not the main part of my task, to interpolate the surface, I can do that by manipulating the points until I get the result.
However, riddle me this: How come Loose Loft / Control Point Loft and Surface from Points create different surfaces from the same list of points, when the degrees and weights are all the same? If they all follow De Boor’s algorithm all knotvectors should be the same, hence the surfaces.

this is wrong. the term “vector” stands for a collection of floating numbers. It is not a direction vector.
In c++ a “list” is called a “vector”. A matrix with one row or one col.

this is a “knot vector” example: (0,0,0,1,2,2,2) its a degree 3 curve with 2 Bezier segments having the knot at t=1
if (0,0,0,1,1,1,2,2,2) then it would be the same curve but with an kink at t=1

Because they might not share the same knotlayout - different spacing
so: (0,0,0,0.5,2,2,2) is different to (0,0,0,1,2,2,2)

Edit: Just open up an iges file with the notepad. You will see that geometry is only exported with this properties, otherwise you couldn’t export import Nurbsdata to other CAD Platforms.
And again, there is no Grasshopper component to create a plain NurbsSurface. They all have insufficient input.

1 Like

Yeah I read that already. But still, if you extract the isocurves of a surface it passes knotvectors appear as their intersections. For me it’s a geometry vector (point), it has the 3 values for it anyhow.

:slight_smile: this is exactly what I was doing right now. Trying to find the knots there but I cannot find a proper IGES explanation what’s what.

Yeah, go figure. If knots are so essential, there has to be a way to use them as input for the nurbs surface.