From d2fd87cecf9b7fd0d56d5ae27a8731ffd321d9c9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 11:24:35 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/Mod/CAM/CAMTests/TestPathVcarve.py | 8 ++--- src/Mod/CAM/Path/Op/Vcarve.py | 42 ++++++++------------------ 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/src/Mod/CAM/CAMTests/TestPathVcarve.py b/src/Mod/CAM/CAMTests/TestPathVcarve.py index aedce419eb..aeb523fac7 100644 --- a/src/Mod/CAM/CAMTests/TestPathVcarve.py +++ b/src/Mod/CAM/CAMTests/TestPathVcarve.py @@ -218,15 +218,11 @@ class TestPathVcarve(PathTestWithAssets): # new position is same as previous position so we can G1 from (0,1,5) to (0,0,0) because # we already travelled this path before and it's carved - no need to raise toolbit newPosition = FreeCAD.Base.Vector(0, 0, 0) - assert PathVcarve.canSkipRepositioning( - positionHistory, newPosition, defaultTolerance - ) + assert PathVcarve.canSkipRepositioning(positionHistory, newPosition, defaultTolerance) # same but should fail because we are out of tolerance newPosition = FreeCAD.Base.Vector(0, 0.1, 0) - assert not PathVcarve.canSkipRepositioning( - positionHistory, newPosition, defaultTolerance - ) + assert not PathVcarve.canSkipRepositioning(positionHistory, newPosition, defaultTolerance) # same but is OK because we are within tolerance newPosition = FreeCAD.Base.Vector(0, 0.1, 0) diff --git a/src/Mod/CAM/Path/Op/Vcarve.py b/src/Mod/CAM/Path/Op/Vcarve.py index ee049ec397..092eefa347 100644 --- a/src/Mod/CAM/Path/Op/Vcarve.py +++ b/src/Mod/CAM/Path/Op/Vcarve.py @@ -395,9 +395,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): "App::PropertyLinkList", "BaseShapes", "Path", - QT_TRANSLATE_NOOP( - "App::Property", "Additional base objects to be engraved" - ), + QT_TRANSLATE_NOOP("App::Property", "Additional base objects to be engraved"), ) obj.setEditorMode("BaseShapes", 2) # hide @@ -436,9 +434,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): "App::PropertyFloat", "Discretize", "Path", - QT_TRANSLATE_NOOP( - "App::Property", "The deflection value for discretizing arcs" - ), + QT_TRANSLATE_NOOP("App::Property", "The deflection value for discretizing arcs"), ) obj.addProperty( "App::PropertyFloat", @@ -502,9 +498,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): dist = ptv[-1].distanceToPoint(ptv[0]) if dist < FreeCAD.Base.Precision.confusion(): Path.Log.debug( - "Removing bad carve point: {} from polygon origin".format( - dist - ) + "Removing bad carve point: {} from polygon origin".format(dist) ) del ptv[-1] ptv.append(ptv[0]) @@ -663,9 +657,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): _maximumUsableDepth = _get_maximumUsableDepth(wires, geom) if _maximumUsableDepth is not None: maximumUsableDepth = _maximumUsableDepth - Path.Log.debug( - f"Maximum usable depth for current face: {maximumUsableDepth}" - ) + Path.Log.debug(f"Maximum usable depth for current face: {maximumUsableDepth}") # first pass cutWires(wires, pathlist, obj.OptimizeMovements) @@ -704,9 +696,7 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): if obj.ToolController.Tool.CuttingEdgeAngle >= 180.0: Path.Log.info( - translate( - "CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees." - ) + translate("CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees.") ) return @@ -724,9 +714,9 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): if not faces: for model in self.model: - if model.isDerivedFrom( - "Sketcher::SketchObject" - ) or model.isDerivedFrom("Part::Part2DObject"): + if model.isDerivedFrom("Sketcher::SketchObject") or model.isDerivedFrom( + "Part::Part2DObject" + ): faces.extend(model.Shape.Faces) if faces: @@ -774,14 +764,10 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): """Debug function to display calculated voronoi medial wires""" if not getattr(self, "voronoiDebugMedialCache", None): - Path.Log.error( - "debugVoronoi: empty debug cache. Recompute VCarve operation first" - ) + Path.Log.error("debugVoronoi: empty debug cache. Recompute VCarve operation first") return - vPart = FreeCAD.activeDocument().addObject( - "App::Part", f"{obj.Name}-VoronoiDebugMedial" - ) + vPart = FreeCAD.activeDocument().addObject("App::Part", f"{obj.Name}-VoronoiDebugMedial") wiresToShow = [] @@ -805,14 +791,10 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): """Debug function to display calculated voronoi edges""" if not getattr(self, "voronoiDebugEdgeCache", None): - Path.Log.error( - "debugVoronoi: empty debug cache. Recompute VCarve operation first" - ) + Path.Log.error("debugVoronoi: empty debug cache. Recompute VCarve operation first") return - vPart = FreeCAD.activeDocument().addObject( - "App::Part", f"{obj.Name}-VoronoiDebugEdge" - ) + vPart = FreeCAD.activeDocument().addObject("App::Part", f"{obj.Name}-VoronoiDebugEdge") edgesToShow = []