Yes, maybe it is close to that.sliptonic wrote:This sounds a lot like another kind of application called a 'conversational cnc' program
In Linuxcnc (that I use) I know the possibility to enter Gcode directly. Is that what you mean?
Yes, maybe it is close to that.sliptonic wrote:This sounds a lot like another kind of application called a 'conversational cnc' program
You'll have to be more specific about what you're looking for.jcf wrote:I have found this wiki about path:
https://github.com/yorikvanhavre/FreeCA ... ath-module
Is there a place where I could find some more information?
For a start, I have one specific question:sliptonic wrote:
You'll have to be more specific about what you're looking for.
Code: Select all
obj = FreeCAD.ActiveDocument.addObject("Path::FeatureCompoundPython", "Job")
PathJob.ObjectPathJob(obj)
PathLoadTool.CommandPathLoadTool.Create(obj.Name)
tl = obj.Group[0]
tool = Path.Tool()
tool.Diameter = 3.0
tool.Name = str(tool.Diameter)+"mm mill"
tool.CuttingEdgeHeight = 15.0
tool.ToolType = "EndMill"
tool.Material = "HighSpeedSteel"
obj.Tooltable.addTools(tool)
tl.ToolNumber = 1
# GUI edit tool
obj.ViewObject.Proxy.deleteOnReject = True
obj.ViewObject.startEditing()
# close GUI window
Take a look in the PathScripts/PathContour.py file.jcf wrote:sliptonic wrote:
For a start, I have one specific question:
When I press the "Create Contour Path" button, where do I go in PathScripts?
Where is the entry point?
It fires a signal. It's executing the code in the ViewProviderFace.setEdit() method to close any other dialogs and open the task panel....
# GUI edit tool
obj.ViewObject.Proxy.deleteOnReject = True
obj.ViewObject.startEditing()
# close GUI window
[/code]
What puzzles me is the editing.
I would like to know what's going on there.
Code: Select all
# -*- coding: utf-8 -*-
# Macro for initializing Path Job and setting tool and feed rate
import FreeCAD
import PathScripts.PathJob as PathJob
import PathScripts.PathLoadTool as PathLoadTool
import Path
# create Path Job
myjob = FreeCAD.ActiveDocument.addObject("Path::FeatureCompoundPython", "Job")
PathJob.ObjectPathJob(myjob)
# get first drawing object and set it as job.Base:
objs = FreeCAD.ActiveDocument.Objects
firstobj = objs[0]
myjob.Base=firstobj
# Create tool
tool = Path.Tool()
tool.Diameter = 3.0
tool.Name = str(tool.Diameter)+"mm mill"
tool.CuttingEdgeHeight = 15.0
tool.ToolType = "EndMill"
tool.Material = "HighSpeedSteel"
# Load tool:
PathLoadTool.CommandPathLoadTool.Create(myjob.Name)
myjob.Tooltable.addTools(tool)
tl = myjob.Group[0]
tl.ToolNumber = 1
# set feed rates
tl.HorizFeed=200
tl.VertFeed = 200
tl.HorizRapid = 300
tl.VertRapid = 500
tl.SpindleSpeed = 10000.00
myjob.X_Max= 400
myjob.Y_Max= 300
myjob.Z_Max= 50
myjob.Z_Min= -80
myjob.UsePlacements = True
# eventually activate GUI edit tool
## myjob.ViewObject.Proxy.deleteOnReject = True
## myjob.ViewObject.startEditing()
# close GUI window
# activate Path workbench:
# Gui.activateWorkbench("PathWorkbench")
Code: Select all
import PathScripts.PathContour
Gui.activateWorkbench("MyPathWorkbench")
# create contour object:
mycontour = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", "Contour")
PathScripts.PathContour.ObjectContour(mycontour)
PathScripts.PathContour._ViewProviderContour(mycontour.ViewObject)
# set properties:
mycontour.Active = True
mycontour.ClearanceHeight = 20.0
mycontour.StepDown = 1.0
mycontour.StartDepth= 0.0
mycontour.FinalDepth= -3.0
mycontour.SafeHeight = 12.0
mycontour.OffsetExtra = 0.0
mycontour.Direction = "CW"
mycontour.UseComp = True
PathScripts.PathUtils.addToJob(mycontour)
PathScripts.PathContour.ObjectContour.setDepths(mycontour.Proxy, mycontour)
Code: Select all
DeprecationWarning: For future usage 'Curve' will return 'Line' which is infinite instead of the limited 'LineSegment'.
If you need a line segment then use this:
Part.LineSegment(edge.Curve,edge.FirstParameter,edge.LastParameter)
To suppress the warning set BaseApp/Preferences/Mod/Part/General/LineOld to false
...
Code: Select all
Something unexpected happened. Unable to generate a contour path. Check project and tool config.
Code: Select all
FreeCAD.ActiveDocument.recompute()