[Solved] Pocket: Changing order of the Offset operation

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

[Solved] Pocket: Changing order of the Offset operation

Post by pathfinder »

Hello,

I'm pretty sure I asked this before, but I have a hard time finding it again, so sorry in advance for asking this once more:

I'm currently trying to use the pocket operations offset function. I'd like to use the offset function to work from the inside to the outside, but I don't see an option to change the direction and I need it to work from the inside out, to both prevent pillars that break off and create gouges and to prevent loose parts from flopping around when I go through the material. I figured out that in multi level operations, the solver does either outside in or inside out, but I don't have direct control over it.

I've also noticed with the zigzag offset that it does the offset first and zigzag second, which creates similar issues. Using the function to create a hole creates loose parts and creating pillars is also not good because with brittle material, there is the risk of the pillars breaking off and creating gouges.

Am I missing an option somewhere?

TIA

As for the version I'm on, I'm on mobile right now, so I can only provide that I'm on windows and am using a 0.21 weekly build, but likely not the latest. Sorry for this as well.
Last edited by pathfinder on Thu May 25, 2023 1:18 pm, edited 2 times in total.
Russ4262
Posts: 952
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Pocket: Changing order of the Offset operation

Post by Russ4262 »

Evening.
Here is a Offset Inside-out dressup macro.
Decompress the attached file in your Macro folder.
Run FreeCAD, open your file, and select the Pocket_Shape op you wish to modify.
Run the 'offsetinsideout.FCMacro' and it will create a dressup on the Pocket_Shape op.

The dressup has the following options:
- Cut Inside Out: set order of cuts to start at innermost part of pocket and work outward

Notes:
** This macro has very little testing. Use at your own risk as it carries no warranties or guarantees.
** Verify accuracy and safety of all paths created with this dressup utility.
** This dressup is not effective on pocket ops with multiple pocketing areas processed - it will likely only provide fidelity on one of the areas processed.
** This dressup does not force the cut pattern of the base operation to Offset. Consequently, it might provide the same general cut direction for each layer of whatever cut pattern is used in the base operation.
** This dressup attempts to honor existing starting point for the base Pocket_Shape operation.
** This dressup algorithm will not be effective for all pocket area shapes. Consequently, users will likely find it will fail to produce desired results on some area shapes. For example, donut shaped pockets will likely render this dressup ineffective. There is a solution, but it is not included with this alpha version.

Be it known:
This dressup does make some changes to the base op, recalculates, and restores the original state; therefore, if the dressup fails, the base Pocket_Shape op would potentially be left in an altered state. I recommend you make a copy of the intended base op and use the copy as the base to ensure your original op is not lost. No, this is not the best way to achieve inside out cutting, but I felt I could adapt a prior dressup solution to obtain a usable solution for one issue presented in the OP of this thread.

Cheers,
Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.33110 (Git)
Build type: Release
Branch: master
Hash: 18e40941ceb36c52701a7c74ea26043ef3385701
Python 3.10.10, Qt 5.15.8, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * freecad.gears 1.0.0
  * PathExp
  * Z_MacroStartup
Attachments
OffsetInsideOutMacro.7z
(6.44 KiB) Downloaded 40 times
Last edited by Russ4262 on Wed May 24, 2023 11:39 am, edited 1 time in total.
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Pocket: Changing order of the Offset operation

Post by pathfinder »

Thank you very much, I'll look into it as quickly as possible.

On a more general note; wouldn't it make more sense to change this on a general level?

As I pointed out above, going outside in has several disadvantages while I don't see a strong disadvantage for going inside out.
Russ4262
Posts: 952
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Pocket: Changing order of the Offset operation

Post by Russ4262 »

pathfinder wrote: Wed May 24, 2023 11:25 am .... On a more general note; wouldn't it make more sense to change this on a general level? ...
Morning.
Yes it would, and I believe that will be done.

If memory serves, this layer alternating cut direction issue has been reported previously in the forum. May I suggest scanning reported issues in GitHub to see if the issue is on record there. If not there, my suggestion would be to create one per protocol https://github.com/FreeCAD/FreeCAD/blob ... IBUTING.md.

Thanks for reporting issues to improve FC and user outcomes.

Russell
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Pocket: Changing order of the Offset operation

Post by GeneFC »

pathfinder wrote: Wed May 24, 2023 11:25 am As I pointed out above, going outside in has several disadvantages while I don't see a strong disadvantage for going inside out.
There are definitely times when outside to inside is favored.

Flexibility is the ideal solution. 8-)

Gene
User avatar
pathfinder
Posts: 315
Joined: Mon Oct 04, 2021 10:27 am

Re: Pocket: Changing order of the Offset operation

Post by pathfinder »

GeneFC wrote: Wed May 24, 2023 1:31 pm [...]
Flexibility is the ideal solution. 8-)

Gene
I agree, flexibility is always better.

That being said, in my personal (admittedly limited) experience, I can't recall a situation where inside out would've been disadvantageous, which is why I would suggest making inside out on either the only or the last layer (or zigzag first, offset second) the default.
EricM
Posts: 1
Joined: Fri Dec 29, 2023 9:50 am
Location: Mainz, Germany

Re: Pocket: Changing order of the Offset operation

Post by EricM »

Russ4262 wrote: Wed May 24, 2023 5:00 am Evening.
Here is a Offset Inside-out dressup macro.
[..]
Just registered to say Thank you.
This macro does exactly what I was looking for, namely changing the order of the generated paths to strictly inside out in evey layer of a circular pocket.
Thx a lot :)
Eric
Post Reply