PathScripts.PathUtils Namespace Reference

Classes

class  depth_params
 

Functions

def addToJob (obj, jobname=None)
 
def arc (cx, cy, sx, sy, ex, ey, horizFeed=0, ez=None, ccw=False)
 
def changeTool (obj, job)
 
def cleanedges (splines, precision)
 
def curvetowire (obj, steps)
 
def feed (x=None, y=None, z=None, horizFeed=0, vertFeed=0)
 
def filterArcs (arcEdge)
 
def findParentJob (obj)
 
def fmt (val)
 
def GetJobs (jobname=None)
 
def getLastToolLoad (obj)
 
def getTool (obj, number=0)
 
def helicalPlunge (plungePos, rampangle, destZ, startZ, toold, plungeR, horizFeed)
 
def loopdetect (obj, edge1, edge2)
 
def rampPlunge (edge, rampangle, destZ, startZ)
 
def rapid (x=None, y=None, z=None)
 
def reverseEdge (e)
 
def segments (poly)
 

Function Documentation

def PathScripts.PathUtils.addToJob (   obj,
  jobname = None 
)
def PathScripts.PathUtils.arc (   cx,
  cy,
  sx,
  sy,
  ex,
  ey,
  horizFeed = 0,
  ez = None,
  ccw = False 
)
Return gcode string to perform an arc.

Assumes XY plane or helix around Z
Don't worry about starting Z- assume that's dealt with elsewhere
If start/end radii aren't within eps, abort.

cx, cy -- arc center coordinates
sx, sy -- arc start coordinates
ex, ey -- arc end coordinates
ez -- ending Z coordinate.  None unless helix.
horizFeed -- horiz feed speed
ccw -- arc direction

Referenced by PathScripts.PathUtils.helicalPlunge().

def PathScripts.PathUtils.changeTool (   obj,
  job 
)
def PathScripts.PathUtils.cleanedges (   splines,
  precision 
)
cleanedges([splines],precision). Convert BSpline curves, Beziers, to arcs that can be used for cnc paths.
Returns Lines as is. Filters Circle and Arcs for over 180 degrees. Discretizes Ellipses. Ignores other geometry. 

References PathScripts.PathUtils.curvetowire(), PathScripts.PathUtils.filterArcs(), and DraftGeomUtils.geomType().

def PathScripts.PathUtils.curvetowire (   obj,
  steps 
)
adapted from DraftGeomUtils, because the discretize function changed a bit 

Referenced by PathScripts.PathUtils.cleanedges().

def PathScripts.PathUtils.feed (   x = None,
  y = None,
  z = None,
  horizFeed = 0,
  vertFeed = 0 
)
Return gcode string to perform a linear feed.

Referenced by PathScripts.PathUtils.rampPlunge().

def PathScripts.PathUtils.filterArcs (   arcEdge)
filterArcs(Edge) -used to split arcs that over 180 degrees. Returns list 

Referenced by PathScripts.PathUtils.cleanedges().

def PathScripts.PathUtils.findParentJob (   obj)
retrieves a parent job object for an operation or other Path object

Referenced by PathScripts.PathUtils.getTool().

def PathScripts.PathUtils.fmt (   val)
def PathScripts.PathUtils.GetJobs (   jobname = None)
returns all jobs in the current document.  If name is given, returns that job

Referenced by PathScripts.PathUtils.addToJob().

def PathScripts.PathUtils.getLastToolLoad (   obj)
def PathScripts.PathUtils.getTool (   obj,
  number = 0 
)
def PathScripts.PathUtils.helicalPlunge (   plungePos,
  rampangle,
  destZ,
  startZ,
  toold,
  plungeR,
  horizFeed 
)
Return gcode string to perform helical entry move.

plungePos -- vector of the helical entry location
destZ -- the lowest Z position or milling level
startZ -- Starting Z position for helical move
rampangle -- entry angle
toold -- tool diameter
plungeR -- the radius of the entry helix

References PathScripts.PathUtils.arc(), and PathScripts.PathUtils.rapid().

def PathScripts.PathUtils.loopdetect (   obj,
  edge1,
  edge2 
)
Returns a loop wire that includes the two edges.
Useful for detecting boundaries of negative space features ie 'holes'
If a unique loop is not found, returns None
def PathScripts.PathUtils.rampPlunge (   edge,
  rampangle,
  destZ,
  startZ 
)
Return gcode string to linearly ramp down to milling level.

edge -- edge to follow
rampangle -- entry angle
destZ -- Final Z depth
startZ -- Starting Z depth

FIXME: This ramps along the first edge, assuming it's long
enough, NOT just wiggling back and forth by ~0.75 * toolD.
Not sure if that's any worse, but it's simpler
I think this should be changed to be limited to a maximum ramp size.  Otherwise machine time will get longer than it needs to be.

References PathScripts.PathUtils.feed(), and PathScripts.PathUtils.rapid().

def PathScripts.PathUtils.rapid (   x = None,
  y = None,
  z = None 
)
Returns gcode string to perform a rapid move.

Referenced by PathScripts.PathUtils.helicalPlunge(), and PathScripts.PathUtils.rampPlunge().

def PathScripts.PathUtils.reverseEdge (   e)
def PathScripts.PathUtils.segments (   poly)
A sequence of (x,y) numeric coordinates pairs