3
$\begingroup$

I want to check if two connected lines are collinear. If yes then I want to place at the middle point an object. To give the collinearity a little bit of tolerance $±5°$ would be a nice addition.

enter image description here

enter image description here

$\endgroup$

2 Answers 2

7
$\begingroup$

You can do this, for example, by comparing the direction vectors between the points, thus creating a selection.

Something like this:

enter image description here

Here I get the direction vectors of the edges with the node Edge Vertices, and compare them with the node Compare.

The epsilon of $0.087$ corresponds to an angle of $5°$ (The values are in radians!).

Additionally I use the node Compare to select a certain point.

Both selections together then result in the selection for the instantiation of the desired object at the desired point, as soon as the angle between the two lines is less than $5°$.

enter image description here


(Blender 3.2+)

$\endgroup$
3
  • $\begingroup$ Wow works like a charme!! $\endgroup$
    – Probber
    May 3, 2023 at 18:09
  • 1
    $\begingroup$ I never knew Equal did that ! .. that's half-a-xillion Dot-Products I'll never get back... :) $\endgroup$
    – Robin Betts
    May 3, 2023 at 20:02
  • $\begingroup$ @RobinBetts :D ...This comment made my day. For others: it's a Compare node set to Vector $\endgroup$
    – quellenform
    May 3, 2023 at 20:18
2
$\begingroup$

Just for fun, since the correct answer is already taken:

$\endgroup$
3
  • $\begingroup$ classic style +1 $\endgroup$
    – quellenform
    May 2, 2023 at 22:11
  • $\begingroup$ Wow, i dont really know what it will do but i have an assumption. You can create many vertices on one line and the angle defines the visibility? That would be my 2nd question, because i tried and failed. But i am failing also on this here. Please take a look on this pic. Must be exact the same like yours... i.stack.imgur.com/vsBbq.png and i.stack.imgur.com/M5rl4.png BTW: something happend to my account, have a new one, i $\endgroup$
    – Probber
    May 3, 2023 at 18:46
  • $\begingroup$ @Probber perhaps the extrusion has an inconsistent direction, I don't think it's reasonable to work on this answer, as I said it's just for fun :D $\endgroup$ May 4, 2023 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .