Skip to content

Commit

Permalink
Process BaseShapes in vcarve and only fall back to the model if nothi…
Browse files Browse the repository at this point in the history
…ng was found to engrave.
  • Loading branch information
mlampert committed Jan 25, 2021
1 parent 38b142b commit 13a4f54
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/Mod/Path/PathScripts/PathVcarve.py
Expand Up @@ -311,26 +311,25 @@ def opExecute(self, obj):
PathLog.track()

if not hasattr(obj.ToolController.Tool, "CuttingEdgeAngle"):
FreeCAD.Console.PrintError(
translate("Path_Vcarve", "VCarve requires an engraving \
cutter with CuttingEdgeAngle") + "\n")
PathLog.error(translate("Path_Vcarve", "VCarve requires an engraving cutter with CuttingEdgeAngle"))

if obj.ToolController.Tool.CuttingEdgeAngle >= 180.0:
FreeCAD.Console.PrintError(
translate("Path_Vcarve",
"Engraver Cutting Edge Angle must be < 180 degrees.") + "\n")
PathLog.error(translate("Path_Vcarve", "Engraver Cutting Edge Angle must be < 180 degrees."))
return

try:
faces = []
if obj.Base:
PathLog.track()
for base in obj.Base:
for sub in base[1]:
shape = getattr(base[0].Shape, sub)
if isinstance(shape, Part.Face):
faces.append(shape)

else:
for base in obj.BaseShapes:
faces.extend(base.Shape.Faces)

for base in obj.Base:
for sub in base[1]:
shape = getattr(base[0].Shape, sub)
if isinstance(shape, Part.Face):
faces.append(shape)

if not faces:
for model in self.model:
if model.isDerivedFrom('Sketcher::SketchObject') or model.isDerivedFrom('Part::Part2DObject'):
faces.extend(model.Shape.Faces)
Expand Down

0 comments on commit 13a4f54

Please sign in to comment.