Skip to content

Commit 973dfda

Browse files
committed
added tests
1 parent 0329d21 commit 973dfda

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/test_cadquery.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def testLoft(self):
468468
self.assertEqual(7, s.faces().size())
469469

470470
# test loft with combine="cut"
471-
box = Workplane().box(10, 10, 10).solids()
471+
box = Workplane().box(10, 10, 10)
472472
cut = (
473473
box.faces(">Z")
474474
.workplane()
@@ -480,6 +480,19 @@ def testLoft(self):
480480

481481
self.assertGreater(box.val().Volume(), cut.val().Volume())
482482

483+
# test loft with combine=True
484+
box = Workplane().box(10, 10, 10)
485+
add = (
486+
box.faces(">Z")
487+
.workplane()
488+
.circle(2)
489+
.workplane(offset=12)
490+
.rect(3, 2)
491+
.loft(combine=True)
492+
)
493+
494+
self.assertGreater(add.val().Volume(),box.val().Volume())
495+
483496
def testLoftRaisesValueError(self):
484497
s0 = Workplane().hLine(1) # no wires
485498
with raises(ValueError):
@@ -1166,6 +1179,17 @@ def testSweep(self):
11661179
)
11671180
self.assertGreater(box.val().Volume(), cut.val().Volume())
11681181

1182+
#test sweep with combine = True
1183+
box = Workplane().box(10, 10, 10, centered=False)
1184+
path = Workplane("YZ").lineTo(10, 10)
1185+
add = (
1186+
box.vertices(">Z and >X and >Y")
1187+
.workplane(centerOption="CenterOfMass")
1188+
.circle(1.5)
1189+
.sweep(path, combine=True)
1190+
)
1191+
self.assertGreater(add.val().Volume(),box.val().Volume())
1192+
11691193
def testMultisectionSweep(self):
11701194
"""
11711195
Tests the operation of sweeping along a list of wire(s) along a path

0 commit comments

Comments
 (0)