Using a Curve to place Modular Pieces

   1992   1   0
User Avatar
Member
34 posts
Joined: Nov. 2016
Offline
One thing I'm trying to figure out (just for my own personal knowledge/growth) in Houdini is how to handle copying pre-made modular sections along a curve while still maintaining the original size of the input geometry. This is something I've been looking into as a tool for building out things such as pipes, ducts, fences, trims, etc,etc. I've taken the usual approach of just procedurally generating the geometry in Houdini itself with curves and sweeps (which is probably easier), but I'd also like the option to handle placing existing modular geometry pieces together in a logical way using a curve system.

Say for instance I have a pipe or fence set with a 4 meter long straight section, a 2m long straight section, and a corner piece, all working on a standard grid size in Unreal Engine. I'd like to be able to use an input curve in an HDA tool to be able to build out these assets and adhere to these specified metrics using only those input pieces.(or any additional ones later down the road). I'm fine setting up the actual creation and copying of the assets to the points on the curve but I'm stumped as to how to only spawn the pieces I have in the set relative to how long each segment of the curve may end up being and aligning/rotating the corner piece to the correct orientation when there is a change in direction (the curve would be all linear)

A few ideas I've had in exploration include using a fuse SOP to force the input curve to snap to a specific grid scale, and using an if statement in a wrangle to calculate the length of each segment on the curve (and possibly using a bbox from the meshes)to copy the modular pieces to that segment of the curve if it meets to correct length requirements. Also using a wrangle to check next and previous points along the curve to determine if the curve has shifted in a 90 degree angle in order to copy the corner piece to that point.

I'm no VEX expert by any means (few weeks of trial and error on other HDA's and watching tutorials) so I was wondering if any wizard out there could possibly offer so suggestions if I'm headed in the right direction or if there's an easier way I'm missing.

Thanks for any suggestions/help.
User Avatar
Member
45 posts
Joined: Dec. 2016
Offline
Hello,

I don't know if It's really what you want but you can put a resample on your curve and group the point before the copy with an expression.
For example if you want put a other piece of geometrie every 5 points you can group by expression with modulo
@ptnum == 0 | @ptnum%5 == 0
and you can use the number of segment of the resemple node like this
@ptnum == 0 | @ptnum == `chs("../resample1/segs")`

Attachments:
Utiliser une courbe pour placer des pieces modulaires .hip (78.7 KB)

Jeremy Gurdal
VFX Artrist
  • Quick Links