WayofWood wrote: ↑Tue Jan 18, 2022 2:36 pm
Let me brainstorm an idea of what would be an ideal solution for quite a few problems:
We would have something like a GenericPathGenerator that would accept the following parameters:
- A set of shapes
- A propertybag of generic parameters
- The toolbit to be used
- Switch if all shapes or each shape is presented
- G-Code supporting template-toolkit or similar syntax
Implementing my keyhole feature would then be quite simple:
- Add a toolbit.
- Add some circles as shapes
- Add keyholedepth and keyholelength to the propertybag
- Add a script
Code: Select all
G1 F[%toolbit.VertFeed%] [% shape.CenterOfMass %]
G1 F[%toolbit.VertFeed%] [% shape.CenterOfMass.x %] [% shape.CenterOfMass.y %] [% shape.CenterOfMass.z - keyholedepth %]
G1 F[%toolbit.HorizFeed%] [% shape.CenterOfMass.x %] [% shape.CenterOfMass.y + keyholelength %] [% shape.CenterOfMass.z - keyholedepth %]
G1 F[%toolbit.HorizFeed%] [% shape.CenterOfMass.x %] [% shape.CenterOfMass.y %] [% shape.CenterOfMass.z - keyholedepth %]
G1 F[%toolbit.VertFeed%] [% shape.CenterOfMass %]
What do you think - would such a thing be useful for others than myself?
The main concern is the way job and operations are actually made.
You could generate operation, even shapes, but you have to code many things, sometimes, it will be less a problem to directly code operation in a script, that will create all the things without having to fiddle with expression and Spreadsheets.
If you have to code something it is more easy to start from scratch.
It is not difficult to create a script that will create:
- A Job
. A toolcontroller
- Profile and pocketing ops
- and also produce G-Code.
This is roughly an example, with some concepts, developed in a script.
https://forum.freecadweb.org/viewtopic. ... 48#p554648
Obviously it lacks of the "GUI" part that could be easily done creating an input dialog where you have to put your desired value, or even to retrieve the data from a Spreadsheet. Sorry but I haven't used Spreadsheets, so I don't know the related code to eventually create one.
Take in account that "direct Path creation" in other word the use of
Path.fromShapes is considered not the most easy way to go, as this comment from Russ4262 seems to tell
https://forum.freecadweb.org/viewtopic. ... 19#p559319.
Around there are some other experiments, (mostly done by me) there are also some old code in German forum, but as Russ4262 kindly have modified the Path code, following some discussion I have had with him, I think that the most "recent way of doing things" is the code in first link, as it uses 0.20, (Maybe even 0.19.3) Path code modification.
Regards
Carlo D.