Tiling and the path workbench

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!
CandL
Posts: 87
Joined: Thu Oct 29, 2020 6:41 pm

Tiling and the path workbench

Post by CandL »

So I have one of the wood CNCs ( a Onefinity Woodworker) and church want me to make some signs that are larger than the machine bed.

In this genre of CNC the term "tiling" seems to be the correct term. A technique where gage pins are used to register the part as it shifts along on open axis of the machine.

So being the lazy guy I am, I have searched the web for Freecad/Path examples of this technique and have found nothing. Is there a lead out there I am missing? .... or will I blaze a path.

Thanks and regards
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Tiling and the path workbench

Post by chrisb »

You create several Jobs, and shift the model clone which is inside of the clone appropriately. There is no explicit aid for your task, you usually have to know how far to move the clone to make the pins match, or use appropriate Draft snapping tools.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
CandL
Posts: 87
Joined: Thu Oct 29, 2020 6:41 pm

Re: Tiling and the path workbench

Post by CandL »

Thanks for the input. I am thinking of using the MFT style pin/dog layout. If I get a process that works I can either code it up or at least document it.

Thanks again
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Tiling and the path workbench

Post by Russ4262 »

Afternoon.
I have not looked into this particular feature much as it pertains to FreeCAD. I am however, vaguely familiar with the concept. There are two distinct situations to consider: simple independent cuts in differing locations(tiles) on the work piece and compound cuts that involve multiple tiles. I don't know the proper terminology, so I am using 'simple' and 'compound' to differentiate the two types of paths. As it stands, it will not take too much effort to perform tiling that involves simple paths - those that are fully contained within a tile section. It is the compound paths - those that involve material removal across multiple tiles - that the current Path workbench is not setup to handle as easily.

To handle the compound type, it is my thinking that two actions must occur: the physical model for the Job must be shifted [as mentioned by ChrisB above] to the next tile or pinning location, and then a boundary dressup of the same tile region would need to be applied to each compound operation (those operations whose paths cross multiple tiles) in order to limit those paths to the tile boundary.

Just a few thoughts, no real solution presented at this time.

A tiling feature would be a great addition to the Path WB.

Russell
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Tiling and the path workbench

Post by Russ4262 »

CandL wrote: Sun Apr 25, 2021 4:03 pm Thanks for the input. I am thinking of using the MFT style pin/dog layout. If I get a process that works I can either code it up or at least document it.

Thanks again
Afternoon sir.
I like the idea of tiling and think I would find it useful, as would others. So, I put a little time into and and created a simple, crude script to perform the task. See the attached script. The script is quite basic: X and Y shift values, job selection, and a deactivate source ops radio button. Tile data is stored in CustomTile operations in the source job. The tiling job in the images consists of four tiles: 50 mm in X, and 40 mm in Y direction each. I have not verified that all the paths are correctly tiled. Neither have I verified that all tool changes or other op-specific gcode commands are correctly processed. This is a crude macro that appears to be in working order. My machine is down so I am unable to run real-life simulations with air milling, or real test cuts.

I also made some light modifications to the current Path simulator to allow for a crude method of simulating the output of the script. The branch is here (link removed).

Time permitting in the future, I might attempt to convert this macro to a Path tool, utility or operation of sorts for permanent addition to the workbench. I think such a tool could definitely be useful to our wood-working users.

EDIT:
To simulate the tiles produced with this macro, I highly recommend you use the branch linked above with light modification of the PathsimulatorGui.py file to handle the tile macro output. Once you have that branch built, or have copied over the single modified `PathSimulatorGui.py` file into your current `PathScripts` folder, restart FreeCAD and do the following:
1. Run the macro with the desired settings.
2. Make sure all ops within the target job are inactive.
3. Run the Path Simulator multiple times for that job, only simulating a single `CustomTile` object each time and clicking OK to exit each successful simulation.
4. Select each of the `CutMaterial` mesh objects individually, editing the Placement of each, changing the X and Y Position values for each to arrange them in the correct locations.
5. Having arranged all the applicable mesh objects, you should have a reproduction of your source model(s) in the job, as cut by the operations contained in the source job. The last image attached is one such example of the four `CutMaterial` mesh objects correctly positioned after simulating each of the four `CustomTile` objects individually.

EDIT: 6 May 2021 - Removed macro attachment here. Newer version posted later in thread.
EDIT: 7 May 2021 - Removed link to personal branch with modified simulator - branch is unnecessary with newer macro versions.

Enjoy.
Russell
Attachments
Snip macro screenshot-49bb15.png
Snip macro screenshot-49bb15.png (255.83 KiB) Viewed 3327 times
Snip macro screenshot-077946.png
Snip macro screenshot-077946.png (279.92 KiB) Viewed 3327 times
This is an image after using the modified Path simulator branch above and repositioning the results to show correct output of the tiling macro.
This is an image after using the modified Path simulator branch above and repositioning the results to show correct output of the tiling macro.
Snip macro screenshot-31e238.png (248.52 KiB) Viewed 3327 times
Last edited by Russ4262 on Fri May 07, 2021 2:00 pm, edited 2 times in total.
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Tiling and the path workbench

Post by Russ4262 »

More thoughts about above macro...

Using the tiling macro attached to the previous post, I see that tool changes are not included in the CustomTile code that is created. As such, I am thinking I will need to rework the macro in such a was as to create a custom gcode object for each operation within each tile. So, if a job has three operations and you need four tiles, you will likely have 12 CustomTile objects added to the job so that each tool controller and coolant mode can be respected for each operation. Perhaps it would be a good idea to simply create a new job object, copy tools, and add the custom tile objects to the new job to keep the original clean.

Russell
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Tiling and the path workbench

Post by Russ4262 »

Evening fellow forum frequenters.
I have updated the Job Tiling Utility macro I posted earlier in this thread. I am attaching version 2.0 to this post. I also updated and rebased the tile job branch(link removed) with improvements to the Path simulator and other macro-accommodating changes.

Changes in version 2.0 include placement of all CustomTile operations into a new dedicated job for multiple reasons and the synchronization of original op tool controllers with corresponding CustomTile operations based on the same. So, this means that I think you are able to post-process the newly created tile job in steps, so as to only leave all ops pertaining to any one tile active for post-processing, then deactivating that group and activating the group for the next tile to be post-processed.

Be aware: There is a problem still with the tool controller synchronization. The original tool controllers are broken with this macro because I have not learned how to clone the bitshapes for each tool controller. For this reason, only use this macro on a COPY of our original job file.

Next on the list for this project is to correct the bitshape issue so the source job tool controllers are not harmed. After that, I think this macro might be ready to move to a built-in utility rather than a macro. This would allow for easier access in FreeCAD Path and easier development assistance from other contributors. It might be useful to make an independent job for each set of operations for a single tile. This would allow for easier post-processing and tile manipulation - I'll think this through a bit more.

Have fun with a primitive tiling feature in FreeCAD!

EDIT: 6 May 2021 - Removed macro attachment here. Newer version posted later in thread.
EDIT: 7 May 2021 - Removed link to personal branch with modified simulator - branch is unnecessary with newer macro versions.

Russell
Last edited by Russ4262 on Fri May 07, 2021 2:01 pm, edited 2 times in total.
Paula
Posts: 48
Joined: Tue Jan 26, 2021 10:06 pm

Re: Tiling and the path workbench

Post by Paula »

Hi Russell,

I'm not having any success with your macro. I'm using the app image

OS: Debian GNU/Linux 10 (buster) (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.19.1)
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.8
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

Here's what appears in the Report view when I press OK:

18:32:08 Traceback (most recent call last):
18:32:08 File "/home/paula/.FreeCAD/Macro/Tile_Job.FCMacro", line 120, in proceed
18:32:08 tj.execute()
18:32:08 File "/home/paula/.FreeCAD/Macro/Tile_Job.FCMacro", line 385, in execute
18:32:08 self.newJob = self._createTileJob()
18:32:08 File "/home/paula/.FreeCAD/Macro/Tile_Job.FCMacro", line 301, in _createTileJob
18:32:08 newJob = PathJobGui.Create(base, template=None, useGui=False)
18:32:08 TypeError: Create() got an unexpected keyword argument 'useGui'

The other thing is that I can't enter an X or Y offset of more that 99 millimetres which I feel is rather limiting.
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Tiling and the path workbench

Post by Russ4262 »

Paula wrote: Thu Apr 29, 2021 5:41 pm Hi Russell,

I'm not having any success with your macro. I'm using the app image
...
The other thing is that I can't enter an X or Y offset of more that 99 millimetres which I feel is rather limiting.
Afternoon ma'am.
Yes, these versions of the macro are intended for use on top of the custom branch linked above with the macro. However, I am working on a version that is at least 0.19 compatible.

Yes, I failed to understand the defaults for QDoubleSpinbox. It appears that the default max is 100 unless the user codes something different. I have already fixed this one in my current working version locally.

I will post the 0.19 compliant version in this thread when I get to the next release stage, likely in the next day or two.

On a related note, I have pushed an intermediate version with integration into Path WB to the custom branch linked above in this thread, fo those wishing to build and experiment. Unfortunately it has the same max shift bug you identified. I will push that fix to the branch also.

Thanks for the great feedback and willingness to test it out.

Russell
Post Reply