PathScripts.PathUtils Namespace Reference

Classes

class  depth_params
 
class  PathNoTCExistsException
 

Functions

def addToJob (obj, jobname=None)
 
def drillTipLength (tool)
 
def filterArcs (arcEdge)
 
def findParentJob (obj)
 
def findToolController (obj, proxy, name=None)
 
def fmt (val)
 
def getEnvelope (partshape, subshape=None, depthparams=None)
 
def GetJobs (jobname=None)
 
def getOffsetArea (fcShape, offset, removeHoles=False, plane=Part.makeCircle(10), tolerance=1e-4)
 
def getToolControllers (obj, proxy=None)
 
def guessDepths (objshape, subs=None)
 
def horizontalEdgeLoop (obj, edge)
 
def horizontalFaceLoop (obj, face, faceList=None)
 
def loopdetect (obj, edge1, edge2)
 
def makeWorkplane (shape)
 
def reverseEdge (e)
 
def RtoIJ (startpoint, command)
 
def segments (poly)
 
def simplify3dLine (line, tolerance=1e-4)
 
def sort_locations (locations, keys, attractors=None)
 
def waiting_effects (function)
 

Variables

 DraftGeomUtils = LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")
 
 Part = LazyLoader("Part", globals(), "Part")
 
 TechDraw = LazyLoader("TechDraw", globals(), "TechDraw")
 
 translate = FreeCAD.Qt.translate
 
 UserInput = None
 

Function Documentation

◆ addToJob()

def PathScripts.PathUtils.addToJob (   obj,
  jobname = None 
)
adds a path object to a job
obj = obj
jobname = None

References PathScripts.PathUtils.GetJobs().

◆ drillTipLength()

def PathScripts.PathUtils.drillTipLength (   tool)
returns the length of the drillbit tip.

◆ filterArcs()

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

◆ findParentJob()

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

References PathScripts.PathUtils.findParentJob().

Referenced by PathScripts.PathUtils.findParentJob(), and PathScripts.PathUtils.getToolControllers().

◆ findToolController()

def PathScripts.PathUtils.findToolController (   obj,
  proxy,
  name = None 
)
returns a tool controller with a given name.
If no name is specified, returns the first controller.
if no controller is found, returns None

References PathScripts.PathUtils.getToolControllers().

◆ fmt()

def PathScripts.PathUtils.fmt (   val)

◆ getEnvelope()

def PathScripts.PathUtils.getEnvelope (   partshape,
  subshape = None,
  depthparams = None 
)
getEnvelope(partshape, stockheight=None)
returns a shape corresponding to the partshape silhouette extruded to height.
if stockheight is given, the returned shape is extruded to that height otherwise the returned shape
is the height of the original shape boundbox
partshape = solid object
stockheight = float - Absolute Z height of the top of material before cutting.

References PathScripts.PathUtils.getEnvelope(), and PathScripts.PathUtils.makeWorkplane().

Referenced by PathScripts.PathUtils.getEnvelope().

◆ GetJobs()

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().

◆ getOffsetArea()

def PathScripts.PathUtils.getOffsetArea (   fcShape,
  offset,
  removeHoles = False,
  plane = Part.makeCircle(10),
  tolerance = 1e-4 
)
Make an offset area of a shape, projected onto a plane.
Positive offsets expand the area, negative offsets shrink it.
Inspired by _buildPathArea() from PathAreaOp.py module. Adjustments made
based on notes by @sliptonic at this webpage:
https://github.com/sliptonic/FreeCAD/wiki/PathArea-notes.

References PathScripts.PathUtils.makeWorkplane().

◆ getToolControllers()

def PathScripts.PathUtils.getToolControllers (   obj,
  proxy = None 
)
returns all the tool controllers

References PathScripts.PathUtils.findParentJob().

Referenced by PathScripts.PathUtils.findToolController().

◆ guessDepths()

def PathScripts.PathUtils.guessDepths (   objshape,
  subs = None 
)
takes an object shape and optional list of subobjects and returns a depth_params
object with suggested height/depth values.

objshape = Part::Shape.
subs = list of subobjects from objshape

◆ horizontalEdgeLoop()

def PathScripts.PathUtils.horizontalEdgeLoop (   obj,
  edge 
)
horizontalEdgeLoop(obj, edge) ... returns a wire in the horizontal plane, if that is the only horizontal wire the given edge is a part of.

Referenced by PathScripts.PathUtils.horizontalFaceLoop().

◆ horizontalFaceLoop()

def PathScripts.PathUtils.horizontalFaceLoop (   obj,
  face,
  faceList = None 
)
horizontalFaceLoop(obj, face, faceList=None) ... returns a list of face names which form the walls of a vertical hole face is a part of.
All face names listed in faceList must be part of the hole for the solution to be returned.

References PathScripts.PathUtils.horizontalEdgeLoop().

◆ loopdetect()

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
edge1 = edge
edge2 = edge

◆ makeWorkplane()

def PathScripts.PathUtils.makeWorkplane (   shape)
Creates a workplane circle at the ZMin level.

Referenced by PathScripts.PathUtils.getEnvelope(), and PathScripts.PathUtils.getOffsetArea().

◆ reverseEdge()

def PathScripts.PathUtils.reverseEdge (   e)

◆ RtoIJ()

def PathScripts.PathUtils.RtoIJ (   startpoint,
  command 
)
This function takes a startpoint and an arc command in radius mode and
returns an arc command in IJ mode. Useful for preprocessor scripts

◆ segments()

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

◆ simplify3dLine()

def PathScripts.PathUtils.simplify3dLine (   line,
  tolerance = 1e-4 
)
Simplify a line defined by a list of App.Vectors, while keeping the
maximum deviation from the original line within the defined tolerance.
Implementation of
https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm

◆ sort_locations()

def PathScripts.PathUtils.sort_locations (   locations,
  keys,
  attractors = None 
)
sort holes by the nearest neighbor method
keys: two-element list of keys for X and Y coordinates. for example ['x','y']
originally written by m0n5t3r for PathHelix

References DraftVecUtils.dist().

◆ waiting_effects()

def PathScripts.PathUtils.waiting_effects (   function)

Variable Documentation

◆ DraftGeomUtils

PathScripts.PathUtils.DraftGeomUtils = LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")

◆ Part

PathScripts.PathUtils.Part = LazyLoader("Part", globals(), "Part")

◆ TechDraw

PathScripts.PathUtils.TechDraw = LazyLoader("TechDraw", globals(), "TechDraw")

◆ translate

PathScripts.PathUtils.translate = FreeCAD.Qt.translate

◆ UserInput

PathScripts.PathUtils.UserInput = None