Jump to content
Blackshadow

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

Share this post


Link to post
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

Share this post


Link to post
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);
}

 

Share this post


Link to post
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);

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×