solved Drag Knife path optimization results in not finished lights?

P

Pitre

Gast
Hi, I wanted to thank developers for such an amazing tool, and ask for help.
I'm having issues with how the resulting cuts are made. I'm having uncut gaps in lines.
2023-08-28-17-11-21-Photo-Google-Photos-Mozilla-Firefox.png


I'm following this guide for setup - Optimized Vinyl Cutting G-Code Tool Path with DXF2GCODE

My DXF file, config and postprocessing config, aswell as the project saved from the dxf2gcode is attached here - Wormhole - Simple, private file sharing
 
To be honest i am not a specialist with drag knife. I can correct the code if i know what to do. I propose to post a comment on the page you linked and hopefully erich can help you there. Just vor curiousity is the failure in the begin of the cutting or somewhere inbetween. Can you post the picture what dxf2gcode produced in the window before cutting it ....
 
Hi @chrisko, thank you for your reply.
Erich didn't run into the issue in the article - he tried a big a and simple shape. It's easier to separate long line with small uncut portion then very short line with uncut portion. Besides, there is already a comment with the same problem under the article there without reply :)

I was going through some testing with it, and this is what I come up with.
Seems like the gaps in lines are related to where cut path starts/ends. Meaning it is not optimized for corners/peaks.
When I just load the file, without optimization this is how it looks like (zoomed in).
1693311940324.png

Then, with turned off TSP, optimized tool path looks like this:
1693312010837.png
1693312024128.png

Then with TSP optimization ON - path becomes much better on the large scale.
1693312077714.png

But if I zoom in to the portion from the first screenshot
1693312399445.png

You can see it did a much better job in optimization for cut (not intentionally) in the lower portion of the toolpath.
1693312631398.png


So in the end, if I go and manually select the shapes and hit "Set nearest Start Point", the tool path becomes optimized in the way that allows for 100% cut lines.
1693316465281.png
Full animated gif link of the process

It took me about a long while to figure out the workaround. I even played with blade offset and such :) Spent a lot of time playing with TSP parameters, until realized that it just looks for shortest. Obviously.


Do you think it is possible to prioritize the peaks (not shortest possible path through the line) when optimizing in drag knife mode, with or maybe without TSP?
On the first screeshot, when file just opened, some of the paths do start and end in a peak. Sorry I don't know what would be the proper name for this area of the path.

1693316185746.png
 
That's what is was expecting when you showed me the picture. I am not sure what kind of tpye of geometry you are using to create the picture. The thing you would require to look for the sharpest corner of you closed geometry and then set the start point to that, right?

Can you add a test file here e.g. the part of you picture above. The function you want to be changed or a similar function with other name would be here:

You could propose something if your able to write python. Otherwise i may find some time in the next few days ...
 
The thing you would require to look for the sharpest corner of you closed geometry and then set the start point to that, right?
Yes, that sounds correct.

Can you add a test file here e.g. the part of you picture above.
I've attached the zip archive with source SVG file, that I used to produce DXF file with Inkscape using 1693334484642.png
The DXF file itself, and the dxf2gcode project file with toolpath.

The function you want to be changed or a similar function with other name would be here:
My python is at the beginners level, but I'll try to read the shape.py and propose something.
 

Anhänge

  • Files.zip
    148,9 KB · Aufrufe: 0
Hi,
i just had time to prepare something for you. It's not working correctly as i have something wrong with the angles. Had no time to dig into it. But please find attached the link to the development repository where you can find it. The workflow would be select all geometries go to context menu and select new menu point there ....


I think the function i use "get_start_end_points" is providing the wrong angle, but i am not sure. Could be also with the wrap function ...
 
Hi :)
This was totally unexpected! Thank you for your time!
I've compiled shape.py and canvas.py with python3.1.1 and replaced binary files in my install folder (win11).

Run some tests, these are results.
In the original example, with TSP on, it did a great job of defined sharp corners on petals. The stems ends failed to register as sharp corners, see screenshots below.
1693412015538.png
1693412034284.png

Few more examples.
1571296983flower-design-3-freesvg.org.dxf - attached
1693412267613.png

1575549521rooster-silhouette-freesvg.org.dxf - attached
1693413288799.png

Failed to identify corner as a start/end point in one case
1537543719.dxf - attached
1693414798438.png

1553253098.dxf - attached
1693415184821.png
 

Anhänge

  • 1553253098.dxf
    222,9 KB · Aufrufe: 0
  • 1537543719.dxf
    110,8 KB · Aufrufe: 0
  • 1575549521rooster-silhouette-freesvg.org.dxf
    191,3 KB · Aufrufe: 0
  • 1571296983flower-design-3-freesvg.org.dxf
    26,5 KB · Aufrufe: 0
  • 1693412027667.png
    1693412027667.png
    192,6 KB · Aufrufe: 2
Looks like that did it :) For all the examples but the fish. It still crashed when selecting the "set sharpest startpoint". It looks like the problem was in the source file - some of the paths were duplicated on top of each other. When I moved the body away, face stayed behind :) So I deleted the related duplicate shapes and exported to DXF again. It worked like a charm this time.

Is there a scheduled release this can be included to?
1693489765462.png
1693489807263.png

1693489040506.png

1693489060787.png
1693489211694.png
 
I was just thinking, If I share the link to the app in snapmaker facebook group, very few people would be able to understand "compile with python". So I wanted to wait until it included to the main branch and released with next version...
Oh, I just noticed, there is a typo in canvas.py. Missing letter in the word SharpesT.

Line 141
Python:
Bitte, Anmelden oder Registrieren to view codes content!
 
Thanks i will correct that ...
I'll propose you test one week with that version. After you give me the Ok then, i will make a development release. Should not be that much work ...
 

Benutzer welche diesen Thread betrachten (Mitglieder: 0, Gäste: 1)

Wer hat diesen Thread gelesen

Zurück
Oben