Skip to content

Commit

Permalink
fix and test pylele_tail
Browse files Browse the repository at this point in the history
  • Loading branch information
bat52 committed Aug 6, 2024
1 parent 1d3044b commit 58eb3d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pylele_tail.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ class LeleTail(LeleBase):

def gen(self) -> Shape:
""" Generate Tail """
assert self.cli.separate_end

cfg = self.cfg
joinTol = cfg.joinCutTol
cutAdj = (FIT_TOL + 2*joinTol) if self.isCut else 0

# this assertion should be verified
assert self.cli.end_flat_width > 4.0 + 2*cutAdj, 'end_flat_width too small! %f, should be larger than %f' % (self.cli.end_flat_width, 4+2*cutAdj)

tailX = cfg.tailX
chmBackX = cfg.scaleLen + cfg.chmBack
tailLen = tailX - chmBackX + 2*cutAdj
Expand Down Expand Up @@ -60,9 +66,9 @@ def test_tail():

component = 'tail'
tests = {
'cut' : ['-C'],
'cadquery': ['-i','cadquery'],
'blender' : ['-i','blender']
'cut' : ['-E','-e','10','-C'],
'cadquery': ['-E','-e','4.3','-i','cadquery'],
'blender' : ['-E','-e','4.3','-i','blender']
}

for test,args in tests.items():
Expand Down
5 changes: 5 additions & 0 deletions pylele_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from pylele_texts import test_texts
from pylele_rim import test_rim
from pylele_worm_key import test_worm_key
from pylele_tail import test_tail

# assemblies
from pylele_nut_assembly import test_nut_assembly
Expand Down Expand Up @@ -159,6 +160,10 @@ def test_worm_key(self):
""" Test Worm Key """
test_worm_key()

def test_tail(self):
""" Test Tail """
test_tail()

## Assemblies

def test_nut_assembly(self):
Expand Down

0 comments on commit 58eb3d6

Please sign in to comment.