[Sidefx-houdini-list] uv's along a nurbs spline

Jeff Wagner jeff at sidefx.com
Tue Jan 31 08:22:39 EST 2006


Here's a simple hip file example that builds you the arc length of a 
curve or face.  Points have to be in order.

It is a simple matter to convert this to just return the edge length 
between points. It would be more efficient too!


-jeff

Phillip P Prahl wrote:

>Hey,
>
>So I came up with something that seems a bit more accurate but not so
>elegant ...
>here is the network:
>
>1. curve sop
>2. texture sop set to arc length spline
>3. point sop that runs arclen() for each of the points using the uvs and
>uses the result as the new uv.
>
>This could then be normalized... with the measure sop as Dan described.
>Thanks again for the help!
>Phillip
>
>
>
>
>
>
>----- Original Message -----
>From: Dan Seddon <dan.seddon at framestore-cfc.com>
>Date: Monday, January 30, 2006 12:58 pm
>Subject: Re: [Sidefx-houdini-list] uv's along a nurbs spline
>  
>
>>You can use the Measure Sop to calculate the "Perimeter" then 
>>multiply 
>>this against the uv's you've just made and that should give the 
>>length 
>>along the spline. You can use Attribute Promote to get the 
>>Perimeter 
>>Attribute into the context of a point expression easily.
>>
>>Ta
>>
>>Dan
>>
>>    
>>
>>>So is there no way to get it to calculate the
>>>actual length? Only the linear values?
>>>Thanks again!
>>>Phillip
>>>
>>>PS I figured the maya comment would get people to respond 
>>>      
>>>
>>furiously fast.
>>    
>>
>>>----- Original Message -----
>>>From: Dan Seddon <dan.seddon at framestore-cfc.com>
>>>Date: Monday, January 30, 2006 12:48 pm
>>>Subject: Re: [Sidefx-houdini-list] uv's along a nurbs spline
>>> 
>>>
>>>      
>>>
>>>>Phillip P Prahl wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Hey,
>>>>>
>>>>>I'm trying to map a U value along a NURBS spline.
>>>>>
>>>>>Imagine a spline that has 4 points:
>>>>>1. 0,0,0
>>>>>2. 0,0.25,0
>>>>>3. 0,0.60,0
>>>>>4. 0,1.00,0
>>>>>
>>>>>Now all I need is the uv's to reflect the distance
>>>>>between these points so that the u value would be:
>>>>>
>>>>>1. 0.00
>>>>>2. 0.25
>>>>>3. 0.60
>>>>>4. 1.00
>>>>>
>>>>>This could obviously be done by merely mapping $TY to $MAPU.
>>>>>However, now imagine a nurbs curve that twists and turns -
>>>>>I need the u value to reflect the length along the curve
>>>>>to any given point (the arc-length or chord-length).
>>>>>
>>>>>Hope someone has an answer ...
>>>>>Thanks for your time,
>>>>>Phillip
>>>>>
>>>>>PS Maya does this automatically :)
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>Yup - but unlike Maya, Houdini gives you a choice ;)
>>>>
>>>>Get a UV Texture Sop and set it to Texture Type: Arc Length Spline
>>>>and Apply To: Point Texture
>>>>If you want your UVs to be between 0 and 1 then first you'll need 
>>>>to do:
>>>>Basis Sop->Map:
>>>>
>>>>     Origin = 0
>>>>     Length = 1
>>>>
>>>>You'll only get the exact result you ask for above if your nurbs 
>>>>        
>>>>
>>is 
>>    
>>
>>>>linear however.
>>>>
>>>>Cheers
>>>>
>>>>Dan
>>>>_______________________________________________
>>>>Sidefx-houdini-list mailing list
>>>>Sidefx-houdini-list at sidefx.com
>>>>https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>Sidefx-houdini-list mailing list
>>>Sidefx-houdini-list at sidefx.com
>>>https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>Sidefx-houdini-list mailing list
>>Sidefx-houdini-list at sidefx.com
>>https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>
>>    
>>
>_______________________________________________
>Sidefx-houdini-list mailing list
>Sidefx-houdini-list at sidefx.com
>https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>  
>


-- 
Jeff Wagner, jeff at sidefx.com, Senior Technology Consultant
Side Effects Software, www.sidefx.com, Toronto, Ontario, M5V 3E7
tel: (416) 504-9876, fax: (416) 504-6648



More information about the Sidefx-houdini-list mailing list