checkpoint

This commit is contained in:
Markus Lampert
2017-10-22 11:09:51 -07:00
committed by Yorik van Havre
parent 9246723ad9
commit 0a24c0fa95
2 changed files with 17 additions and 8 deletions

View File

@@ -42,8 +42,11 @@ from PySide import QtCore
"""Holding Tags Dressup object and FreeCAD command"""
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
#PathLog.trackModule()
if False:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
PathLog.trackModule()
else:
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
# Qt tanslation handling
def translate(context, text, disambig=None):
@@ -643,14 +646,18 @@ class PathData:
ordered.append(t)
# disable all tags that are not on the base wire.
for tag in tags:
PathLog.notice("Tag #%d not on base wire - disabling\n" % len(ordered))
PathLog.info("Tag #%d (%.2f, %.2f) not on base wire - disabling\n" % (len(ordered), tag.x, tag.y))
tag.enabled = False
ordered.append(tag)
return ordered
def pointIsOnPath(self, p):
for e in self.edges:
if DraftGeomUtils.isPtOnEdge(p, e):
v = Part.Vertex(FreeCAD.Vector(p.x, p.y, self.minZ))
PathLog.info("pt = (%f, %f, %f)" % (v.X, v.Y, v.Z))
for e in self.bottomEdges:
indent = "{} ".format(e.distToShape(v)[0])
debugEdge(e, indent, True)
if PathGeom.isRoughly(v.distToShape(e)[0], 0.0, 1.0):
return True
return False
@@ -823,7 +830,7 @@ class ObjectTagDressup:
if tag.enabled:
if prev:
if prev.solid.common(tag.solid).Faces:
PathLog.notice("Tag #%d intersects with previous tag - disabling\n" % i)
PathLog.info("Tag #%d intersects with previous tag - disabling\n" % i)
PathLog.debug("this tag = %d [%s]" % (i, tag.solid.BoundBox))
tag.enabled = False
elif self.pathData.edges:
@@ -831,7 +838,7 @@ class ObjectTagDressup:
p0 = e.valueAt(e.FirstParameter)
p1 = e.valueAt(e.LastParameter)
if tag.solid.isInside(p0, PathGeom.Tolerance, True) or tag.solid.isInside(p1, PathGeom.Tolerance, True):
PathLog.notice("Tag #%d intersects with starting point - disabling\n" % i)
PathLog.info("Tag #%d intersects with starting point - disabling\n" % i)
tag.enabled = False
if tag.enabled:

View File

@@ -255,7 +255,7 @@ class PathDressupTagTaskPanel:
self.Positions.append(FreeCAD.Vector(point.x, point.y, 0))
self.updateTagsView()
else:
print("ignore new tag at %s" % (point))
print("ignore new tag at %s (obj=%s, on-path=%d" % (point, obj, 0))
def addNewTag(self):
self.tags = self.getTags(True)
@@ -310,6 +310,8 @@ class PathDressupTagTaskPanel:
self.pt = FreeCADGui.Snapper.snap(pos, lastpoint=start, active=cntrl, constrain=shift)
plane = FreeCAD.DraftWorkingPlane
p = plane.getLocalCoords(self.pt)
v = pos.getValue()
PathLog.info("mouseMove(%s, %s, %s)" % (self.view.getPoint(v[0], v[1]), self.pt, p))
displayPoint(p)
def click(cb):