Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Farmfield

Resample curve by width/pscale

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

1 person likes this

Share this post


Link to post
Share on other sites

what if you simply calculate the circumference and divide it by the number of polywire´s division?

resample2.hiplc

 

3 people like this

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

Here's another hacky way to do this, abusing a rest attribute to restore point positions after scaling by inverted pscale/resampling. Minimal code at least... ;)

--Dave

resample_withRest_DS.hiplc

1 person likes this

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

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