Skip to content

Commit 8991e5a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 34ab659 commit 8991e5a

File tree

1 file changed

+13
-33
lines changed

1 file changed

+13
-33
lines changed

src/Mod/CAM/Path/Op/Vcarve.py

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,7 @@ def setupAdditionalProperties(self, obj):
280280
"App::PropertyLinkList",
281281
"BaseShapes",
282282
"Path",
283-
QT_TRANSLATE_NOOP(
284-
"App::Property", "Additional base objects to be engraved"
285-
),
283+
QT_TRANSLATE_NOOP("App::Property", "Additional base objects to be engraved"),
286284
)
287285
obj.setEditorMode("BaseShapes", 2) # hide
288286

@@ -321,9 +319,7 @@ def initOperation(self, obj):
321319
"App::PropertyFloat",
322320
"Discretize",
323321
"Path",
324-
QT_TRANSLATE_NOOP(
325-
"App::Property", "The deflection value for discretizing arcs"
326-
),
322+
QT_TRANSLATE_NOOP("App::Property", "The deflection value for discretizing arcs"),
327323
)
328324
obj.addProperty(
329325
"App::PropertyFloat",
@@ -376,9 +372,7 @@ def insert_many_wires(vd, wires):
376372
dist = ptv[-1].distanceToPoint(ptv[0])
377373
if dist < FreeCAD.Base.Precision.confusion():
378374
Path.Log.debug(
379-
"Removing bad carve point: {} from polygon origin".format(
380-
dist
381-
)
375+
"Removing bad carve point: {} from polygon origin".format(dist)
382376
)
383377
del ptv[-1]
384378
ptv.append(ptv[0])
@@ -408,9 +402,7 @@ def insert_many_wires(vd, wires):
408402
vd.colorExterior(EXTERIOR1)
409403
vd.colorExterior(
410404
EXTERIOR2,
411-
lambda v: not f.isInside(
412-
v.toPoint(f.BoundBox.ZMin), obj.Tolerance, True
413-
),
405+
lambda v: not f.isInside(v.toPoint(f.BoundBox.ZMin), obj.Tolerance, True),
414406
)
415407

416408
wires = _collectVoronoiWires(vd)
@@ -477,19 +469,15 @@ def _cutWire(wire, currentPosition=None):
477469
path.append(Path.Command("G0 Z{}".format(obj.SafeHeight.Value)))
478470
path.append(
479471
Path.Command(
480-
"G0 X{} Y{} Z{}".format(
481-
newPosition.x, newPosition.y, obj.SafeHeight.Value
482-
)
472+
"G0 X{} Y{} Z{}".format(newPosition.x, newPosition.y, obj.SafeHeight.Value)
483473
)
484474
)
485475

486476
hSpeed = obj.ToolController.HorizFeed.Value
487477
vSpeed = obj.ToolController.VertFeed.Value
488478
path.append(
489479
Path.Command(
490-
"G1 X{} Y{} Z{} F{}".format(
491-
newPosition.x, newPosition.y, newPosition.z, vSpeed
492-
)
480+
"G1 X{} Y{} Z{} F{}".format(newPosition.x, newPosition.y, newPosition.z, vSpeed)
493481
)
494482
)
495483
for e in wire:
@@ -515,9 +503,7 @@ def _cutWire(wire, currentPosition=None):
515503
_maximumUsableDepth = _get_maximumUsableDepth(wires, geom)
516504
if _maximumUsableDepth is not None:
517505
maximumUsableDepth = _maximumUsableDepth
518-
Path.Log.debug(
519-
f"Maximum usable depth for current face: {maximumUsableDepth}"
520-
)
506+
Path.Log.debug(f"Maximum usable depth for current face: {maximumUsableDepth}")
521507

522508
# first pass
523509
cutWires(wires, pathlist, obj.OptimizeMovements)
@@ -555,9 +541,7 @@ def opExecute(self, obj):
555541

556542
if obj.ToolController.Tool.CuttingEdgeAngle >= 180.0:
557543
Path.Log.info(
558-
translate(
559-
"CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees."
560-
)
544+
translate("CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees.")
561545
)
562546
return
563547

@@ -575,9 +559,9 @@ def opExecute(self, obj):
575559

576560
if not faces:
577561
for model in self.model:
578-
if model.isDerivedFrom(
579-
"Sketcher::SketchObject"
580-
) or model.isDerivedFrom("Part::Part2DObject"):
562+
if model.isDerivedFrom("Sketcher::SketchObject") or model.isDerivedFrom(
563+
"Part::Part2DObject"
564+
):
581565
faces.extend(model.Shape.Faces)
582566

583567
if faces:
@@ -625,14 +609,10 @@ def debugVoronoi(self, obj):
625609
"""Debug function to display calculated voronoi edges"""
626610

627611
if not getattr(self, "voronoiDebugCache", None):
628-
Path.Log.error(
629-
"debugVoronoi: empty debug cache. Recompute VCarve operation first"
630-
)
612+
Path.Log.error("debugVoronoi: empty debug cache. Recompute VCarve operation first")
631613
return
632614

633-
vPart = FreeCAD.activeDocument().addObject(
634-
"App::Part", f"{obj.Name}-VoronoiDebug"
635-
)
615+
vPart = FreeCAD.activeDocument().addObject("App::Part", f"{obj.Name}-VoronoiDebug")
636616

637617
wiresToShow = []
638618

0 commit comments

Comments
 (0)