83 lines
3.2 KiB
Diff
83 lines
3.2 KiB
Diff
--- FreeCAD-1.0.2/src/Mod/CAM/CAMTests/TestPathOpUtil.py 2025-10-03 10:23:12.902149395 +0200
|
|
+++ FreeCAD-1.0.2/src/Mod/CAM/CAMTests/TestPathOpUtil.py 2025-10-03 10:24:00.633838041 +0200
|
|
@@ -777,79 +777,6 @@
|
|
self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
|
|
self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[1].Point)
|
|
|
|
- def test46(self):
|
|
- """Check offsetting multiple inside edges."""
|
|
- obj = self.doc.getObjectsByLabel("offset-edge")[0]
|
|
-
|
|
- w = getWireInside(obj)
|
|
- length = 20 * math.cos(math.pi / 6)
|
|
-
|
|
- # let's offset the other two legs
|
|
- lEdges = [
|
|
- e
|
|
- for e in w.Edges
|
|
- if not Path.Geom.isRoughly(e.Vertexes[0].Point.y, e.Vertexes[1].Point.y)
|
|
- ]
|
|
- self.assertEqual(2, len(lEdges))
|
|
-
|
|
- wire = PathOpUtil.offsetWire(Part.Wire(lEdges), obj.Shape, 2, True)
|
|
-
|
|
- x = length / 2 - 2 * math.cos(math.pi / 6)
|
|
- y = -5 - 2 * math.sin(math.pi / 6)
|
|
-
|
|
- self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
|
|
- self.assertCoincide(Vector(-x, y, 0), wire.Edges[-1].Vertexes[1].Point)
|
|
-
|
|
- rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
|
|
- self.assertEqual(0, len(rEdges))
|
|
-
|
|
- # offset the other way
|
|
- wire = PathOpUtil.offsetWire(Part.Wire(lEdges), obj.Shape, 2, False)
|
|
-
|
|
- self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[0].Point)
|
|
- self.assertCoincide(Vector(+x, y, 0), wire.Edges[-1].Vertexes[1].Point)
|
|
-
|
|
- rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
|
|
- self.assertEqual(0, len(rEdges))
|
|
-
|
|
- def test47(self):
|
|
- """Check offsetting multiple backwards inside edges."""
|
|
- # This is exactly the same as test36 except that the wire is flipped to make
|
|
- # sure it's orientation doesn't matter
|
|
- obj = self.doc.getObjectsByLabel("offset-edge")[0]
|
|
-
|
|
- w = getWireInside(obj)
|
|
- length = 20 * math.cos(math.pi / 6)
|
|
-
|
|
- # let's offset the other two legs
|
|
- lEdges = [
|
|
- e
|
|
- for e in w.Edges
|
|
- if not Path.Geom.isRoughly(e.Vertexes[0].Point.y, e.Vertexes[1].Point.y)
|
|
- ]
|
|
- self.assertEqual(2, len(lEdges))
|
|
-
|
|
- w = Path.Geom.flipWire(Part.Wire(lEdges))
|
|
- wire = PathOpUtil.offsetWire(w, obj.Shape, 2, True)
|
|
-
|
|
- x = length / 2 - 2 * math.cos(math.pi / 6)
|
|
- y = -5 - 2 * math.sin(math.pi / 6)
|
|
-
|
|
- self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
|
|
- self.assertCoincide(Vector(-x, y, 0), wire.Edges[-1].Vertexes[1].Point)
|
|
-
|
|
- rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
|
|
- self.assertEqual(0, len(rEdges))
|
|
-
|
|
- # offset the other way
|
|
- wire = PathOpUtil.offsetWire(Part.Wire(lEdges), obj.Shape, 2, False)
|
|
-
|
|
- self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[0].Point)
|
|
- self.assertCoincide(Vector(+x, y, 0), wire.Edges[-1].Vertexes[1].Point)
|
|
-
|
|
- rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
|
|
- self.assertEqual(0, len(rEdges))
|
|
-
|
|
def test50(self):
|
|
"""Orient an already oriented wire"""
|
|
p0 = Vector()
|