Open ES-Alexander opened 1 year ago
This is definitely a good addition! It might be good to implement it in gradually increasing complexity:
The code-base refactor is kinda waiting to see how flexible it seems FullControl should be (based on what people are using it for). If its most valuable for toolpath generation of new and unique systems, then the structure needs to be simpler and more accessible to people who will change it (e.g. new axes, new tool concepts, new stuff we can't predict...) - ideally even if they don't have much python expertise or software engineering experience. Whereas if it's really focused on extrusion 3D printing, or more generally path-based 3D printing, or path-based stuff like plotting, then it may be more acceptable to somewhat focus on enabling those applications at the expense of simplicity. But overall your suggestion doesn't contradict anything we're currently considering. And importantly, any code developed for the collision stuff will easily translate regardless of the refactoring.
A couple of ideas that may be relevant to implementing this efficiently:
FYI I've been working a lot with 6-axis robot arms over the last year and will be getting them into FullControl at some point. Collision detection will be even more important for them, so it would really to bee to give this as generic functions. You are implying in your comment, I'm just reiterating for clarity. We've been thinking about simple collision detection stuff there too and also thought distance functions would be good as a simple first-check. The centres of all 6 robot joints are known for each point in the toolpath and their approximate size. So this can be checked against the current toolpath. The scales are such that there's no need to consider a meshed previous of the toolpath. A simple distance check between all lines in the toolpath to a given point, and the robot joint positions at that point is already extremely valuable.
My thinking is to get an as-simple-as-possible solution up and running for the most basic checks, which are still extremely valuable, and then go from there.
This could be varying degrees of difficult depending on how it's approached, but it seems like a valuable feature for any kind of tool-path generation software.
My personal preference would be the codebase being refactored such that everything stems from a base
Machine
class, which has3D Printer
as a sub-class, and 3D printer types can have specified frame and bed geometries, and get initialised with a particular nozzle. The tool-path generation and plotting could both be handled by the selected machine, which should simplify plotting different types of machines (and animations once that's relevant) and should also simplify the logic for when a collision could occur (because e.g. a cartesian printer will have some different collision opportunities compared to a delta or polar printer).That said, I'm sure it's also possible by adding a more general collision detection module into the existing functionality-focused abstraction.