Grasshopper

algorithmic modeling for Rhino

I'm trying to use to] script in 06.0059 to swap the UV of a surface according to a guide surface. I can't get it to work and only get null outputs. I also can't update to v07 as this is the final piece of a much bigger file constrcuted in v06.

Can anyone spare 2 minutes to put together the component and post it please??

The link is here http://www.grasshopper3d.com/forum/topics/switch-uv-coordinates?id=...

Thanks all

Leon







Views: 1508

Reply to This

Replies to This Discussion

OnSurface.Transpose will still do what you're looking for. Is there anything else that you need?
Hi Damien,

Thanks but I still can't get it to work. I'm not too good with the vb thing as yet. The component to] has written sounds perfect for what I need but can't get it to work.

I am unrolling curved surfaces with the centroid as a referencing point but some surfaces has a switched UV direction and this causes problems with the relative uv points of the curved and flattened surfaces not aligning. I need a guide surface to determine that all the surfaces are uv aligned the same. Just as this is supposed to do:

If srf Is Nothing Then
Return
End If

Dim vec01 As On3dVector = New On3dVector
Dim vec02 As On3dVector = New On3dVector

If G Is Nothing Then
srf.Transpose()
Else
'Reparameterize
srf.SetDomain(0, 0, 1)
srf.SetDomain(1, 0, 1)
G.SetDomain(0, 0, 1)
G.SetDomain(1, 0, 1)
Dim num1 As Integer = 0
vec01.Set((srf.PointAt(0.5, 0.5).x - srf.PointAt(0.0, 0.5).x), (srf.PointAt(0.5, 0.5).y - srf.PointAt(0.0, 0.5).y), (srf.PointAt(0.5, 0.5).z - srf.PointAt(0.0, 0.5).z))
vec02.Set((G.PointAt(0.5, 0.5).x - G.PointAt(0.0, 0.5).x), (G.PointAt(0.5, 0.5).y - G.PointAt(0.0, 0.5).y), (G.PointAt(0.5, 0.5).z - G.PointAt(0.0, 0.5).z))
num1 = vec01.IsParallelTo(vec02, 1.5707963267948966)
If num1 < 0 Then
srf.Transpose()
End If
End If


A = srf

Any chance you can put this into a working v06.0059 component i can download?

Many thanks

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2019   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service