Skip to content

Commit

Permalink
fixed TOL in joint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
obucklin committed Feb 7, 2025
1 parent 558ebd6 commit c0738e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/compas_timber/design/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from compas_timber.connections import XLapJoint
from compas_timber.utils import distance_segment_segment
from compas_timber.utils import intersection_line_line_param
from compas.tolerance import TOL


class CollectionDef(object):
Expand Down Expand Up @@ -63,7 +64,7 @@ def get_topology_rules(rules, use_defaults=False):
return [rule for rule in topo_rules.values() if rule is not None]

@staticmethod
def joints_from_beams_and_rules(elements, rules, max_distance=1e-6):
def joints_from_beams_and_rules(elements, rules, max_distance=TOL.absolute):
"""processes joint rules into joint definitions.
Parameters
Expand Down Expand Up @@ -153,12 +154,12 @@ def contains(self, elements):
except TypeError:
raise UserWarning("unable to comply direct joint element sets")

def comply(self, elements, model_max_distance=1e-6):
def comply(self, elements, model_max_distance=TOL.absolute):
"""Returns True if the given elements comply with this DirectRule.
only checks if the distance between the centerlines of the elements is less than the max_distance.
allows joint topology overrides.
"""
if self.max_distance:
if self.max_distance is not None:
max_distance = self.max_distance
else:
max_distance = model_max_distance
Expand Down Expand Up @@ -204,7 +205,7 @@ def ToString(self):
def __repr__(self):
return "{}({}, {}, {}, {})".format(CategoryRule.__name__, self.joint_type.__name__, self.category_a, self.category_b, self.topos)

def comply(self, elements, model_max_distance=1e-6):
def comply(self, elements, model_max_distance=TOL.absolute):
if self.max_distance:
max_distance = self.max_distance
else:
Expand Down Expand Up @@ -279,7 +280,7 @@ def __repr__(self):
self.joint_type,
)

def comply(self, elements, model_max_distance=1e-6):
def comply(self, elements, model_max_distance=TOL.absolute):
if self.max_distance:
max_distance = self.max_distance
else:
Expand Down

0 comments on commit c0738e6

Please sign in to comment.