xyz--> u value :oops:

   5718   9   3
User Avatar
Member
49 posts
Joined: July 2006
Offline
Howdo, stuck again.

How do you get a u value of a curve from the xyz of a point on that curve? This is following on from
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=29863#29863 [sidefx.com]
so I am expecting 2 values for u at the point of intersection.

I think i have seen xyz used to modify textures but i am not sure how to go about it. would it be someything like the reverse of ‘xbu’ in the curve sop? if it gets 2 values willit melt houdini?

yours ponderously

Ed
User Avatar
Member
2199 posts
Joined: July 2005
Online
check out the pointdist expression, it can return the closest parametric u or v to a point. That point can be made to match your xyz position.
The trick is finding just the right hammer for every screw
User Avatar
Member
49 posts
Joined: July 2006
Offline
cool , but how will that work with 2 values for u at the point?
User Avatar
Member
2199 posts
Joined: July 2005
Online
Unfortunately it would only return the one it deemed closest…
The trick is finding just the right hammer for every screw
User Avatar
Member
49 posts
Joined: July 2006
Offline
unfortunatly I will neet to be able to choose between the u values for a future transformation
User Avatar
Member
49 posts
Joined: July 2006
Offline
Well i'm a little further for anyone following this.

Realising I could find the u value another way I have created an atribute to add a ‘u’like possition along the curve to the point as $PT*(1/$NPT) where (1/$NPT) is the length of each segment after resampling along the curve.

All i have to do now is compare the xyz with the intersect points to get the ‘Uvals’ of any intersect. Any ideas on how to do that? :roll:
User Avatar
Member
49 posts
Joined: July 2006
Offline
droped the hip file.



…Here it is

Attachments:
intersecttest_curve_v4.zip (100.0 KB)

User Avatar
Member
49 posts
Joined: July 2006
Offline
for anyone following this. I got this useful repluy from BenS on the lists

************************

Just had a solution that might work in some cases.
First I split the curve in two curves with a carve sop (named carve1).
That carve sop has the “First U” set to 0.5 and toggled on both “keep
inside” and “keep outside”
Then append another carve to the original curve and add the following
expressions in the U fields:
First U: primdist(“../carve1”,0,“../carve1”,1,1)
Second U: 1-primdist(“../carve1”,0,“../carve1”,1,1)

This cuts of the bits outside the intersect… I geussed this is what
you ant to do.
Else the expressions will just give you the U values.
This solution might not work if the intersect takes place within one
half of the curve.
In that case you have to split up the curve more and somehow pick the
most suitable U values.

You probably want to read the manual on the primdist() function to fully
understand what it does.
it might at least help with your “collision” bits..

cheers,
benS
********************
I got my u but still working on colision test
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
A bit of trival info on Carve. It keeps the parameterization of the cut curves and surfaces intact. If you cut a curve in half then either use a Basis SOP (be very careful not to re-parameterize the curve, just read the basis) to view the parameterization or dump out to a .geo file of the original single curva and the cut curves then inspect with a text editor, you will see that the cut curves retain the same parameterization as original whole curve.

What does this mean? If you locate a parametric u or v location on a cut curve (with primuv or other methods, yes there are other old school ways), it will be the same location as the original curve. From this you should be able to piece your entire system together. Reference the cut curves and apply the edits to the original longer curves.
There's at least one school like the old school!
User Avatar
Member
2199 posts
Joined: July 2005
Online
If you do that you will probably need a basis sop on the original curve first to make sure the parameterisation is in the range 0-1 otherwise it won't make the u carve range. This will depend on how the original curve is made though. If it comes straight from a curve sop you'll probably be ok.
The trick is finding just the right hammer for every screw
  • Quick Links