WIP | Find Center Spline - [ Houdini Utility ]

   3417   10   2
User Avatar
Member
53 posts
Joined: 7月 2017
Offline
Hi all,

fairly new to the HDA creation, but I have a tool that solved a very common issue for me. Getting models from different places, I often had the need to create a spline from objects to then drive a dynamic simulation, or just to re-model a more clean geometry. Could be ropes, branches, pipes etc. Quickly realizing it's a big rabbit hole with tons of model variables, the HDA has grown in scope. It's still work in progress, but I've tried to iron out the main bugs I could find along with making a clean UI.

The tool has a few different built-in solutions to tackle some of the models I've come across.
You either need uncapped geometry, or group the end cap(s) manually.
You can feed in your own custom edge loop for the calculations, or let the tool calculate it for you.

For non-quad meshes, it supports a growth method and internally quad re-meshing the input model using the new H20 quad re-mesher.

It also gives you the option to center the new spline points on primitives or points on the model, along with some resampling options.

Image Not Found




Known issues/bugs:
- If the input geometry is reversed, the spline will "offset" to be outside the original geometry.
- Would like for a more automated approach to detect ends on the model.
Edited by Tronotrond - 2023年12月11日 15:01:26

Attachments:
Screenshot 2023-12-04 155632.png (2.0 MB)
Screenshot 2023-12-04 155713.png (1.3 MB)
Screenshot 2023-12-04 155844.png (1.9 MB)
Screenshot 2023-12-04 160812.png (2.0 MB)
Screenshot 2023-12-04 163545.png (2.0 MB)
Screenshot 2023-12-04 163610.png (2.0 MB)
FindCenterSpline_v01.zip (492.6 KB)
sop_th.find_center_spline.3.1.hdalc (46.8 KB)

User Avatar
Member
53 posts
Joined: 7月 2017
Offline
Updated first post with demonstration video, an updated HDA file and the example scene/geo from the video.

Fixed several minor issues, and added support for varying mesh thickness.
User Avatar
Member
185 posts
Joined: 2月 2016
Offline
Nice! This is indeed that is super useful when ingesting geometry from elsewhere.

I took it for a spin, some feedback:
1. The default resample value (0.01) is a bit on the low side
2. Tangentu and curveu would be nice as a global toggle instead of just when you resample
3. The experimental fix input geo fails on a straight tube (looks like it's messing up the ends mostly)

Features that I missed:
1. Would be great if you could provide a pscale for each point along the spline
2. Carrying/transferring attributes from the input geometry
User Avatar
Member
53 posts
Joined: 7月 2017
Offline
AslakKS
Nice! This is indeed that is super useful when ingesting geometry from elsewhere.

I took it for a spin, some feedback:
1. The default resample value (0.01) is a bit on the low side
2. Tangentu and curveu would be nice as a global toggle instead of just when you resample
3. The experimental fix input geo fails on a straight tube (looks like it's messing up the ends mostly)

Features that I missed:
1. Would be great if you could provide a pscale for each point along the spline
2. Carrying/transferring attributes from the input geometry

Hei Aslak, thanks so much for the feedback! Great suggestions and I'll definitively implement all these things. All should be fairly easy to fix.

I'll have to test the straight pipe issue. Not sure what goes on there, but do you have an example geometry, or screenshot, I could look at?
User Avatar
Member
185 posts
Joined: 2月 2016
Offline
The straight pipe was just a tube node - only thing I was changing was the amount of rows and columns

Attachments:
find-center-spline_tube-bug.png (171.0 KB)

User Avatar
Member
53 posts
Joined: 7月 2017
Offline
AslakKS
The straight pipe was just a tube node - only thing I was changing was the amount of rows and columns
Image Not Found

Great, thanks!
My first thought is that since the ingested geo is already quads, there's no need to use the Fix Bad Input Geo switch. It seems to work fine here without that. But I do see what you mean, and I'll see if I can make any adjustments to fix it.
Any suggestions for other approaches are also much welcome. I feel it's sort of a 'hacky' approach I've done inside the HDA, but it does work for most triangulated geometry, CAD data etc that I've tested.

Working on the other suggestions, and should have an update soon!
User Avatar
Member
185 posts
Joined: 2月 2016
Offline
I think you're already using the approach I used (group expand to get steps).
I took a peak inside the HDA and it seems like if you quadremesh before you poly cap that should make it more stable.

Did observe another bug though - if the input geo is a single step tube *and* `Varying Geometry Widths` is enabled it outputs bogus

Attachments:
find-center-spline_varying-bug.png (355.7 KB)

User Avatar
Member
53 posts
Joined: 7月 2017
Offline
Thanks so much for all the feedback. Attached (and updated in the original post) is an updated HDA!

3.1 Changes:
- Added support for curveu and tangentu attributed to be added without the need to resample the curve.
- Added support for pscale attribute to be added in all Sampling Modes
- Fixed bugs with straight tubes, where both "endcaps" shared the same edge
- Adjusted the "Fix bad input geo" switch for hopefully more stable outputs (remeshing before capping geo)

Known Issues:
- Not all modes will work on all types of geometry, and especially triangulated geometry containing sharp corners can be tricky even with the fix bad geo switch. Recommending using the step mode for this. Adjusting the Curvature Edge Flow can help resolve the issue.
- Pscale calculation on step mode does an avg. distance between all points on current step/edgeloop. Could implement min/max options.

EDIT: Quick re-upload of HDA
Edited by Tronotrond - 2023年12月11日 15:01:11

Attachments:
3.1updateUI.png (34.9 KB)
3.1update_pscale.png (1.7 MB)
sop_th.find_center_spline.3.1.hdalc (46.8 KB)

User Avatar
Member
19 posts
Joined: 3月 2022
Offline
Tronotrond do you have any intentions of hosting it on GitHub? It would make tracking updates much easier. Thank you for sharing!
User Avatar
Member
53 posts
Joined: 7月 2017
Offline
timurproko
Tronotrond do you have any intentions of hosting it on GitHub? It would make tracking updates much easier. Thank you for sharing!
Thanks! That's a good idea. I'll see if I can do that one of the upcoming days and post a link here.
User Avatar
Member
53 posts
Joined: 7月 2017
Offline
Uploaded the files to github. Will place future version there.
https://github.com/Tronotrond/FindCenterSpline/ [github.com]
  • Quick Links