Skip to content

Commit

Permalink
Reordered cone parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbudden committed Sep 8, 2021
1 parent 5dc7bba commit e780ad9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cadquery/cq.py
Original file line number Diff line number Diff line change
Expand Up @@ -3803,9 +3803,9 @@ def sphere(
def cone(
self: T,
height: float,
radius: float = 0,
radius1: float = None,
radius2: float = None,
radius: float = 0,
direct: Vector = Vector(0, 0, 1),
angle: float = 360,
combine: bool = True,
Expand Down
9 changes: 7 additions & 2 deletions tests/test_cadquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2482,16 +2482,21 @@ def testConeDefaults(self):
self.assertEqual(1, s.solids().size())
self.assertEqual(2, s.faces().size())
self.assertEqual(2, s.vertices().size())
s1 = Workplane("XY").cone(40, radius1=10, radius2=5)
s1 = Workplane("XY").cone(40, 10, 5)
self.assertEqual(1, s1.size())
self.assertEqual(1, s1.solids().size())
self.assertEqual(3, s1.faces().size())
self.assertEqual(2, s1.vertices().size())
s2 = Workplane("XY").cone(40, radius1=10, radius2=5, combine=False)
s2 = Workplane("XY").cone(40, radius1=10, radius2=5)
self.assertEqual(1, s2.size())
self.assertEqual(1, s2.solids().size())
self.assertEqual(3, s2.faces().size())
self.assertEqual(2, s2.vertices().size())
s3 = Workplane("XY").cone(40, radius1=10, radius2=5, combine=False)
self.assertEqual(1, s3.size())
self.assertEqual(1, s3.solids().size())
self.assertEqual(3, s3.faces().size())
self.assertEqual(2, s3.vertices().size())

def testWedgeDefaults(self):
s = Workplane("XY").wedge(10, 10, 10, 5, 5, 5, 5)
Expand Down

0 comments on commit e780ad9

Please sign in to comment.