Jump to content
Farmfield

Resample curve by width/pscale

Recommended Posts

Anyone know of a simple way to resample a curve by pscale/width attribute - or perhaps another way to space hulls in a sweep or alike by pscale/width so lower numbers will yield higher sampling..?

And the idea is to get more square'ish quads for a setup like this, procedurally... :)

twotimesfivetacle.png

resample.hiplc

Share this post


Link to post
Share on other sites

Man, you are brilliant with VEX. Much appreciated.

Here's the direction I went - no clue how I came up with it, my brain is just auto-piloting most of the time, it's more reaction that action - not even kidding. Now, there is a relation to be set up between the pscale, the resample segment amount and the fit min/max to get this working "right" - though so far I have no clue what that formula is, but I'm pretty sure it's there, somewhere...

twotimesfivetacle3.png

resample_squares.v1.1.hiplc

  • Like 1

Share this post


Link to post
Share on other sites

Yeah, I will put this down on paper and see if I can straighten out the relationship, and it's of course based on circumference divided by segments to get the polywire, but with my current solution, I need to resample the curve to fit the overall divisions first, then delete any other points than the segment ones - it's kinda messy, to say the least.  I have a new idea for doing this using a carve in a for loop to generate the points fed into an add SOP to recreate the curve, much cleaner, but I'll dig into that tomorrow - at the earliest.

And just to be clear, if I was in production and had this issue, I'd go for your setup in a second, but as it's more generic, playing around with problem solving (the kinda stuff in the scene files I usually post on Vimeo), so I really want to find something that's easy for ppl to wrap their head around. :)

Share this post


Link to post
Share on other sites

Oh, that's really cool, Dave. That's truly my kinda hacktastic solution. :D

And the Facebook thread on this generated talk about doing this in CHOPs, so hoping for a scene file on that today or tomorrow, then I'm gonna compile the solutions into a list and zip the files for download (or collect them in a single scene file) - always great to be able to look at a different solutions for a problem, see how different people approach it.

Share this post


Link to post
Share on other sites

:) Love these explorations! Looking forward to seeing an example of a CHOPs solution, seems ideal for this task.  Need to learn more CHOPs, not enough time in the day...

Share this post


Link to post
Share on other sites

Absolutely. The differential curve growth thread is a great example on that as well.

And there's a lot more on this subject on the Houdini group at Facebook, in a way kinda sad the know how is so fragmented now, with the Facebook group and the Discord chat/community - forums are truly the best way to do this kinda thing, imo, as Wiki's are the best way to organize and present information - Facebook and Discord is more about the moment, not some great solution from 2 years ago, as I find at OD Force all the time.

Share this post


Link to post
Share on other sites

These are great, i had to register to download these examples but id already figured it out based on Daves comments.

not very good with VEX so this is done with a relax node and a resample before and after followed by moving the points back to a saved rest point like Dave did. this solution is nice cause i can 'paint' detail in a way... needed it for the below example where i wanted more resolution in a specific area we where the camera would be focusing!

thanks everyone for the tips!

2017-09-03_17-47-34.thumb.gif.4f1f6d91750a1de9024b371cbb53b01b.gif

hindie_2017-09-04_02-05-19.png

Edited by LorcanOS

Share this post


Link to post
Share on other sites

Funny enough, this was again asked in the Houdini Artists Facebook group and I had completely forgot about asking this back in April... Either way, here's two other SOP based solutions to this problem, the second one a bit of a joke, of course - though I have no doubt that method can be useful for some things as well... :D

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

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

Share this post


Link to post
Share on other sites

Cool, clever use of foreach and minpos! :)  Does seem like that could come in handy for other stuff.

Looks like both links point to the same file though?

--Dave

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

×