Hi everyone! I’m new to the community, and I’m excited to make my first contribution!
I prototyped a minimum-viable-product feature for rest machining in FreeCAD. The code is currently rough and messy, but it seems to work as I intended, so I’m posting now to ask for input on what the final feature should look like.
I’ve attached a screenshot showing how the prototype feature is used and what it does. My example job consists of two operations: a normal pocket operation with a 6mm tool, and a second pocket operation run on the same area with a 1.5mm tool with my feature enabled. I created a new property “PrevDiameter” (default 0mm = feature disabled). When this property is set, it is assumed the pocket region has already been machined with a cylindrical tool of the specified diameter, and restricts the area to be machined based on that information. These operations produce two tool paths, a large rectangular path in the center (6mm tool) and four little triangle-ish regions in the corners (1.5mm tool).
So far I’ve only tested with the Pocket operation, and on this one model. I have not tried Adaptive or 3D Pocket yet, but I think this feature should apply there too. I will look into this before making a PR.
I hope to make a follow-up feature that automatically infers PrevDiameter from previous operations and handles non-cylindrical previous-operation tools, but imo this is not part of the MVP feature. I intend for both the feature I’ve prototyped and the follow-up I’ve planned to be exposed to the user: a manual mode and an automatic mode for specifying the previously cleared area. This follow-up will not be a part of my initial PR, but I’m still interested feedback on it and want to provide context for my ideas.
\
Limitations:
-
This feature reduces the area to be machined, but otherwise does not take advantage of knowing that some of the region has already been cleared. Most notably, the tool enters each corner region from the top, not from the side. In an Adaptive operation, it will helix down inside the tiny region of each corner.
-
Related to the above, this feature still machines slightly more area than strictly necessary. There is no reason to trace the part of the outline of the reduced region that is on the interior of the full region, but it does so anyway. This limitation and the one above it both result from me reducing the area that is fed into the path-generation code, but not otherwise modifying or otherwise informing the path generation algorithm.
\
Specific feedback requests:
-
Naming/presentation/usability: I don’t think a property called PrevDiameter hidden away in the property list is a good way to advertise this feature to users. I’d appreciate ideas on how this feature should be invoked and what it should be called. Perhaps it belongs in the pocket GUI somewhere?
-
Testing: what are the norms for testing features like this? Is there a standard set of models? Should I mark this feature as experimental for now (and if so how)?
-
Follow-up feature: any comments on my plans for follow-up work?
-
Coding help: App/Area.cpp uses a lot of macros like PARAM_ENUM_CONVERT and PARAM_FIELDS to interact with properties. I get the sense that my code should be using them too when I access user parameters and configurations for clipper operations, but I don’t understand what I should do with them and have instead been using parameters directly (i.e. myParams.PrevDiameter, myParams.ToolRadius) and invoking clipper offset and difference operations with default parameters. Is there any documentation on these macros?
Thanks in advance for your comments and help!
David