Skip to content

Commit

Permalink
Fixed "prnt" function to properly limit to 4 decimal places
Browse files Browse the repository at this point in the history
Greatly simplify rebaseWire
  • Loading branch information
dbtayl committed Feb 21, 2016
1 parent a3209e1 commit 3775956
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
16 changes: 2 additions & 14 deletions src/Mod/Draft/DraftGeomUtils.py
Expand Up @@ -2075,20 +2075,8 @@ def rebaseWire(wire,vidx):
if vidx > len(wire.Vertexes):
#print("Vertex index above maximum\n")
return wire
basepoint = wire.Vertexes[vidx-1].Point
#wire = Part.__sortEdges__(wire)
edges = []
start = False
for i in range(len(wire.Edges)):
if wire.Edges[i].Vertexes[0].Point == basepoint:
start = True
edges.append(wire.Edges[i])
elif start:
edges.append(wire.Edges[i])
if len(edges) < len(wire.Edges):
f = len(wire.Edges) - len(edges)
edges.extend(wire.Edges[0:f])
return Part.Wire(edges)
#This can be done in one step
return Part.Wire(wire.Edges[vidx-1:] + wire.Edges[:vidx-1])


# circle functions *********************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/PathPocket.py
Expand Up @@ -179,7 +179,7 @@ def execute(self,obj):
# print "finishDepth" + str(obj.FinishDepth)
# print "offsets:", len(offsets)

def prnt(vlu): return str(round(vlu, 4))
def prnt(vlu): return str("%.4f" % round(vlu, 4))

for vpos in frange(obj.StartDepth, obj.FinalDepth, obj.StepDown, obj.FinishDepth):
# print "vpos: " + str(vpos)
Expand Down

0 comments on commit 3775956

Please sign in to comment.