turn line clipart into gcode for my engraver

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
testriderchuck
Newbie Member
Posts: 4
Joined: Sun Sep 16, 2018 4:14 am

turn line clipart into gcode for my engraver

Post by testriderchuck » Mon Apr 10, 2023 8:08 am

banana.pdf
(8.14 KiB) Downloaded 187 times
[img]/home/chuck/Desktop/clipart/banana.pdf

I want to turn basic line art type clipart into gcode for my engraver. So far I've just been able to "import" the pdf or png file but I see no way to convert it into lines that CAM can turn into the needed gcode. the clipart stays as an image on top of the rest of the drawing :(

testriderchuck
Newbie Member
Posts: 4
Joined: Sun Sep 16, 2018 4:14 am

Re: turn line clipart into gcode for my engraver

Post by testriderchuck » Mon Apr 10, 2023 8:09 am

I was able to do this in school, but that was with masterCam9 and I cannot afford that software.

CVH
Premier Member
Posts: 3478
Joined: Wed Sep 27, 2017 4:17 pm

Re: turn line clipart into gcode for my engraver

Post by CVH » Mon Apr 10, 2023 9:24 am

Hi,

Nothing will happen automatically when you open/import/drop a pdf with a picture or the bitmap itself that creates G-code.
You first need to trace it with geometric line-art.
Then a starting tutorial QCAD/CAM can be found here:
https://www.ribbonsoft.com/doc/qcadcam/ ... ial_en.pdf

But in this case the preview of the pdf import looks OK but nothing is imported, even not as image.
Try this file:
banana2.pdf
(11.23 KiB) Downloaded 166 times
What I did: Open the pdf with Inkscape; Removed grouping; Saved as pdf.
BTW ... If the source was an Inkscape SVG file then that would be the preferred file type.

Regards,
CVH

User avatar
andrew
Site Admin
Posts: 9063
Joined: Fri Mar 30, 2007 6:07 am

Re: turn line clipart into gcode for my engraver

Post by andrew » Mon Apr 10, 2023 7:58 pm

The PDF file contains a single bitmap (an image defined by pixels) in a format that is currently not supported by QCAD. Even if QCAD could import the image, you would be left with an image, no vector data (i.e. no lines, arcs, etc.).

You might want to consider other sources for your images, for example thenounproject.com which offers SVG downloads of similar type.

SVG files contain vector graphics, so they can easily be turned into DXF, G-Code, etc. QCAD can open and import SVG files.

Another possibility is to vectorize such a bitmap with Inkscape or QCAD. The result of such a vectorization with QCAD is attached.
Attachments
banana.dxf
(124.42 KiB) Downloaded 156 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4942
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: turn line clipart into gcode for my engraver

Post by Husky » Mon Apr 10, 2023 8:50 pm

Hi everybody - why I have the feeling that this topic will go banana ...

I believe the pdf isn't really helpful for further processing. For that reason I converted it to png, traced it in Inkscape and saved it finally as a svg. Then load or import it to QCAD and a g-code should be a piece of cake ...

Husky-2023.04.10-01.png
Husky-2023.04.10-01.png (25.55 KiB) Viewed 2523 times
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

testriderchuck
Newbie Member
Posts: 4
Joined: Sun Sep 16, 2018 4:14 am

Re: turn line clipart into gcode for my engraver

Post by testriderchuck » Fri Apr 21, 2023 9:21 pm

Looking at that dxf file, it's not as clean as the original line drawing. I've spend the last hour trying to get somewhere in inkscape...
I started with a png file, thought it'd work to convert to pdf. apparently I was wrong...

"It's a simple line drawing" she said
"How hard can it be?" she said

CVH
Premier Member
Posts: 3478
Joined: Wed Sep 27, 2017 4:17 pm

Re: turn line clipart into gcode for my engraver

Post by CVH » Sat Apr 22, 2023 6:01 am

testriderchuck wrote:
Fri Apr 21, 2023 9:21 pm
"It's a simple line drawing" she said
"How hard can it be?" she said
Well, bitmaps as these usually originated from simple line-art.
To represent lines and especially slanted or curved lines and/or the stroke width the bitmap uses shades of gray.
Have a look at it at 500%:
BananaSnip.png
BananaSnip.png (39.34 KiB) Viewed 2296 times

The bitmap looks OK for us humans ... on a screen ... in the intended scale.
But it remains a (poor) representation.
For a computer it is merely a vast amount of pixels in all kinds of gray.
The way back to line-art is less straightforward and data compression doesn't help in that case.
To be exact you need the inverse mathematical approach of how the line-art is rendered as pixels.
And that will never be readily available.

There are many tools out there that do a throw at this, some already better than others.
Inkscape is one example but the bitmap tracing result depends on the used settings.

Center-line tracing will remove any stroke width.
- In QCAD/CAM that would result in a uniform carving with the used mill diameter.
Line-art with stroke width is yet another story.
- One can not represent that very well in DXF, polylines with widths are an option but that is still a center-line for QCAD/CAM.
Edge detection will try to draw an (hard) outline.
- QCAD/CAM doesn't support pocketing out of the box, aka filling the outlines.

So it is basically a question of the source file.
testriderchuck wrote:
Fri Apr 21, 2023 9:21 pm
I started with a png file, thought it'd work to convert to pdf. apparently I was wrong...
That will only embed the PNG image in the PDF.
SVG is a better option, the name says it all: Scalable Vector Graphics.
DXF is also vector based.

An then it is a question of how you want to carve this.
For example: V-carving uses variable depths for the stroke variation.
When large enough and with a fine tool then pocketing is an option.

As last: There are several (free) tools out there that convert bitmaps like these in G-Code.
Again, some will preform better than others.

Regards,
CVH

Post Reply

Return to “QCAD 'How Do I' Questions”