# Do solids' edge vectors get slightly altered after booleans? (Orthogonal line sorting problem.)

**URL:** <https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474>\
**Category:** Grasshopper\
**Created:** [June 7, 2019, 5:41pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474 "2019-06-07T17:41:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 5:41pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/1 "2019-06-07T17:41:53Z")

</div>

I made a cluster that sorts orthogonal and diagonal lines into X, Y, Z orthogonals and XY, XZ, YZ and XYZ diagonals.

It seems to work perfectly on lines I draw manually using ortho snap.  
It also works fine on lines that I derive from the edges of boxes (X lines in white):

 ![Cubes](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/f/5fb76477f868ec6e001664ead36b9d2ec950db30.jpeg)

When I do a boolean union of the boxes, either in Rhino or in Grasshopper, some of the edge lines of the resulting solid don’t sort properly (note a couple white X lines are missing).

 ![Post%20Boolean%20X](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/9/d933d437ca9ea069065db31667d1229930364f4d.jpeg)

The missing lines above that should be sorted as X orthogonal lines get recognized as diagonal lines (the white lines here are from my XZ diagonals output.)

 ![Post%20Boolean%20XZ](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/e/8e6d4d3bf1c8af07a0fa81b189ac9a79682f438a.jpeg)

Here’s the definition, with some stream filters added to make it easy to compare the problem condition to a condition where it all works.

[Sort Lines XYZ Troubleshoot.gh (42.0 KB)](https://discourse.mcneel.com/uploads/short-url/bnxIg0hniVC5nZUwYsApfZxHtuT.gh)

And here’s the Rhino file all the geometry comes from:  
[xyz intersections.3dm (190.4 KB)](https://discourse.mcneel.com/uploads/short-url/n0zYCPEhfb37iTQolDtIqneVstP.3dm)

Is this a tolerance issue in my sorting definition?  
I tried playing with different tolerances but it didn’t help.  
Or is it a document tolerance problem?  
I tried changing document tolerance and redoing the booleans. Didn’t help.  
Or have I overlooked something in the structure of the definition?

What am I missing here? Any suggestions much appreciated.

-Max

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 8:06pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/2 "2019-06-07T20:06:45Z")

</div>

Update, I’ve baked the lines that aren’t behaving correctly, used the What command on them in Rhino, and they sure look like they’re truly orthogonal.

Have I found a bug?

---

<div class="post-metadata">

**Author:** ![ivelin.peychev](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ivelin.peychev/32/676038_2.png) [@ivelin.peychev](https://discourse.mcneel.com/u/ivelin.peychev)\
**Post date:** [June 7, 2019, 8:10pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/3 "2019-06-07T20:10:29Z")

</div>

Could it be a rounding issue?  
Is your mesh in GH the same as in Rhino?

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 8:11pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/4 "2019-06-07T20:11:49Z")

</div>

I can set mesh in GH? BRB, gonna go look that up.

---

<div class="post-metadata">

**Author:** ![René\_Corella](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ren%C3%A9_corella/32/769427_2.png) [@René\_Corella](https://discourse.mcneel.com/u/Ren%C3%A9_Corella)\
**Post date:** [June 7, 2019, 8:22pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/5 "2019-06-07T20:22:45Z")

</div>

did you come across the “Edges from directions” component for your breps? It’s easy to sort with breps that are orthogonal.

Is this similar to what you’re after?  
[Sort Lines XYZ Troubleshoot.gh (45.1 KB)](https://discourse.mcneel.com/uploads/short-url/d5dyv94QCvrIKTB8fF6D0VvjgpL.gh)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/4/3/43462878dba290b3ae5bf924faa0622c707672d4.png)

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 8:40pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/6 "2019-06-07T20:40:59Z")

</div>

Thanks! This is perfect! You actually went beyond what I needed here.

The “edges from directions” component is all I needed. It just works.

I’m still curious why my homemade sorter fails here. It works in all other situations, but since there’s another solution in this situation, my issue is solved.

The lines in the background are there because I’m working out a definition that sorts all the different ways orthogonal lines can intersect. I don’t actually need to isolate them from the Brep edges. I’ll post that in another thread. Hopefully that sorter is not also something that exists as a single component. I mean, it would be super convenient, but also I would have spend a bunch of time on something that already exists.

---

<div class="post-metadata">

**Author:** ![René\_Corella](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ren%C3%A9_corella/32/769427_2.png) [@René\_Corella](https://discourse.mcneel.com/u/Ren%C3%A9_Corella)\
**Post date:** [June 7, 2019, 8:53pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/7 "2019-06-07T20:53:58Z")

</div>

> [@Max3](#):
>
> I’m still curious why my homemade sorter fails here

My initial suspicion was that positive vs negative directions were the root, but then I remembered the component and did not even look again haha 😅

Best

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 8:55pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/8 "2019-06-07T20:55:51Z")

</div>

Hmm. I have a second little cluster that merges and consolidates overlapping lines and then flips them to all the same direction. I’ll try putting that in front and see if it changes anything.

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 7, 2019, 9:46pm UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/9 "2019-06-07T21:46:58Z")

</div>

It gets weirder:  
Baked lines from the “edges from directions” component work.  
The edges from “duplicate edges” in rhino don’t work.

---

<div class="post-metadata">

**Author:** ![Max3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/max3/32/493424_2.png) [@Max3](https://discourse.mcneel.com/u/Max3)\
**Post date:** [June 8, 2019, 5:52am UTC](https://discourse.mcneel.com/t/do-solids-edge-vectors-get-slightly-altered-after-booleans-orthogonal-line-sorting-problem/84474/10 "2019-06-08T05:52:35Z")

</div>

Update:

The glitch was due to using many instances of the similarity component. I replaced it with the “equality with tolerance” component, set to document tolerance, and everything now works.
