Skip to content

Commit

Permalink
FingerJointSettings: Make angle a class property
Browse files Browse the repository at this point in the history
Don't allow the users to tinker with it. It is for internal use only.

Related: #627
  • Loading branch information
florianfesti committed Aug 2, 2024
1 parent 2ebf5da commit 378648e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions boxes/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ def setValues(self, thickness, relative: bool = True, **kw):
self.values[name] = value
elif name in self.relative_params:
self.values[name] = value * factor
elif hasattr(self, name):
setattr(self, name, value)
else:
raise ValueError(f"Unknown parameter for {self.__class__.__name__}: {name}")
self.checkValues()
Expand Down Expand Up @@ -837,7 +839,6 @@ class FingerJointSettings(Settings):
* absolute
* style : "rectangular" : style of the fingers
* surroundingspaces : 2.0 : space at the start and end in multiple of normal spaces
* angle: 90 : Angle of the walls meeting
* relative (in multiples of thickness)
Expand All @@ -853,7 +854,6 @@ class FingerJointSettings(Settings):
absolute_params = {
"style": ("rectangular", "springs", "barbs", "snap"),
"surroundingspaces": 2.0,
"angle": 90.0,
}

relative_params = {
Expand All @@ -866,6 +866,8 @@ class FingerJointSettings(Settings):
"bottom_lip": 0.0,
}

angle = 90 # Angle of the walls meeting

def checkValues(self) -> None:
if abs(self.space + self.finger) < 0.1:
raise ValueError("FingerJointSettings: space + finger must not be close to zero")
Expand Down

0 comments on commit 378648e

Please sign in to comment.