Skip to content

Commit b585881

Browse files
committed
ADD: for box-like studs have a small catch in the detector
1 parent ad3a8cb commit b585881

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

deps/eigen

Submodule eigen updated from de8013f to f78dfe3

src/gh/diffCheck/diffCheck/df_joint_detector.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,20 @@ def run(self) :
5252
############################################################################
5353
# [*] If the timber has 6 faces, it is a box, return the faces
5454
############################################################################
55-
if len(self.brep.Faces) == 6:
56-
pass
57-
# get the two smallest faces as the cuts
55+
if self.brep.Faces.Count == 6:
56+
# order the faces by surface area
57+
faces = sorted(
58+
self.brep.Faces,
59+
key=lambda x: rg.AreaMassProperties.Compute(x).Area, reverse=False)
5860

61+
# the the smallest faces are the sides
62+
self._faces = [[faces[0], 0], [faces[1], 1]]
63+
64+
# add the rest of the faces as sides
65+
for f in faces[2:]:
66+
self._faces.append([f, None])
67+
68+
return self._faces
5969

6070
############################################################################
6171
# 1. Bring to XY, mamke AABB and get negative boolean difference

0 commit comments

Comments
 (0)