Jump to content
cristobalvila

Using 1-$PCT doesn't gives precise results? (SOLVED)

Recommended Posts

Hi guys,

 

We can use $PCT in the Sweep Scale parameter and will get a linear scale from 0-1 along the backbone. That is great and fast!

 

But, why using 1-$PCT does not give us a precise result?

 

As you can see on attached image, both extremes on right sweep are bigger than on left one. It's obvious on the thin end, but also occurs on thicker one…

 

$PCT gives us an 0.0 ... 0.25 ... 0.75 ... 1.0 scale

1-$PCT should give 1.0 ... 0.75 ... 0.25 ... 0.0 scale, right?

 

The same problem occurs when using a ramp: chramp("profile", $PCT, 0) It works perfectly fine at first stage, but if you change your first ramp point control from 0 to 1 and last one from 1 to 0 it clearly appears that the thin extreme is NOT zero size… (?)

 

Maybe I'm misunderstanding something obvious?

 

THANKS for your feedback!  :)

 

NOTE: these alternatives works perfect…

$PT*(1/($NPT-1))

1 - ($PT*(1/($NPT-1)))

chramp("profile", $PT / ($NPT - 1), 0)

…but it really intrigues me that the more simple $PCT has this problem.

 

sweep_invert_PCT.png

Edited by cristobalvila

Share this post


Link to post
Share on other sites

Aha! Yes, you are right, it gives a nice result once you resample the NURBS!

 

However it seems a “curious” thing to me that, even without resampling, it works fine in one direction ($PCT) and “not so fine” in the opposite (1-$PCT). Something related with NURBS interpolation or something… I suppose…

 

In the other hand, without resampling, it works fine using $PT*(1/($NPT-1)) and 1-($PT*(1/($NPT-1)))

 

Big thanks for your help, Pradeep!  :)

 

Share this post


Link to post
Share on other sites

Cristobal, as part of your Houdini Borg-like assimilation ( :P ) I think you might want to take a look at this version I just did on your scene. This allows for fine control on the width even if the sweep node would normally wouldn´t allow a given variable. This trick using the point expression is handy to circumvent "limitations" on a given tool.

 

Maybe you already know this, but when I discovered this myself it was a big "a-ha!" moment for me.

 

 

 

sweep_invert_PCT_VOPforTheWin.hipnc

  • Like 1

Share this post


Link to post
Share on other sites

 Damm! Thank you so much for this alternate version, Netvudu!  :)

 

I think that I follow the net (more or less), although that green operators… ufff, I need to learn some more basic things before completely understand. Specially that expression in the Atribute VOP:

 

vcc -q $VOP_INCLUDEPATH -o $VOP_OBJECTFILE -e $VOP_ERRORFILE $VOP_SOURCEFILE

 

Of course, I will save your example as gold for further reference and study! Step by step…

 

-----

 

A different issue: trying to open your file in Houdini 13 I received lot of warnings, and then I saw I can open in 14…

 

Is there some way to save this 14 scene to open with 13?

 

(it occurs that even if I instaled the new 14, it doesn't run fine on my system… and I plan to continue learning for some months on 13, until I acquire a brand new machine…)

 

Thanks again for your great help, guys!

Edited by cristobalvila

Share this post


Link to post
Share on other sites

I did save this from Houdini 14 (I work in H14 Indie) so it´s expectable to receive some warnings from H13.

 

Regarding that expression in the Point VOP, don´t worry about it. This expression appears by default with the node. It´s a default expression to check for paths and errors while compiling VEX on the fly for the VOP node.

 

What´s important in that file is the use of custom attribute to control a parameter with a ramp, and the use of the point expression in the sweep node to check any attribute value at any other point in the network.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×