Skip to content

Commit cec8aca

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

File tree

1 file changed

+12
-30
lines changed

1 file changed

+12
-30
lines changed

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

Lines changed: 12 additions & 30 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",
@@ -382,9 +378,7 @@ def insert_many_wires(vd, wires):
382378
dist = ptv[-1].distanceToPoint(ptv[0])
383379
if dist < FreeCAD.Base.Precision.confusion():
384380
Path.Log.debug(
385-
"Removing bad carve point: {} from polygon origin".format(
386-
dist
387-
)
381+
"Removing bad carve point: {} from polygon origin".format(dist)
388382
)
389383
del ptv[-1]
390384
ptv.append(ptv[0])
@@ -484,19 +478,15 @@ def _cutWire(wire, currentPosition=None):
484478
path.append(Path.Command("G0 Z{}".format(obj.SafeHeight.Value)))
485479
path.append(
486480
Path.Command(
487-
"G0 X{} Y{} Z{}".format(
488-
newPosition.x, newPosition.y, obj.SafeHeight.Value
489-
)
481+
"G0 X{} Y{} Z{}".format(newPosition.x, newPosition.y, obj.SafeHeight.Value)
490482
)
491483
)
492484

493485
hSpeed = obj.ToolController.HorizFeed.Value
494486
vSpeed = obj.ToolController.VertFeed.Value
495487
path.append(
496488
Path.Command(
497-
"G1 X{} Y{} Z{} F{}".format(
498-
newPosition.x, newPosition.y, newPosition.z, vSpeed
499-
)
489+
"G1 X{} Y{} Z{} F{}".format(newPosition.x, newPosition.y, newPosition.z, vSpeed)
500490
)
501491
)
502492
for e in wire:
@@ -522,9 +512,7 @@ def _cutWire(wire, currentPosition=None):
522512
_maximumUsableDepth = _get_maximumUsableDepth(wires, geom)
523513
if _maximumUsableDepth is not None:
524514
maximumUsableDepth = _maximumUsableDepth
525-
Path.Log.debug(
526-
f"Maximum usable depth for current face: {maximumUsableDepth}"
527-
)
515+
Path.Log.debug(f"Maximum usable depth for current face: {maximumUsableDepth}")
528516

529517
# first pass
530518
cutWires(wires, pathlist, obj.OptimizeMovements)
@@ -562,9 +550,7 @@ def opExecute(self, obj):
562550

563551
if obj.ToolController.Tool.CuttingEdgeAngle >= 180.0:
564552
Path.Log.info(
565-
translate(
566-
"CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees."
567-
)
553+
translate("CAM_Vcarve", "Engraver cutting edge angle must be < 180 degrees.")
568554
)
569555
return
570556

@@ -582,9 +568,9 @@ def opExecute(self, obj):
582568

583569
if not faces:
584570
for model in self.model:
585-
if model.isDerivedFrom(
586-
"Sketcher::SketchObject"
587-
) or model.isDerivedFrom("Part::Part2DObject"):
571+
if model.isDerivedFrom("Sketcher::SketchObject") or model.isDerivedFrom(
572+
"Part::Part2DObject"
573+
):
588574
faces.extend(model.Shape.Faces)
589575

590576
if faces:
@@ -632,14 +618,10 @@ def debugVoronoi(self, obj):
632618
"""Debug function to display calculated voronoi edges"""
633619

634620
if not getattr(self, "voronoiDebugCache", None):
635-
Path.Log.error(
636-
"debugVoronoi: empty debug cache. Recompute VCarve operation first"
637-
)
621+
Path.Log.error("debugVoronoi: empty debug cache. Recompute VCarve operation first")
638622
return
639623

640-
vPart = FreeCAD.activeDocument().addObject(
641-
"App::Part", f"{obj.Name}-VoronoiDebug"
642-
)
624+
vPart = FreeCAD.activeDocument().addObject("App::Part", f"{obj.Name}-VoronoiDebug")
643625

644626
wiresToShow = []
645627

0 commit comments

Comments
 (0)