diff --git a/src/Mod/Path/PathScripts/PathEngrave.py b/src/Mod/Path/PathScripts/PathEngrave.py index b10662ae38..1083377a50 100644 --- a/src/Mod/Path/PathScripts/PathEngrave.py +++ b/src/Mod/Path/PathScripts/PathEngrave.py @@ -35,13 +35,8 @@ from PySide import QtCore __doc__ = "Class and implementation of Path Engrave operation" -LOGLEVEL = False - -if LOGLEVEL: - PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) - PathLog.trackModule(PathLog.thisModule()) -else: - PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) +PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) +PathLog.trackModule(PathLog.thisModule()) # Qt translation handling @@ -84,6 +79,7 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): jobshapes = [] if len(obj.Base) >= 1: # user has selected specific subelements + PathLog.track(len(obj.Base)) wires = [] for base, subs in obj.Base: edges = [] @@ -104,6 +100,7 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): jobshapes.append(Part.makeCompound(wires)) else: # Use the Job Base object + PathLog.track(self.model) for base in self.model: PathLog.track(base.Label) if base.isDerivedFrom('Part::Part2DObject'): @@ -121,7 +118,6 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): if len(jobshapes) > 0: PathLog.debug('processing {} jobshapes'.format(len(jobshapes))) - PathLog.track() wires = [] for shape in jobshapes: PathLog.debug('jobshape has {} edges'.format(len(shape.Edges))) @@ -130,6 +126,7 @@ class ObjectEngrave(PathEngraveBase.ObjectOp): self.buildpathocc(obj, shape.Wires, self.getZValues(obj)) wires.extend(shapeWires) self.wires = wires + PathLog.debug('processing {} jobshapes -> {} wires'.format(len(jobshapes), len(wires))) # the last command is a move to clearance, which is automatically added by PathOp if self.commandlist: self.commandlist.pop() diff --git a/src/Mod/Path/PathScripts/PathGeom.py b/src/Mod/Path/PathScripts/PathGeom.py index 8cf7bff715..ae26c53b5a 100644 --- a/src/Mod/Path/PathScripts/PathGeom.py +++ b/src/Mod/Path/PathScripts/PathGeom.py @@ -38,13 +38,8 @@ __doc__ = "Functions to extract and convert between Path.Command and Part.Edge a Tolerance = 0.000001 -LOGLEVEL = False - -if LOGLEVEL: - PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) - PathLog.trackModule(PathLog.thisModule()) -else: - PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) +PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) +PathLog.trackModule(PathLog.thisModule()) # Qt translation handling def translate(context, text, disambig=None): @@ -523,8 +518,11 @@ def flipEdge(edge): # Now the edge always starts at 0 and LastParameter is the value range arc = Part.Edge(circle, 0, edge.LastParameter - edge.FirstParameter) return arc - elif Part.BSplineCurve == type(edge.Curve): - spline = edge.Curve + elif type(edge.Curve) in [Part.BSplineCurve, Part.BezierCurve]: + if type(edge.Curve) == Part.BSplineCurve: + spline = edge.Curve + else: + spline = edge.Curve.toBSpline() mults = spline.getMultiplicities() weights = spline.getWeights() @@ -556,4 +554,6 @@ def flipWire(wire): '''Flip the entire wire and all its edges so it is being processed the other way around.''' edges = [flipEdge(e) for e in wire.Edges] edges.reverse() + PathLog.debug(edges) return Part.Wire(edges) +