Skip to content

Commit 9d74737

Browse files
Change tolerance in overlap checking method to ensure results are relative to problem size
1 parent 91f6078 commit 9d74737

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sectionproperties/pre/pre.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,9 @@ def remove_overlapping_facets(self):
245245
self.remove_duplicate_facets()
246246

247247
if self.verbose:
248-
str = "Removed overlapping facets... Rebuilt with "
249-
str += "points: {0}".format(pts)
248+
str = "Removed overlapping facets {0}...".format(
249+
idx_to_remove)
250+
str += "Rebuilt with points: {0}".format(pts)
250251
print(str)
251252

252253
# break both loops and loop through all facets again
@@ -447,6 +448,9 @@ def is_overlap(self, p, q, r, s, fct1, fct2):
447448
tol = 1e-3 # minimum angle tolerance (smaller is considered overlap)
448449
float_tol = 1e-12 # rounding error tolerance
449450

451+
# relativise tolerance by length of smallest vector
452+
tol *= min(np.linalg.norm(r), np.linalg.norm(s))
453+
450454
# are the line segments collinear?
451455
if abs(np.cross(r, s)) < tol:
452456
if abs(np.cross(q - p, r)) < tol:

0 commit comments

Comments
 (0)