AnthonyVFX Posted March 5, 2020 Share Posted March 5, 2020 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? Quote Link to comment Share on other sites More sharing options...
kleer001 Posted March 5, 2020 Share Posted March 5, 2020 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. Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 6, 2020 Author Share Posted March 6, 2020 Hi there. Thanks for your reply/interest in helping. Here is the file: Web-line-example.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 6, 2020 Share Posted March 6, 2020 isn't it just the average of the targets, create another line from the shooter to the average just found...that's your line ? Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 6, 2020 Share Posted March 6, 2020 here....well there's actually NO vex as you asked for... it's already done...just needs abit of 'extra' logic....the count of shooter is now + 1 vu_Web-line-example.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 6, 2020 Share Posted March 6, 2020 this one is easier to see... vu_Web-line-example2.hipnc 1 Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 6, 2020 Author Share Posted March 6, 2020 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)? Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 6, 2020 Author Share Posted March 6, 2020 Nevermind! The problem was, simply enough, that two nodes were not appended. Thanks again! Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 6, 2020 Author Share Posted March 6, 2020 ...actually, I’ve notice that the center line created was only among one cluster of target points/lines, not all 7 of the clustered target point/lines. How do get that center line? Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 6, 2020 Share Posted March 6, 2020 well I thought you wanted an average line among the 30 points. Are you saying you want an average line per cluster? ie you want 7 red lines ? Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 6, 2020 Author Share Posted March 6, 2020 (edited) 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 March 6, 2020 by AnthonyVFX Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 7, 2020 Share Posted March 7, 2020 (edited) 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) vu_Web-line-example3.hipnc Edited March 7, 2020 by Noobini 1 Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 7, 2020 Author Share Posted March 7, 2020 Oh, cool! Thanks for showing me another way to do this setup. ...Not sure what happen with the other file. I've attached what I see. Anyway, I thank you just the same for your time and efforts! Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 7, 2020 Share Posted March 7, 2020 I'm on 18.0.348 sometimes opening H18 file in H17...it goes wonky...just beware. Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 7, 2020 Author Share Posted March 7, 2020 Well, regardless, I appreciate your time and efforts. You really got this newbie unstuck! Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 7, 2020 Author Share Posted March 7, 2020 Hi there, Noobini, would you be willing and able to help with pulling those main lines to the red center line? My VEX is off, not with an error, but it's pulling those main lines to the origin. vu_Web-line-example4.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 7, 2020 Share Posted March 7, 2020 (edited) 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. 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 March 7, 2020 by Noobini 1 Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 8, 2020 Author Share Posted March 8, 2020 (edited) 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 March 8, 2020 by AnthonyVFX Quote Link to comment Share on other sites More sharing options...
AnthonyVFX Posted March 10, 2020 Author Share Posted March 10, 2020 ...alright, now I am absolutely spinning my wheels trying to create connections between the lines to give it that detailed web look. Any help would be much appreciated. vu_Web-line-example7.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted March 11, 2020 Share Posted March 11, 2020 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.