Topic: Create an elmnt from a SVG file; or png file

Dear QET's

Just draw this image and want to us it as an element and save it in my lib.
I really thought that I could convert this to an element; but can't find it how to this.
On the terminals of the Accu/battery I want to create a Positive and Negative terminal to get it connected to the wire diagram.


Any suggestions?

Like always thank you very much.
If there is a step to step tut, please let me know.

Post's attachments

Attachment icon Battery.svg 17.19 kb, 88 downloads since 2023-12-04 

Battery_charging.png, 13.28 kb, 533 x 250
Battery_charging.png 13.28 kb, 69 downloads since 2023-12-04 

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

Hello rvamerongen,

if you have SVG, you have possibility to convert your file to with Inkscape (a best open source software) to DXF format , after use dxf2elmt plugin for converter and transform your DXF to QET elment  *.elmt file.

Best regards,
Laurent


I return to sleeping.. I am so tired!

New .dxf to .elmt Conversion Program
https://qelectrotech.org/forum/viewforum.php?id=12

Download
https://download.qelectrotech.org/qet/b … mt/V0.3.0/

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

3 (edited by rvamerongen 2023-12-04 18:58:12)

Re: Create an elmnt from a SVG file; or png file

Already tried but did get just an outline very ugly

Post's attachments

Attachment icon Battery.dxf 37.81 kb, 96 downloads since 2023-12-04 

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

Maybe try online converter SVG to DXF...

Good night..

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

5 (edited by rvamerongen 2023-12-04 20:35:35)

Re: Create an elmnt from a SVG file; or png file

Same result.

Post's attachments

Screenshot 2023-12-04 at 19.34.22.png, 7.82 kb, 559 x 361
Screenshot 2023-12-04 at 19.34.22.png 7.82 kb, 75 downloads since 2023-12-04 

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

@rvamerongen

This is not a normal xml (plain text) svg.
I think this is a compressed svg.
That can be the problem.

I am an pre-retired industrial developer technician and born in 1960

7 (edited by rvamerongen 2023-12-04 21:18:03)

Re: Create an elmnt from a SVG file; or png file

Hi

I can read the text from the files.


Anyway. Then by hand in the element editor.

If someone can use it, please do.
Or have comments, please do.

I got two different ones with comments and value's but are to specific.

Post's attachments

Attachment icon accu.elmt 10.54 kb, 81 downloads since 2023-12-04 

Screenshot 2023-12-04 at 20.14.43.png, 7.25 kb, 238 x 221
Screenshot 2023-12-04 at 20.14.43.png 7.25 kb, 81 downloads since 2023-12-04 

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

8 (edited by plc-user 2023-12-05 00:06:50)

Re: Create an elmnt from a SVG file; or png file

Hello rvamerongen,

your SVG cannot be converted to DXF because most of it is an integrated Bitmap!

There is only one rect as outline of the Battery and the six smaller white rects is one big path.
You can even see that when you open SVG in a Text-Editor (see attachment).

If you open your SVG in Inkscape and look at the "Ebenen und Objekte"-Tab (opened with via Menu) you'll see what's inside your SVG: Most of it is a Bitmap that cannot be converted by any DXF-converter.

You can even see that when you open SVG in a Text-Editor (see attachment).

Such "simple" Symbols can be drawn very quick and easy with QET's Element-Editor:
Only rects that can be duplicated by <Ctrl>-C <Ctrl>-V

Post's attachments

Bildschirmfoto_Battery_in_Inkscape.png, 19.88 kb, 703 x 363
Bildschirmfoto_Battery_in_Inkscape.png 19.88 kb, 78 downloads since 2023-12-04 

Bildschirmfoto_Battery_in_Text-Editor.png, 23.75 kb, 945 x 119
Bildschirmfoto_Battery_in_Text-Editor.png 23.75 kb, 77 downloads since 2023-12-04 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Create an elmnt from a SVG file; or png file

@plc-user

Thank you for the information. I did download InkScape yesterday, so I don't know all the in and outs.

Curious where it did get started to go wrong.
I did draw it in Photoshop using the rectangle tools and fill's saving it as SVG.
then converted it with InkScapen ( and a web Converter ) to DXF.
Then just imported it in QET.

Will check what you wrote later today. Maybe I can draw it in InkScape and look for the difference

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

10 (edited by plc-user 2023-12-06 01:18:45)

Re: Create an elmnt from a SVG file; or png file

Hello rvamerongen,

as far as I know photoshop can only handle pixel-graphic.
QET and Inkscape work with and produce Vector-Graphics.

If you have a pixel-graphic you have to work with "potrace" or the vectorising-features of inkscape to "trace" the graphic and thus create a vector graphic. In German Version of Inkscape: import a Bitmap to current file, click the image to mark it and then "Menü" -> "Pfad" -> "Bitmap nachzeichnen..." opens a tab where some parameters for tracing can be set.

When vectorised, converted to dxf, converted to QET-Element there is still much work to do, when you want to produce a fine-looking Element that only contains the necessary and visible parts. In the accu.elmt you attached earlier there are some polygons included that "blow up" the file-size but cannot be seen in the element because they are hidden behind the black rects! When I delete the invisible polygons, the file-size is reduced to less than half to 4.3kByte. When I adjust the English name of the element the file-size even reduces to 4.1kB...

But as I said in an earlier post:
For such simple Elements like the accu it would be much faster to draw it "from scratch" or you create yourself a template where for example a rect and some translations are included you'll be even faster in future!

EDIT: Of course I mean simple Elements can be drawn only with QET-Element-Editor!

I hope I haven't scared you off with these explanations!

Best regards,
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Create an elmnt from a SVG file; or png file

@plc-user

Don't worry. I just 'almost' never used and needed InkScape, so knowledge about that is less than less.

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

Like Plc-user: for draw simple symbol like your battery, please use element editor include is so easy.
DXF2elmt is used fand needed for complex symbols like this:

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Create an elmnt from a SVG file; or png file

Thank you.
I wrote before that I did redraw it with the internal editor

"Anyway. Then by hand in the element editor."

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

@rvamerongen, and all: the magic thing about incliude element editor: that you open several element select many part of other symbol and paste this part and create a complex symbol from scratch like frankeintein, if you understand what I say.. nomicons/wink

Best regards,
Laurent

Workaround was power and I was the master, nomicons/smiley-green
My idol is Mac Giver...since my my childhood, uhuhu
...

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Create an elmnt from a SVG file; or png file

scorpio810 wrote:

@rvamerongen, and all: the magic thing about incliude element editor: that you open several element select many part of other symbol and paste this part and create a complex symbol from scratch like frankeintein, if you understand what I say.. nomicons/wink

Best regards,
Laurent

Workaround was power and I was the master, nomicons/smiley-green
My idol is Mac Giver...since my my childhood, uhuhu
...

True, I did create the cells in another document (element).
This beg the question /request that I would like to save parts outside the elements library folder.

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

Hello rvamerongen,

you noticed, that you can have a User-Collection?

I created a User-Collection where I have a Sub-Folder for elements "in development" (see attachments).
Each with a separate "qet_directory"-file with a QET-name for the Sub-Folders...
This would be the place for your "templates".

Post's attachments

Bildschirmfoto_Preferences_Collections.png, 33.96 kb, 840 x 281
Bildschirmfoto_Preferences_Collections.png 33.96 kb, 73 downloads since 2023-12-06 

Bildschirmfoto_Sub-Folder_User-Collection.png, 11.31 kb, 269 x 207
Bildschirmfoto_Sub-Folder_User-Collection.png 11.31 kb, 69 downloads since 2023-12-06 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

17 (edited by rvamerongen 2023-12-11 12:39:14)

Re: Create an elmnt from a SVG file; or png file

Thanks but I know and did this before.
have 350+ own elements in there. But like to have ‘parts’ separated somewhere outside QET from the final result.

Changed 35 to 350

QElectroTech V 0.100.0-dev - iMac macOS Monterey 12.6.3 - MacMini macOS Ventura

Re: Create an elmnt from a SVG file; or png file

Why not create a subdirectory for drafts there?

Some time ago I already suggested implementing a second user collection (https://qelectrotech.org/forum/viewtopic.php?id=2105), but the limited number of developers for QET unfortunately prevents this.
That was meant for another reason, but could be useful here, too.

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Create an elmnt from a SVG file; or png file

Hallo plc-user,

you can change directory official or custom collection on the fly,

1] change PATH for custom collection.
https://download.qelectrotech.org/qet/forum_img_2/Bildschirmfoto_Preferences_Collections.png

2] on element collection tree field make a right click -> reload, and  voila. nomicons/wink

Regards,
laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Create an elmnt from a SVG file; or png file

Salut Laurent!

See the other Thread: https://qelectrotech.org/forum/viewtopic.php?id=2647  nomicons/smile

Best regards
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Create an elmnt from a SVG file; or png file

scorpio810 wrote:

Hallo plc-user,

you can change directory official or custom collection on the fly,

1] change PATH for custom collection.
https://download.qelectrotech.org/qet/forum_img_2/Bildschirmfoto_Preferences_Collections.png

2] on element collection tree field make a right click -> reload, and  voila. nomicons/wink

Regards,
laurent






Hallo Plc-user,

I make a little video:

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Create an elmnt from a SVG file; or png file

What do you want to say with this video, Laurent?
Do you think I don't know how to use the preferences-dialog?

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Create an elmnt from a SVG file; or png file

Sorry again, Plc-user if I hurt your feelings, that was not my intention..
I adore you for your patience, and all your work, you mean a lot to me.

I'm still sorry if I offended you..

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Create an elmnt from a SVG file; or png file

Apology accepted, Laurent!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !