From 7dea259659b3157d1bce8b7769f89a76ee8198ff Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 23 Feb 2015 08:30:35 -0500 Subject: [PATCH] Added test of 2D drawing, including threePointArc and moveTo. This should be expanded later to include all 2D drawing constructs. --- tests/TestCadQuery.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/TestCadQuery.py b/tests/TestCadQuery.py index 48d1bd5..46eb308 100644 --- a/tests/TestCadQuery.py +++ b/tests/TestCadQuery.py @@ -546,6 +546,23 @@ class TestCadQuery(BaseTest): self.saveModel(r) + def test2DDrawing(self): + """Draw things like 2D lines and arcs, should be expanded later to include all 2D constructs""" + s = Workplane(Plane.XY()) + r = s.lineTo(1.0, 0.0) \ + .lineTo(1.0, 1.0) \ + .threePointArc((1.0, 1.5), (0.0, 1.0)) \ + .lineTo(0.0, 0.0) \ + .moveTo(1.0, 0.0) \ + .lineTo(2.0, 0.0) \ + .lineTo(2.0, 2.0) \ + .threePointArc((2.0, 2.5), (0.0, 2.0)) \ + .lineTo(-2.0, 2.0) \ + .lineTo(-2.0, 0.0) \ + .close() + + self.assertEqual(1, r.wires().size()) + def testOccBottle(self): """ Make the OCC bottle example.