Jump to content

Create a center line


AnthonyVFX

Recommended Posts

Hi all,

I’m trying to create a center line (not just a center point) based on other lines in VEX. Attached is a photo of the code I used to create the lines. Will anyone share how to derive a center line from existing lines in VEX?

648FC379-A643-4176-8228-E0B5A8310836.jpeg

Link to comment
Share on other sites

It's impossible to help you without a hip file. Please upload one so we can see the broader context of your setup.

"Center line" is ambiguous. Please provide demonstration geometry and a rough-in geo of what you expect to see.

Link to comment
Share on other sites

Thanks so much for your help! I have a problem though. The red line in the files you sent me go to the origin, and not to the center of the target points. Any idea why the difference in opening the files in your version of Houdini versus mine (Apprentice)?

3DCAE440-EA04-4DB6-8A10-40536186BABC.jpeg

Link to comment
Share on other sites

No, that's right. I wanted the average of the 30 points. But the red, center line appears to only be in one of the 7 clusters. It's not that way with your file?

Anyway, I seemed to have fixed it by swapping out the add node with the extract centroid node.

I have just moved on to figuring out how to pull those 30 lines toward the red, center line with a ramp parameter (so that I can play with the web shape)...

I seem to be pulling the lines to the origin and not the red, center line, so something is off (at least I'm not getting an error message!). Any insights on that are welcome! (smile)

 

Edited by AnthonyVFX
Link to comment
Share on other sites

nah...I'm sure that is the average of all points not just one cluster

here's a simpler setup to lookat, same result

the cluster treats all points as ONE cluster, get the avg of that.

then just create ONE line using point 0 in the wrangle.

(just by eyes, I reckon the centre is the avg of all points and not a particular group of points)

 

centre.jpg

vu_Web-line-example3.hipnc

Edited by Noobini
  • Thanks 1
Link to comment
Share on other sites

I have absolutely no idea what you're trying to do....but here's my best guess:

- attribcreate lineID should be an integer not float. Easiest is to simply use the shooter ID ie. the @ptnum. You can see I set this up right after where the color of the line is set. For the red line, the last shooter ID should be the count of your scatter points. It probably doesn't matter what this last ID is really.

- the resample should have a constant number of segments across ALL lines...for easy point matching up (morphing) later. Also turn on curveu, this will save you doing manual work later on your own. Hey it's FREE...use it.

- the point SOP in the for loop is where the magic happens. Amt is how much pull towards the centre line, play with the ramp to tweak your spiderweb shape. Go nuts.

 

webshooter.jpg

vu_Web-line-example5.hipnc

(in the end you probably don't need line ID for anything at all...unless there's more effects later on)

Edited by Noobini
  • Thanks 1
Link to comment
Share on other sites

Wow! That is what I’m going for. Thanks so much. I will check this out. 

...I will say that I think I need the line ID next for adding webs between the lines. ...But I’ll check out what you did before committing to that. (Smile)

Edited by AnthonyVFX
Link to comment
Share on other sites

did my best to sort out your logic...if you open geo spreasheet adjust Overalldensity, you'll see nearPts arrays being filled up accordingly...

that's as far as I got...dunno what what your partVal is...is that line ID ?

just beware that when looking for nearpoints, it wants to know up to how many points do you want to find ie. some discrete number like 1, 5, 10....your initial result of mult some ramp number with some other fractional number is gonna give you some fractional number less than 1...ie you're getting nuthin'. Hence you see I've mult that by 20 and made that into an int.

vu_Web-line-example8.hipnc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...