MoI discussion forum
MoI discussion forum

Full Version: Create UV curves in MoI...?

From: mat10x
27 Feb 2019   [#1]
Hi guys,

Wondering if there is way to replicate the Rhino function "Create UV Curves" in MoI? Script?

Thanks,

M
From: Frenchy Pilou (PILOU)
27 Feb 2019   [#2] In reply to [#1]
Have you seen Iso Curves ? (but I don't know what is UV Curves in Rhino! ;)
From: Michael Gibson
27 Feb 2019   [#3] In reply to [#1]
Hi Mat, for trimming boundaries it is possible to extract the UV trim curves using the script from here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=6067.23

- Michael
From: mat10x
5 Mar 2019   [#4] In reply to [#3]
Hi Michael,

Thanks so much for the script. However...I'm having 2 issues.

1. If I select the organic curved surface (non-rebuilt surface)...I get the planar boundary rectangle, which is quite a bit larger than the Rhino Create UV curves boundary rectangle.

2. I do not get the edges curves of the curved surface with the boundary curves.

Now I also have a surface that is "rebuilt". The "rebuilt" version...nothing happens, no curves at all.

Tried to select the edge curves then use the script...nothing happens either.

So I can get the planar boundary curve rectangle...but not the planar edge curves of the surface object which would be inside the planar rectangular boundary curves.

Any idea?

Thanks,

M
From: Michael Gibson
5 Mar 2019   [#5] In reply to [#4]
Hi Mat, could you please post a 3DM model file with the surfaces in it that you are talking about so I can try it over here?

I did a quick test over here and didn't see any problems with the script.

- Michael
From: mat10x
6 Mar 2019   [#6] In reply to [#5]
Hi Michael,

Sent you a PM with the 3dm file.

Thanks.

M
From: Michael Gibson
6 Mar 2019   [#7] In reply to [#6]
Hi Mat, so yes there are some differences between that script and the Rhino CreateUVCrv command.

#1 - the Rhino CreateUVCrv command appears to scale its output so it is somewhat close to the control polygon length of the surface. The MoI script does not modify the UV curves and just gives them exactly as they are.

#2 - the Rhino CreateUVCrv command also outputs the outer boundary of the UV space while the MoI script only outputs the trim curves and not an additional outer boundary of UV space.

Currently there isn't any way set up in MoI for scripts to access the additional information that would be needed to do those things.

- Michael
From: mat10x
7 Mar 2019   [#8] In reply to [#7]
Thanks Michael,

Maybe I'm missing something. From the Script link discussion above, seems I should be getting "UV space curves"....which does not show up when I use the script.

When I try to use the script on those surfaces in MoI, sometimes I get a bounding rectangle...sometimes nothing. I don't get any surface UV curves at all of any size.

I try clicking on the surface...then the script > rectangle (only visible with some of the surfaces). I also tried clicking on the edge curves...then the script...nothing.

Thx,

M
From: Michael Gibson
8 Mar 2019   [#9] In reply to [#8]
Hi mat,

> When I try to use the script on those surfaces in MoI, sometimes I get a bounding rectangle...sometimes nothing.
> I don't get any surface UV curves at all of any size.

It's working ok for me over here... But a couple of the surfaces have a UV space of around 0,0 to 1,1 so the UV curves are at a quite small scale compared to your other objects and you would need to zoom in a ways toward the 0,0,0 origin point to be able to see them.

If you have a surface where it's still not working can you please send a file with just that one surface in it to me again?

Thanks, - Michael
From: mat10x
8 Mar 2019   [#10] In reply to [#9]
Hi Michael,

From the file I sent...in the Top view...

1. Left most surface gives me a huge boundary rectangle...more than double the surface area of the object. No UV curves created.
2. Middle surface...gives me a microscopic boundary rectangle. No UV curves created.
3. Right surface (rebuilt) gives me a very very small UV curves of the surface...which appear to be compressed/shortened vs the Rhino Create UV curves.
No Boundary rectangle created.

I think I'll have to stick to Rhino for surface UV curves for accuracy.

Thanks,

M
From: Michael Gibson
8 Mar 2019   [#11] In reply to [#10]
Hi Mat, there is no exact correlation between the UV parameter space of a NURBS surface and its surface area in 3D space. The command in Rhino tries to make an approximation of it by scaling the UV curves to match the average control polygon length in each direction but the more stretched or pinched the surface will make it a worse approximation.

re:
> 1. Left most surface gives me a huge boundary rectangle...more than double the surface
> area of the object. No UV curves created.

The boundary rectangle you're seeing there is the actual UV space trim curves. You can use the "What" command in Rhino to see the surface's parameter space (info of interest in bold):

Geometry:
Valid surface.
Surface
NURBS Surface
"U": degree =3 CV count = 11 (0 <= U <= 672.204)
"V": degree =3 CV count = 7 (0 <= V <= 1240.47)

The boundary rectangle is a rectangle from 0,0 to 672.204,1240.47 which is exactly what you should be getting from the MoI script:




> 2. Middle surface...gives me a microscopic boundary rectangle. No UV curves created.

Again, the boundary rectangle given as 4 lines are the actual UV trim curves. That surface has a parameter space of 0,0 to 1,4 with 4 trim edges:

Geometry:
Valid surface.
Surface
NURBS Surface
"U": degree =2 CV count = 3 (0 <= U <= 1)
"V": degree =3 CV count = 7 (0 <= V <= 4)
Edge Tally:
4 boundary edges


> 3. Right surface (rebuilt) gives me a very very small UV curves of the surface...which appear to be
> compressed/shortened vs the Rhino Create UV curves.

Same thing here, the surface has a parameter space of 0,0 to 1,1 :

Geometry:
Valid surface.
Trimmed surface
NURBS Surface
"U": degree =3 CV count = 4 (0 <= U <= 1)
"V": degree =3 CV count = 8 (0 <= V <= 1)
Edge Tally:
4 boundary edges

Note that this is listed as a "Trimmed surface" which means its trim curves are not just 4 lines along the outer UV boundaries.


> No Boundary rectangle created

Correct, because in that case some of the surface is trimmed away by the trim curves, the trim curves are not just 4 lines along the outer edge of UV space like it is on the other surfaces.

- Michael

Image Attachments:
mat_uv.jpg 


From: mat10x
11 Mar 2019   [#12] In reply to [#11]
Thanks for the explanation Michael. Good tip on the "what' command too.