Resample a Curve with a Ramp

   7836   11   4
User Avatar
Member
10 posts
Joined: Dec. 2010
Offline
Hi,

this is my very first post here in the forums. I've installed Houdini Apprentice and started playing around (finally, after a few years) and I must say I'm really, really impressed with the possibilities it offers and now I've only scratched on the surface. I'm playing with Blender and MODO as a hobby and would like to dive into procedural modeling. Its amazing!

Now I'm trying to resample a curve.
What I got:

A Polycurve -> Convert(to nurbs) -> Resample

Here I would like to use a float ramp to drive the “Length” parameter of the Resample node. I bet it's possible, but I don't know how.

Thank you all for your kind help, Gregor
User Avatar
Staff
3462 posts
Joined: July 2005
Offline
I don't think it's possible…
the Length parameter determines the length of the segments…

if you want a curve that has a controlable number of points - try the scatter SOP using a variable on the points
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
10 posts
Joined: Dec. 2010
Offline
Thank you for your hint, you are right, the length parameter seems not be useable for that. I will take a look at the suggested scatter SOP.

Maybe I can try to “travel” along the curve and generate after a distance points. Something like that.

Fascinating software. Thank you for provide an apprentice version. I think after getting something done I will switch to indie.
User Avatar
Member
4692 posts
Joined: Feb. 2012
Offline
I think ndickson had a tool that adaptively resamples a curve, so it could be adapted to use a ramp too.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
150 posts
Joined: May 2011
Offline
I have an otl which does not do exactly what you want but might still be sufficient for your usecase. It does not generate the points based on a length, but it uses existing points and shifts them along the path according to a ramp or a channel (for additional control).
It's a little bit weird to use, but it is just remapping the old position to the new position. When using the channel mode the horizontal range is 0-1 while vertically you can use as much as you need as it is remapped automatically.

Unfortunately it only works well with polylines for now so you have to convert to NURBS -> Resample -> Pointshifter

Cheers,
Dennis

Attachments:
pointshifter_SOP.otl (12.0 KB)

Technical Reel 2015 [vimeo.com]
User Avatar
Member
10 posts
Joined: Dec. 2010
Offline
Thank you for the otl, I'm studying it right now. It seems to be useful for my learning project. Right now I'm trying to understand whats going on.

Thank you all for your suggestions and help!
User Avatar
Member
65 posts
Joined: Sept. 2014
Offline
Someone posted a question about this in the Houdini ARtists group on Facebook and I found this thread looking for a better solution - but here's one way…

https://drive.google.com/open?id=1mjJd0vd9KUSFW79ksRc5fioeMxXnu6Bu [drive.google.com]

But there's gotta be something even more simple, like really simple - there almost always is.
~ Messing about with pixels, vectors and voxels since 25 years [vimeo.com] ~
User Avatar
Member
648 posts
Joined: July 2005
Offline
see attached…

Attachments:
resamplecurve.hipnc (142.9 KB)

User Avatar
Member
45 posts
Joined: Feb. 2014
Offline
This method uses a ramp parameter, and a wrangle node, that generates a new curve. Though I think cpb method is better, this method is nice since us novices won't ask why we need to use the animation editor…
Edited by anon_user_00157425 - Nov. 11, 2017 23:22:59

Attachments:
resamplecurve_wtihrampparm.hipnc (70.6 KB)

User Avatar
Member
495 posts
Joined: July 2005
Offline
Hi,

I've tried to create a very minimalistic ramp based resample wrangle.
First you apply the normal resample operator on the curve. After this you have uniform distributed points along the curve (point distances to neighbours on the curve are equal - which is the same for the u-coordinates).
Now if you want to have another distribution (which is non-deacreasing function to (0,1)), if its inverse exists, this will be the function you have to apply to make the points distributed this way.
In short words: make sure that the ramp is non-decreasing function (from (0,1) to (0,1) default).

My example is similar to to example from cpd, but without doing coloring stuff or something.
@Bishop
I haven't understand, how your example works, because your function seems to be a density function.
I have no idea to use a density function efficiently, since u have to integrate it and calculate its inverse, but perhaps there is nice solution to do that.
Edited by Aizatulin - Nov. 12, 2017 03:35:00

Attachments:
ramp_resample_w.hipnc (72.8 KB)

User Avatar
Member
45 posts
Joined: Feb. 2014
Offline
Density function… if you say so… I'll take your word for it


All I did was get the height of all the values on the ramp at the sample rate(1/pt_cnt)then with that you can simply walk down the curve scaling the length because the ramp and the curve's parametric space are both 0 to 1 on the U axis.
User Avatar
Member
495 posts
Joined: July 2005
Offline
Hi,

yes it seems to be more like a negative point density function, it's more like a speed density function (higher speed –> bigger distance between points), but nice solution.
  • Quick Links