I'd like to create a new MOP subtype to do v-carve style engraving, using the cutter depth to control the width of cut.
I've looked at the demo plugin, and poked around with the object browser, and generally this is what I've figured out:
- MOPs appear to inherit from CamBam.CAM.MachineOp or CamBam.CAM.MOPFromGeometry. The latter appears to be the usual case, when a machine op is tied to a particular part of the CAD drawing.
- The MOP is created with a constructor taking a CamBam.CAD.CADFile and a CamBam.CAD.EntityCollection. Presumably the later is the geometry that the MOP should machine
- There appears to be three methods that a MOP needs to implement:
- GenerateToolPaths(CamBam.CAD.CADFile)
- Paint(CamBam.CAD.CADView, System.Drawing.Graphics, System.Drawing.Pen, System.Drawing.Pen, bool)
- CamBam.CAM.MOPPocket.PostProcess(CamBam.CAM.MachineOpToGCode)
I'm guessing that GenerateToolPaths is called when you generate toolpaths (d'oh!). It's not clear if it just updates the MOPs internal data or if it makes changes to the CADFile passed in.
Paint seems like the usual callback. My guess is that the two pens are for toolpath and cut width, and the bool controls whther to draw the latter. I'm really taking a stab in the dark on that one.
The PostProcess method appears to generate GCode. The MachineOpToGCode has a bunch of methods to add g-code to the output, so that seems pretty straight forward.
So, my open questions are:
- How much did I get right?
- How do you add a menu item, keyboard accelerator, and toolbar button for the new machine op?
- What did I miss?
It seems like I should be able to hook in and generate any sort of custom toolpath I like. Is that about right?