MeshToNurb doesn't respect UV

Hi,

this is an imported mesh with a test texture, just to show the UV directions.

When we use MeshToNurb, the resulting sufrace directions are puzzled:

What can I do about that?
(I know I can swap UV of the surfaces, but they are too many to do so.)

Is that scriptable, or is there a feature I don’t know of?

Here is the file:
CP_OrderedMesh.3dm(166.3 KB)

Thanks,
-C-H-A-R-L-E-S-

The attached file will have surfaces rather than meshes with the correct UV orientation.
meshtonurbcoorectuv.3dm(223.2 KB)

I did this using a simple c# script inside Grasshopper. It will work only for single faced meshes. ‘m’ is the mesh input, A is the output:

List<float> keys = new List<float>();
Point3d[] pts = m.Vertices.ToPoint3dArray();

foreach (Point2f coord in m.TextureCoordinates){keys.Add(coord.X + coord.Y * 10);}
Array.Sort(keys.ToArray(), pts);

A = Brep.CreateFromCornerPoints(pts[0], pts[1], pts[3], pts[2], RhinoDocument.ModelAbsoluteTolerance);

Hi visose,

thank you for the Grasshopper script.

Unfortunately we can’t use Grasshopper in this case, several reasons.
But your script clearly shows it is no effort to make MeshToNurb as expected…

Ok, if there is something similar as a VBScript, that would be great.
Or a fine-tuned MeshToNurb command?

Thanks,
-C-H-A-R-L-E-S-

MeshToNurb should respect UV of the mesh face by default.

A RMA comment would be ‘nice’.
Hmm?

Thanks,
-C-H-A-R-L-E-S-

Hi Charles, i`ve tried it yesterday but found the solution of visose great so i did not post it. Below is vbscript code which seems to work on your example file. (must be single quad meshes)

Charles_TxQuadsToNurb.rvb(1.1 KB)

greetings,
c.

Charles, just out of curisoity if you don’t mind answering. What would be the reason you are not able to use Grasshopper?

Simple:
I’m able to use Grasshopper, but not the customer.
For him it is a major task to execute a script…
…and for him MeshToNurb is buggy…

I don’t have exactly the same opinion, but I agree with him about the missing functionality.

Thanks,
-C-H-A-R-L-E-S-