Jump to content

Calculate the distance between two point of different geometry


Recommended Posts

Hi, i've two geometry with a scatter node applied and i wont connect these point using an add node by color attribute create with a color node after scatter node.
so...

geo 1                      geo2
scatter1                   scatter2
color1                     color2
              merge
              add

Now i need to calculate the distance between the connected poit. 
How can I do?

Thanks

Link to comment
Share on other sites

Ok, i suppose that I have to connect my two streams in the first and second imput of attributewrangle, right?

Sorry my ignorance...

And furthermore, if i would to delete the longest line of a certain value, how can select these line? (line created with the connection of points)

Edited by Blackshadow
i forgot a piece of the message
Link to comment
Share on other sites

Not on my computer right now but yes you have connect your 2 streams in the wrangle.
for the other question you could do an if statement and do something along this lines. 

if(@dist > ch("threashold")){
    removepoint(0, @ptnum);
}

 

Link to comment
Share on other sites

Just wanted to add a quick something to this: you can actually access another input's attributes without having to use the point function.

Appending opinput# before the attribute allows you to designate which input to access.

v@opinput1_P would access the second input's P attribute for instance. So you could actually get the distance with a single line :)

f@dist = distance(@P, v@opinput1_P);

 

  • Like 1
  • Thanks 1
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...