Skip to content

Commit

Permalink
b1scad add support for cube with 3 dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
bat52 committed Dec 25, 2024
1 parent 30a4ee9 commit 400954f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/b1scad/scad/model03.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cube([20,30,40]);
4 changes: 4 additions & 0 deletions src/b1scad/scad2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def shape_set(self, t):
@_("shape SEMICOLON ")
def shape_set(self, t):
return t.shape

@_('CUBE LPAREN vector RPAREN')
def shape(self, p):
return f"self.api.box({p.vector})"

@_('CUBE LPAREN NUMBER RPAREN')
def shape(self, p):
Expand Down
2 changes: 1 addition & 1 deletion src/b1scad/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class B1scadTestMethods(unittest.TestCase):
"""Pylele Test Class"""
def test_all_scad(self):
scaddir = os.path.join(os.path.abspath(os.path.dirname(__file__)),"scad")
for idx in range(3):
for idx in range(4):
fname = f"model{idx:02}"
scadfname = f"{fname}.scad"
fullscadfile = os.path.join(scaddir,scadfname)
Expand Down

0 comments on commit 400954f

Please sign in to comment.