Creating a "fold" in Path with a Drag Knife... possible?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

Hello all,
Perhaps I'm simply not seeing the wood for the trees. I hope somebody might be able to either point me in the right direction, or tell me that what I'm looking for is not possible.

Imagine a simple scenario: using a drag-knife to cut out an Xmm * Ymm square to a known depth Z. If you wish to be able to fold that square, you might want the drag knife to score a line at depth Z/2 from (X/2,0) to (X/2,Y)... just straight down the center. i.e. the outline of the square should be removed (I can happily setup path to do this thanks to a video from @sliptonic) but how should I define an operation to score a line down the center of the piece?

As I understand it the drag-knife dress-up only works with the Profile operation. I don't seem to be able to apply a Profile operation to an edge. Should I be creating a second operation on some extremely thin and long rectangle representing the score line? Should I be manually creating a path which has a lead-in? What would be the right approach here?

I'm very sorry if this is an idiotically stupid question, I just don't seem to know quite where to start!
User avatar
Willem
Veteran
Posts: 1854
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by Willem »

Here is a video about making a knife
phpBB [video]
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

Hi Willem, I don't see how that video is relevant. I'll try to explain more clearly...

Imagine the following shows a piece of card.
Screenshot from 2021-10-10 22-02-59.png
Screenshot from 2021-10-10 22-02-59.png (7.31 KiB) Viewed 2716 times
I can create a cutting Profile Operation using the Path Workbench with a drag-knife dressup operation.
However, this will only cut around the external edge of the shape.

How would I persuade the drag knife to cut a path which corresponds to the slit in the shape (which will allow the card to be bent/folded)?

Thanks!
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

I tried a different approach, but ran into other unexpected problems. If (in my little test scenario) I include a stretched cube to represent the cut, which I make half the height of the other object, what happens is that the second shape gets cut all the way down to the base (rather than simply being scored, stopping at half height).
Screenshot from 2021-10-11 14-59-49.png
Screenshot from 2021-10-11 14-59-49.png (26.52 KiB) Viewed 2500 times
I seems I CAN abuse the engrave function, to cut along a selected edge... Unfortunately, the drag-knife dressup doesn't seem to work with the engraving operation... or is it just me?

Any other ideas about how this could be approached (to create a half-depth cut) with a blade... am I just missing something incredibly obvious here?!?
Last edited by bensenior on Mon Oct 11, 2021 1:09 pm, edited 1 time in total.
User avatar
papyblaise
Veteran
Posts: 8001
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by papyblaise »

if I understand correctly, you want to make a groove parallel to a face and of a certain depth
here is a parallel grove of the top example above and of any depth
this is the drawing, as far as the CNC control is concerned, I don't know anything about it, but I know that the 1st action is the drawing
Attachments
rainure.PNG
rainure.PNG (24.66 KiB) Viewed 2402 times
rainure.FCStd
(37.33 KiB) Downloaded 40 times
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by sliptonic »

The dragknife dressup just puts the 'corner actions' on when the knife has to lift to make an sharp turn. For the slot, there's no need for the dressup since it's a straight edge.

The question is how to get the tool to follow a single open edge. In this case, I would probably model it as a very narrow rectangle pocketed partial depth and then use a slot operation to get the medial line.

Attached a sample.
Attachments
dragslot.FCStd
(37.46 KiB) Downloaded 46 times
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

Thank you so much for your reply. Unfortunately, when I try to recreate the file you created I find I don't have a "Slot" tool in either 0.19.2 or the current dev build (Path->Slot doesn't exist). Is there something I need to additionally install?

Do you also have any advice about point 6 below?

>> For future reference (anybody following along who wants to try to cut that file) you'll need to :
1) Shrink the test piece to a better testing size (40mmx40mm for example (optional).
2) In Stock, set the Z-Axis extension to 0, probably altering X/Y extensions to 10mm.
3) In Stock, Refresh the Model's bounding box.
4) In Job -> Output remove the IP arguments and set the post processor to GRBL (this *partially* works, cutting the perimeter, but not the slot so far)
5) In DragKnife Dressup reduce the OffsetDistance to 0,5mm (for the small vinyl cutting knives)
6) *IMPORTANT* (I think?!?) - the default X/Y origin is set to the corner of the model. This means the dragknife "overshoots" will cause your CNC to ram against its origins. I think, you need to widen the Stock and set the X=0 and Y=0 to the bottom corner *of the stock*... although this seems to play hell with the GUI representation (see below)?!?
Screenshot from 2021-10-12 21-05-49.png
Screenshot from 2021-10-12 21-05-49.png (22.03 KiB) Viewed 2218 times
EDIT: In point 4, the gcode being emitted doesn't seem to trace the slot. It's also doing laser on/off operations, which I thought might be due to the example file using a "laser" tool which I don't have in my tool library - but after selecting a different custom tool based on a drill, the offending gcode segment remains :

Code: Select all

(Finish operation: DragknifeDressup)
(Begin operation: Slot)
(Compound: Slot)
(Finish operation: Slot)
(Begin postamble)
M5
G17 G90
M2
The problem might, perhaps, be that somehow the "slot" operation is missing from both versions of Freecad I have, so perhaps there's no handle for generating the relevant path?
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

So, I still have no "slot tool", but I've noticed that when I copy and paste the GCode from the GUI's "inspector" the MPCNC actually does almost everything it should with the test file (including cutting the slot). With the gcode passed through any of the post-processors, the cut stops after the rectangle and never completes the slot - it seems like the section is simply omitted.
The "uprocessed" gcode for the slot :

Code: Select all

(Slot)
(Tool type: endmill)
(Compensated Tool Path. Diameter: 1.0 mm)
()
G0 F0.000000 Z8.000000
G0 F0.000000 X50.000000 Y30.000000
G1 F0.000000 Z1.000000
G1 F0.000000 X10.000000 Y30.000000
G0 F0.000000 Z6.000000
G0 F0.000000 Z8.000000
G0 Z8.000000
Post-processed gcode from centroid :

Code: Select all

;begin operation
;end operation: Slot
Perhaps there's a hint in the linuxcnc post processed output :

Code: Select all

(begin operation: Slot)
(machine: not set, mm/min)
(finish operation: Slot)
When I set the machine feedrate for the tool I've chosen, I then notice in the Console that :

Code: Select all

19:54:38  Running the Python command 'Path_Post' failed:
Traceback (most recent call last):
  File "/tmp/.mount_FreeCA2PxnZw/usr/Mod/Path/PathScripts/PathPost.py", line 396, in Activated
    (fail, rc, filename) = self.exportObjectsWith(finalpostlist, job)
  File "/tmp/.mount_FreeCA2PxnZw/usr/Mod/Path/PathScripts/PathPost.py", line 211, in exportObjectsWith
    gcode = processor.export(objs, filename, postArgs)
  File "/tmp/.mount_FreeCA2PxnZw/usr/Mod/Path/PathScripts/PathPostProcessor.py", line 100, in export
    return self.script.export(obj, filename, args)
  File "/tmp/.mount_FreeCA2PxnZw/usr/Mod/Path/PathScripts/post/linuxcnc_post.py", line 197, in export
    job = PathUtils.findParentJob(obj)
  File "/tmp/.mount_FreeCA2PxnZw/usr/Mod/Path/PathScripts/PathUtils.py", line 444, in findParentJob
    if hasattr(i, 'Proxy') and isinstance(i.Proxy, PathJob.ObjectJob):

Cannot access attribute 'Proxy' of deleted object
...so is this actually perhaps caused by the fact that I don't have a "slot" ability in my Freecad?!?
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by sliptonic »

bensenior wrote: Sun Oct 17, 2021 5:56 pm So, I still have no "slot tool",
Slot is an experimental feature. Did you enable them?
bensenior
Posts: 29
Joined: Mon Dec 07, 2020 7:55 pm

Re: Creating a "fold" in Path with a Drag Knife... possible?

Post by bensenior »

Thanks. Funnily enough, I just found mention of that as you posted. I had checked the Freecad wiki but obviously at the wrong place, where it wasn't mentioned.

I've decided to start from first principles in order to get the results I'm looking for with the MPCNC. I think it'll make it simpler to diagnose issues one at a time, rather than in a confounding heap all in one go. I'll post the steps in this thread as I find the time (i.e. I'll use the same primitive but build towards the final result one step at a time) - which should hopefully address issues I'm having with the knife somehow not moving in the Z-axis as far as it should, the generation of the slot, and the end position of the tool throwing the next run off (I'm guessing it needs some additional GCode somewhere as this is probably to do with safe heights? - we'll see).
Post Reply