Hi all,

I am running into some funny results with my geometry that I wonder if anyone can shed some light on for me? I’m modeling a fairly complex form and having some issues with finding adjacent faces. Mostly its all working great, but in a very irregular/unpredictable way I am having some items fail to recognize their adjacent room face? I can’t quite figure our whats causing this and it seems to happen in a fairly ‘random’ fashion?

I am being very, very careful in my geometry creation and splitting faces carefully. If I ‘remodel’ the offending face(s), sometimes it works, sometimes not. Very odd?

As example - on a small bit of the building (just pulled out two rooms as an example here) I would like my Honeybee model to recognize this highlighted face as a ‘Surface’ BC / interface floor:

The trouble I am running into is that *sometimes* the ‘Solve Adjacency’ works great, but then *sometimes* not so much… for instance, in the example here with just these two rooms, I can get it to work correctly at first, but if I do something as simple as make a ‘copy’ of the room geometry (keyboard ‘Alt’ and click/drag) then with that new geometry, now it does not recognize the intersection face any longer?

I think I have tried to track down the difference between the two cases here, since I know they are identical geometry (a direct copy) and the best I can find - the only difference occurs in the ‘ub’ calculation within the ‘does_intersection_exist_line2d’ method (as a part of the face’s is_centered_adjacent() / intersect_line_ray() evaluation.

The basic adjacent face checks are all the same in both cases: Is there an overlapping bounding-box, are the face center-points equivalent, is the face area difference within the tolerance value: Those are all ‘True’ for both cases. It’s only the ‘Test-Ray’ intersection check that seems to show any difference between the two.

For my ‘original’ version, that ‘does_intersection_exist_line2d’ check results in a negative value of -3.91993656526e-15, and then the ‘copy’ geometry calculates a result of +3.91993656526e-15 (positive). This seems to cause the face.is_point_inside() check to return a second True value, which then causes the adjacency check to not actually find the adjacent face. (I think… a lot of nested methods there and I certainly don’t understand what the does_intersection_exist_line2d() math is trying to solve for there, so might be totally wrong on all that).

So I definitely don’t understand what the ua and ub are checking for - but it seems to me that the difference between -3.91993656526e-15 and +3.91993656526e-15 might just be some sort of tolerance / rounding issue, not an actual difference in the geometry? I wonder if there should be some sort of tolerance added to the line._u_in() method or the ua / ub calculation itself?

I wonder if anyone can shed some light on that? Is there something else that is actually ‘different’ in the two cases here that I’m not seeing? In general, as I noted: I’m getting some fairly irregular results from this adjacency finder and would be great to understand a bit more about the ‘proper’ way to model these sorts of complex geometries (I know, simplify whenever I can. Can’t always though)? Is there some sort of tolerance value that can be set globally or something that might make this a bit simpler?

as always - any advice is always appreciated!

thanks so much. (files attached if you like).

@edpmay

face_adjacency.gh (52.1 KB)

face_adjacency.3dm (495.7 KB)