Search - User list
Full Version: How to set a uniform curve direction across multiple curves
Root » Houdini Indie and Apprentice » How to set a uniform curve direction across multiple curves
Flakked
Hiya,

So, I'm trying to generate some wall meshes using the chain sop over several curves, which are representing a given building's floors. Everything is seemingly going fine, with the exception that some of the curves are oriented in a different direction, leading to flipped wall meshes in the chain sop:




Some google hunting I've done has brought up concepts like hijacking a cylinderical UV operation, custom polyframe, sorting, ect. but I wasn't really grasping some of those solutions, or if they were going to work for my situation. I've noticed the chain sop itself has some alignment tweaking too. I have a hunch a custom attrib here may be the solution? Still wrapping my brain around Houdini in general, if that hasn't been obvious yet heh.

I realize I can manually go in and reverse the individual curves, but the end goal here is to propagate this sort of generation over several different building proxy meshes. (I'm also aware of the Labs Building Gen sop. Main goal here is to better understand the houdini worfkflow with a basic version of that sop.)

Any tips on this would be greatly appreciated! It seems like a simple idea in concept, but not sure what direction to head in.
(HIP attached for context)

Image Not Found
raschberg
Hi
you can use the implicit Primitive Normal, along as your curves are coplanar (which they are)
have a look at the screenshot:
Flakked
Thanks so much for the reply, raschberg!

However, I'm getting some different results after implementing your VEX. I think I understand the concept of what you're doing, and looking into the spreadsheet, I'm definitely seeing negative values for "N.y". (Which I assume are the flipped curves) The issue I'm running into is the VEX seemingly is not properly tagging all those values into the ReverseGRP group. I'm only seeing that the first one is getting added. I might be misunderstanding what the vex is doing, but my guess is I want the ReverseGRP to = 1 wherever there's a negative value for "N.y"? (Or in the wrangle's case, anything less than 0)
(also, getting a "Implicit cast from float to int" warning on the my wrangle, which was another difference I noticed on my end. Not sure if that matters tho)

raschberg
Hello Flakked
you have a capital "P" in @primnum. This way it is an unknown attribute, which is set to a float attribute by default (this is why you get the implicit warning), with the value 0.0, so all the values are set to the first primitive Number 0 and overwriting each other. It is by random 0 or 1 because you never know in which order the primitives are calculated in a primitive-wrangle, but that's a different story ...
Flakked
Dang, can't believe I missed that... thanks so much for the help, and the extra vex explanation!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB