Download src/Mod/Part/parttests/Geom2d_tests.py from AbdulElahGwaith/FreeCAD: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/src/Mod/Part/parttests/Geom2d_tests.py
- Command line
-
hf download hf://AbdulElahGwaith/FreeCAD/src/Mod/Part/parttests/Geom2d_tests.py
-
curl -L -o Geom2d_tests.py https://huggingface.co/AbdulElahGwaith/FreeCAD/resolve/main/src/Mod/Part/parttests/Geom2d_tests.py
669 Bytes
| # SPDX-License-Identifier: LGPL-2.1-or-later | |
| import FreeCAD | |
| vec2 = FreeCAD.Base.Vector2d | |
| import Part | |
| import unittest | |
| class Geom2dTests(unittest.TestCase): | |
| def test_toShape(self): | |
| surf = Part.Cylinder() | |
| p1 = vec2(1.0, -1.0) | |
| p2 = vec2(2.0, -1.0) | |
| l12 = Part.Geom2d.Line2dSegment(p1, p2) | |
| e1 = l12.toShape() | |
| e2 = l12.toShape(surf) | |
| self.assertNotEqual(e1.curveOnSurface(0), None) | |
| self.assertNotEqual(e2.curveOnSurface(0), None) | |
| def test_insertKnot(self): | |
| with self.assertRaises(TypeError): | |
| curve = Part.Geom2d.BSplineCurve2d() | |
| curve.insertKnot(0.5, 1, 0.01, 2) | |