ExternalToolpathOptions: Difference between revisions

From SDK
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 29: Line 29:


====Example Code:====
====Example Code:====
  <nowiki>function CreateToolpath(name, vectors, start_depth)
  function CreateToolpath(name, vectors, start_depth)
-- Create tool we will use to machine vectors
  -- Create tool we will use to machine vectors
local tool = Tool("Lua End Mill",
local tool = Tool("Lua End Mill",
Tool.END_MILL -- BALL_NOSE, END_MILL, VBIT
Tool.END_MILL -- BALL_NOSE, END_MILL, VBIT
)
)
tool.InMM = true
tool.InMM = true
tool.ToolDia = 3.0
tool.ToolDia = 3.0
tool.Stepdown = 2.0
tool.Stepdown = 2.0
tool.Stepover = 1.0
tool.Stepover = 1.0
tool.RateUnits = Tool.MM_SEC -- MM_SEC, MM_MIN, METRES_MIN, -- INCHES_SEC, INCHES_MIN, FEET_MIN
tool.RateUnits = Tool.MM_SEC -- MM_SEC, MM_MIN, METRES_MIN, INCHES_SEC, INCHES_MIN, FEET_MIN
tool.FeedRate = 30
tool.FeedRate = 30
tool.PlungeRate = 10
tool.PlungeRate = 10
tool.SpindleSpeed = 20000
tool.SpindleSpeed = 20000
tool.ToolNumber = 1
tool.ToolNumber = 1
tool.VBitAngle = 90.0    -- used for vbit only
tool.VBit_Angle = 90.0    -- used for vbit only
tool.ClearStepover = 1.0 -- used for vbit only
tool.ClearStepover = 1.0 -- used for vbit only
 
 
-- Create object used to set home position and safez gap above material surface
  -- Create object used to set home position and safez gap above material surface
local pos_data = ToolpathPosData()
local pos_data = ToolpathPosData()
pos_data:SetHomePosition(0, 0, 5.0)
pos_data:SetHomePosition(0, 0, 5.0)
pos_data.SafeZGap = 5.0
pos_data.SafeZGap = 5.0
 
-- object used to pass data on toolpath settings
  -- object used to pass data on toolpath settings
toolpath_options = ExternalToolpathOptions()
toolpath_options = ExternalToolpathOptions()
toolpath_options.StartDepth = start_depth
toolpath_options.StartDepth = start_depth
toolpath_options.CreatePreview = true
toolpath_options.CreatePreview = true
 
-- Create our toolpath
  -- Create our toolpath
local toolpath = ExternalToolpath(name,tool, pos_data, toolpath_options, vectors)  
local toolpath = ExternalToolpath(name,tool, pos_data, toolpath_options, vectors)  
 
if toolpath:Error() then
  if toolpath:Error() then
    DisplayMessageBox("Error creating toolpath")
    DisplayMessageBox("Error creating toolpath")
    return
    return
end
  end
local toolpath_manager = ToolpathManager()
  local toolpath_manager = ToolpathManager()
success = toolpath_manager:AddExternalToolpath(toolpath)
  success = toolpath_manager:AddExternalToolpath(toolpath)
return success
  return success
end    </nowiki>
end     





Latest revision as of 10:17, 16 November 2024

Back.jpg

This object is used to hold the settings for an external toolpath.

Constructor

ExternalToolpathOptions()

Create a new object ready to have its parameters set

Properties

.CreatePreview

Interaction: Read and Write

Returns: (bool) if true, create preview in 2d view for this toolpath



.StartDepth

Interaction: Read and Write

Returns: (double) Start depth for toolpath below material surface


Example Code:

function CreateToolpath(name, vectors, start_depth)
 -- Create tool we will use to machine vectors
local tool = Tool("Lua End Mill",
Tool.END_MILL -- BALL_NOSE, END_MILL, VBIT
)
tool.InMM = true
tool.ToolDia = 3.0
tool.Stepdown = 2.0
tool.Stepover = 1.0
tool.RateUnits = Tool.MM_SEC -- MM_SEC, MM_MIN, METRES_MIN, INCHES_SEC, INCHES_MIN, FEET_MIN
tool.FeedRate = 30
tool.PlungeRate = 10
tool.SpindleSpeed = 20000
tool.ToolNumber = 1
tool.VBit_Angle = 90.0    -- used for vbit only
tool.ClearStepover = 1.0 -- used for vbit only


 -- Create object used to set home position and safez gap above material surface
local pos_data = ToolpathPosData()
pos_data:SetHomePosition(0, 0, 5.0)
pos_data.SafeZGap = 5.0

 -- object used to pass data on toolpath settings
toolpath_options = ExternalToolpathOptions()
toolpath_options.StartDepth = start_depth
toolpath_options.CreatePreview = true

 -- Create our toolpath
local toolpath = ExternalToolpath(name,tool, pos_data, toolpath_options, vectors) 

 if toolpath:Error() then
    DisplayMessageBox("Error creating toolpath")
    return
 end
 local toolpath_manager = ToolpathManager()
 success = toolpath_manager:AddExternalToolpath(toolpath)
 return success
end     


Back.jpg

References

Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 2.05, published September 12, 2018. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information