1 (edited by antonioaja 2022-07-18 03:54:22)

Topic: New .dxf to .elmt Conversion Program

Hello,

I was quite frustrated with the current conversion tool's sluggish conversion rate as well as its tendency to crash. So, I created, in my opinion, a better conversion tool using rust. It's a simple CLI program where you give the executable a .dxf file and it spits out a .elmt. Most entities are implemented. Check it out on my github: antonioaja/dxf2elmt

The program is over 1000x faster than the current solution. Example: a .dxf file that took close to 2 minutes to convert can now be done in 50ms. Let me know of any features you want added or any issues you may have.

Thanks.

Re: New .dxf to .elmt Conversion Program

Hello antonioaja,

you are welcome. ;-)

laurent@debian:/media/backup6/download/dxf2elmt$ cargo build
error: failed to parse manifest at `/media/backup6/download/dxf2elmt/Cargo.toml`
 
Caused by:
  feature `strip` is required
 
  The package requires the Cargo feature called `strip`, but that feature is not stabilized in this version of Cargo (1.56.0).
  Consider adding `cargo-features = ["strip"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option for more information about the status of this feature.


diff --git a/Cargo.toml b/Cargo.toml
index 17ad53d..ac82116 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,3 +1,4 @@
+cargo-features = ["strip"]
[package]
name = "dxf2elmt"
version = "0.1.0"
@@ -11,4 +12,4 @@ lto = true
 
[dependencies]
dxf = "0.5.0"
-simple-xml-builder = "1.1.0"
\ No newline at end of file
+simple-xml-builder = "1.1.0"
laurent@debian:/media/backup6/downl

Fixed:

laurent@debian:/media/backup6/download/dxf2elmt$ cargo build
    Updating crates.io index
  Downloaded hashbrown v0.12.2
  Downloaded memoffset v0.6.5
  Downloaded num-traits v0.1.43
  Downloaded image v0.23.14
  Downloaded num-rational v0.3.2
  Downloaded xml-rs v0.7.0
  Downloaded xmltree v0.8.0
  Downloaded enum_primitive v0.1.1
  Downloaded deflate v0.8.6
  Downloaded bytemuck v1.10.0
  Downloaded num-bigint v0.3.3
  Downloaded crossbeam-epoch v0.9.9
  Downloaded jpeg-decoder v0.1.22
  Downloaded png v0.16.8
  Downloaded adler32 v1.2.0
  Downloaded adler v1.0.2
  Downloaded cfg-if v1.0.0
  Downloaded num-iter v0.1.43
  Downloaded color_quant v1.1.0
  Downloaded autocfg v1.1.0
  Downloaded bitflags v1.3.2
  Downloaded crossbeam-utils v0.8.10
  Downloaded crc32fast v1.3.2
  Downloaded num-integer v0.1.45
  Downloaded itertools v0.10.3
  Downloaded num-traits v0.2.15
  Downloaded uuid v0.8.2
  Downloaded num v0.3.1
  Downloaded num-complex v0.3.1
  Downloaded chrono v0.4.19
  Downloaded miniz_oxide v0.3.7
  Downloaded weezl v0.1.7
  Downloaded time v0.1.44
  Downloaded scopeguard v1.1.0
  Downloaded rayon v1.5.3
  Downloaded num_cpus v1.13.1
  Downloaded getrandom v0.2.7
  Downloaded simple-xml-builder v1.1.0
  Downloaded either v1.7.0
  Downloaded scoped_threadpool v0.1.9
  Downloaded once_cell v1.13.0
  Downloaded serde v1.0.139
  Downloaded indexmap v1.9.1
  Downloaded rayon-core v1.9.3
  Downloaded miniz_oxide v0.4.4
  Downloaded dxf v0.5.0
  Downloaded crossbeam-channel v0.5.5
  Downloaded libc v0.2.126
  Downloaded crossbeam-deque v0.8.1
  Downloaded gif v0.11.4
  Downloaded byteorder v1.4.3
  Downloaded encoding_rs v0.8.31
  Downloaded tiff v0.6.1
  Downloaded 53 crates (6.4 MB) in 0.73s (largest was `tiff` at 1.4 MB)
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.126
   Compiling crossbeam-utils v0.8.10
   Compiling once_cell v1.13.0
   Compiling rayon-core v1.9.3
   Compiling scopeguard v1.1.0
   Compiling bitflags v1.3.2
   Compiling either v1.7.0
   Compiling serde v1.0.139
   Compiling crc32fast v1.3.2
   Compiling adler32 v1.2.0
   Compiling byteorder v1.4.3
   Compiling weezl v0.1.7
   Compiling adler v1.0.2
   Compiling encoding_rs v0.8.31
   Compiling color_quant v1.1.0
   Compiling bytemuck v1.10.0
   Compiling scoped_threadpool v0.1.9
   Compiling hashbrown v0.12.2
   Compiling xml-rs v0.7.0
   Compiling miniz_oxide v0.3.7
   Compiling itertools v0.10.3
   Compiling deflate v0.8.6
   Compiling gif v0.11.4
   Compiling num-traits v0.2.15
   Compiling memoffset v0.6.5
   Compiling num-integer v0.1.45
   Compiling crossbeam-epoch v0.9.9
   Compiling num-bigint v0.3.3
   Compiling rayon v1.5.3
   Compiling miniz_oxide v0.4.4
   Compiling num-rational v0.3.2
   Compiling num-iter v0.1.43
   Compiling indexmap v1.9.1
   Compiling crossbeam-channel v0.5.5
   Compiling png v0.16.8
   Compiling xmltree v0.8.0
   Compiling crossbeam-deque v0.8.1
   Compiling dxf v0.5.0
   Compiling num_cpus v1.13.1
   Compiling time v0.1.44
   Compiling getrandom v0.2.7
   Compiling simple-xml-builder v1.1.0
   Compiling num-traits v0.1.43
   Compiling num-complex v0.3.1
   Compiling enum_primitive v0.1.1
   Compiling uuid v0.8.2
   Compiling chrono v0.4.19
   Compiling num v0.3.1
   Compiling jpeg-decoder v0.1.22
   Compiling tiff v0.6.1
   Compiling image v0.23.14
   Compiling dxf2elmt v0.1.0 (/media/backup6/download/dxf2elmt)
    Finished dev [unoptimized + debuginfo] target(s) in 30.17s

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

Re: New .dxf to .elmt Conversion Program

WoW ^^ very impressive, thanks.

Loxone\ Products\ CAD_20200514.dxf  is a big DXF ~ 23,0 Mio (24149756)

./dxf2elmt Loxone\ Products\ CAD_20200514.dxf 
Loxone Products CAD_20200514.dxf loaded...
Loxone Products CAD_20200514.elmt was created... 
Now converting Loxone Products CAD_20200514.dxf...
Conversion complete!

STATS
~~~~~~~~~~~~~~~
Circles: 2
Lines: 91303
Arcs: 521
Texts: 0
Ellipses: 65
Polylines: 0
Currently Unsupported: 2310

Time Elapsed: 18771 ms

Loxone Products CAD_20200514.elmt  ~ 21,3 Mio (22287391)

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

Re: New .dxf to .elmt Conversion Program

Linux 64 binary:
https://download.qelectrotech.org/qet/b … 4/dxf2elmt

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

Re: New .dxf to .elmt Conversion Program

scorpio810 wrote:

Hello antonioaja,

you are welcome. ;-)

laurent@debian:/media/backup6/download/dxf2elmt$ cargo build
error: failed to parse manifest at `/media/backup6/download/dxf2elmt/Cargo.toml`
 
Caused by:
  feature `strip` is required
 
  The package requires the Cargo feature called `strip`, but that feature is not stabilized in this version of Cargo (1.56.0).
  Consider adding `cargo-features = ["strip"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.

Thanks for the feedback... Your issue seems to be with a different version of cargo.... I used cargo 1.62.0. I'll update my docs to reflect this.

scorpio810 wrote:

WoW ^^ very impressive, thanks.

Loxone\ Products\ CAD_20200514.dxf  is a big DXF ~ 23,0 Mio (24149756)

Glad it worked for you! Thanks for the feedback.

Re: New .dxf to .elmt Conversion Program

I don't know rust and how to cross-compile it for Windows I'use MXE for Windows builds.
Hmm https://stackoverflow.com/questions/314 … to-windows

rustup isn't Debian packaged yet...

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

Re: New .dxf to .elmt Conversion Program

DXF de test:
https://download.qelectrotech.org/qet/s … 200514.dxf
elmt:
https://download.qelectrotech.org/qet/s … 00514.elmt

https://download.qelectrotech.org/qet/forum_img_2/dxf_rust_test.png

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

Re: New .dxf to .elmt Conversion Program

scorpio810 wrote:

I don't know rust and how to cross-compile it for Windows I'use MXE for Windows builds.
Hmm

rustup isn't Debian packaged yet...

I have executables for windows and mac on the github page. I'll add a linux binary later today.

I also noticed issued with the text font I used. I'll change this as well.

Re: New .dxf to .elmt Conversion Program

antonioaja wrote:

I have executables for windows and mac on the github page. I'll add a linux binary later today.

I also noticed issued with the text font I used. I'll change this as well.

https://github.com/antonioaja/dxf2elmt

macOS arm64 :
https://github.com/antonioaja/dxf2elmt/ … v0.1.0.zip
Windows 64 :
https://github.com/antonioaja/dxf2elmt/ … v0.1.0.zip

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

Re: New .dxf to .elmt Conversion Program

Maybe a little bug?

                             
laurent@debian:/media/backup6/download$ ./dxf2elmt_2 4_inlet.dxf 
4_inlet.dxf loaded...
4_inlet.elmt was created... 
Now converting 4_inlet.dxf...
Conversion complete!

STATS
~~~~~~~~~~~~~~~
Circles: 40
Lines: 268
Arcs: 46
Texts: 306
Ellipses: 0
Polylines: 204
Currently Unsupported: 0

Time Elapsed: 154 ms

https://download.qelectrotech.org/qet/forum_img_2/dxf_rust_test2.png

Post's attachments

Attachment icon 4_inlet.dxf 138.07 kb, 289 downloads since 2022-07-18 

Attachment icon 4_inlet.elmt 177.25 kb, 277 downloads since 2022-07-18 

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

Re: New .dxf to .elmt Conversion Program

scorpio810 wrote:

Maybe a little bug?

lol... Yes, that does seem to be a bug. Probably has to do with how I'm ordering the polygon points. Thanks for showing me.

Re: New .dxf to .elmt Conversion Program

antonioaja wrote:
scorpio810 wrote:

Maybe a little bug?

lol... Yes, that does seem to be a bug. Probably has to do with how I'm ordering the polygon points. Thanks for showing me.

This bug is now fixed. I never set 'closed="false"' on the polygon, so it defaulted to "true". The changes are in the main branch. Will upload a new version tonight.

Re: New .dxf to .elmt Conversion Program

Great, thanks a lot.

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

Re: New .dxf to .elmt Conversion Program

New Linux 64 executables binary (release build):
https://download.qelectrotech.org/qet/b … 4/dxf2elmt

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

Re: New .dxf to .elmt Conversion Program

scorpio810 wrote:

WoW ^^ very impressive, thanks.

Loxone\ Products\ CAD_20200514.dxf  is a big DXF ~ 23,0 Mio (24149756)

./dxf2elmt Loxone\ Products\ CAD_20200514.dxf 
Loxone Products CAD_20200514.dxf loaded...
Loxone Products CAD_20200514.elmt was created... 
Now converting Loxone Products CAD_20200514.dxf...
Conversion complete!

STATS
~~~~~~~~~~~~~~~
Circles: 2
Lines: 91303
Arcs: 521
Texts: 0
Ellipses: 65
Polylines: 0
Currently Unsupported: 2310

Time Elapsed: 18771 ms

Loxone Products CAD_20200514.elmt  ~ 21,3 Mio (22287391)

New version and build in release mode:


laurent@debian:/media/backup6/download$ ./dxf2elmt Loxone\ Products\ CAD_20200514.dxf
Loxone Products CAD_20200514.dxf loaded...
Loxone Products CAD_20200514.elmt was created...
Now converting Loxone Products CAD_20200514.dxf...
Conversion complete!

STATS
~~~~~~~~~~~~~~~
Circles: 2
Lines: 91303
Arcs: 521
Splines: 1456
Texts: 0
Ellipses: 65
Polylines: 0
LwPolylines: 60
Solids: 0
Currently Unsupported: 794

Time Elapsed: 1697 ms


Very nice ^^.

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

16 (edited by Joshua 2022-07-18 22:18:30)

Re: New .dxf to .elmt Conversion Program

Hello antonioaja, thanks for your work nomicons/grin
They work with binary and ascii dxf file or only ascii ? I check the dxf-rs documentation but I see nothing about this.

Développeur QElectroTech

Re: New .dxf to .elmt Conversion Program

Joshua wrote:

Hello antonioaja, thanks for your work nomicons/grin
They work with binary and ascii dxf file or only ascii ? I check the dxf-rs documentation but I see nothing about this.

The program works with both binary and ascii.

Re: New .dxf to .elmt Conversion Program

Packages of new version dxf2elmt 0.2.0 (Windows 64, macOS arm64, Linux 64):

https://github.com/antonioaja/dxf2elmt/ … tag/v0.2.0

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

Re: New .dxf to .elmt Conversion Program

Is it possible to add an argument to your program for instead of write in a .elmt file, return the xml (string) in the stdout ?
If yes, I can use your program trought qelectrotech to import a dxf directly inside the element editor ? You will make a lot of happy user nomicons/smile

Développeur QElectroTech

20 (edited by antonioaja 2022-07-20 02:20:26)

Re: New .dxf to .elmt Conversion Program

Joshua wrote:

Is it possible to add an argument to your program for instead of write in a .elmt file, return the xml (string) in the stdout ?
If yes, I can use your program trought qelectrotech to import a dxf directly inside the element editor ? You will make a lot of happy user nomicons/smile

It should be possible. I'll try to add this feature in the next few days. nomicons/smile

Re: New .dxf to .elmt Conversion Program

Joshua wrote:

Is it possible to add an argument to your program for instead of write in a .elmt file, return the xml (string) in the stdout ?
If yes, I can use your program trought qelectrotech to import a dxf directly inside the element editor ? You will make a lot of happy user nomicons/smile

Hello,

Version 0.3.0 is available on my github. You can use the argument "-v" to return the xml string instead of creating a .elmt file.

Re: New .dxf to .elmt Conversion Program

laurent@debian:/media/backup6/download/dxf2elmt-0.3.0$ cargo build --release
  Downloaded tempfile v3.3.0
  Downloaded uuid v1.1.2
  Downloaded fastrand v1.7.0
  Downloaded remove_dir_all v0.5.3
  Downloaded unicode-ident v1.0.2
  Downloaded proc-macro2 v1.0.40
  Downloaded syn v1.0.98
  Downloaded quote v1.0.20
  Downloaded trait-set v0.2.0
  Downloaded bspline v1.1.0
  Downloaded 10 crates (460.0 KB) in 1.11s
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.126
   Compiling crossbeam-utils v0.8.10
   Compiling once_cell v1.13.0
   Compiling scopeguard v1.1.0
   Compiling rayon-core v1.9.3
   Compiling either v1.7.0
   Compiling proc-macro2 v1.0.40
   Compiling serde v1.0.139
   Compiling quote v1.0.20
   Compiling crc32fast v1.3.2
   Compiling bitflags v1.3.2
   Compiling unicode-ident v1.0.2
   Compiling adler32 v1.2.0
   Compiling adler v1.0.2
   Compiling byteorder v1.4.3
   Compiling syn v1.0.98
   Compiling weezl v0.1.7
   Compiling encoding_rs v0.8.31
   Compiling color_quant v1.1.0
   Compiling hashbrown v0.12.3
   Compiling scoped_threadpool v0.1.9
   Compiling bytemuck v1.10.0
   Compiling fastrand v1.7.0
   Compiling remove_dir_all v0.5.3
   Compiling xml-rs v0.7.0
   Compiling miniz_oxide v0.3.7
   Compiling itertools v0.10.3
   Compiling deflate v0.8.6
   Compiling gif v0.11.4
   Compiling num-traits v0.2.15
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.9
   Compiling num-integer v0.1.45
   Compiling num-bigint v0.3.3
   Compiling rayon v1.5.3
   Compiling num-iter v0.1.43
   Compiling miniz_oxide v0.4.4
   Compiling num-rational v0.3.2
   Compiling indexmap v1.9.1
   Compiling png v0.16.8
   Compiling crossbeam-channel v0.5.5
   Compiling xmltree v0.8.0
   Compiling dxf v0.5.0
   Compiling num_cpus v1.13.1
   Compiling getrandom v0.2.7
   Compiling time v0.1.44
   Compiling tempfile v3.3.0
   Compiling crossbeam-deque v0.8.1
   Compiling simple-xml-builder v1.1.0
   Compiling num-traits v0.1.43
   Compiling num-complex v0.3.1
   Compiling enum_primitive v0.1.1
   Compiling chrono v0.4.19
   Compiling uuid v0.8.2
   Compiling uuid v1.1.2
   Compiling trait-set v0.2.0
   Compiling bspline v1.1.0
   Compiling jpeg-decoder v0.1.22
   Compiling num v0.3.1
   Compiling tiff v0.6.1
   Compiling image v0.23.14
   Compiling dxf2elmt v0.3.0 (/media/backup6/download/dxf2elmt-0.3.0)
    Finished release [optimized] target(s) in 26.02s

laurent@debian:/media/backup6/download$ ./dxf2elmt 4_inlet.dxf -v
<?xml version = "1.0" encoding = "UTF-8"?>
<definition height="10" width="10" hotspot_x="0" hotspot_y="0" version="0.80" link_type="simple" type="element">
        <uuid uuid="{3d62d541-fe52-4c1a-bf11-bbed1b1e5a7f}" />
        <names>
                <name lang="en">4_inlet</name>
        </names>
        <informations>Created using dxf2elmt!</informations>
        <description>
                <polygon x1="14.9254" y1="-2685.79" x2="4014.93" y2="-2685.79" x3="4014.93" y3="14.2105" x4="14.9254" y4="14.2105" x5="14.9254" y5="-2685.79" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <polygon x1="14.9254" y1="-2628.95" x2="74.6269" y2="-2628.95" x3="74.6269" y3="-2685.79" x4="14.9254" y4="-2685.79" x5="14.9254" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <polygon x1="74.6269" y1="-2628.95" x2="253.731" y2="-2628.95" x3="253.731" y3="-2685.79" x4="74.6269" y4="-2685.79" x5="74.6269" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="119.403" y="-2657.37" rotation="0" color="000000" text="1" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="253.731" y1="-2628.95" x2="432.836" y2="-2628.95" x3="432.836" y3="-2685.79" x4="253.731" y4="-2685.79" x5="253.731" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="298.507" y="-2657.37" rotation="0" color="000000" text="2" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="432.836" y1="-2628.95" x2="611.94" y2="-2628.95" x3="611.94" y3="-2685.79" x4="432.836" y4="-2685.79" x5="432.836" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="477.612" y="-2657.37" rotation="0" color="000000" text="3" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="611.94" y1="-2628.95" x2="791.045" y2="-2628.95" x3="791.045" y3="-2685.79" x4="611.94" y4="-2685.79" x5="611.94" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="656.716" y="-2657.37" rotation="0" color="000000" text="4" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="791.045" y1="-2628.95" x2="970.149" y2="-2628.95" x3="970.149" y3="-2685.79" x4="791.045" y4="-2685.79" x5="791.045" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="835.821" y="-2657.37" rotation="0" color="000000" text="5" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="970.149" y1="-2628.95" x2="1149.25" y2="-2628.95" x3="1149.25" y3="-2685.79" x4="970.149" y4="-2685.79" x5="970.149" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="1014.93" y="-2657.37" rotation="0" color="000000" text="6" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="1149.25" y1="-2628.95" x2="1328.36" y2="-2628.95" x3="1328.36" y3="-2685.79" x4="1149.25" y4="-2685.79" x5="1149.25" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="1194.03" y="-2657.37" rotation="0" color="000000" text="7" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="1328.36" y1="-2628.95" x2="1507.46" y2="-2628.95" x3="1507.46" y3="-2685.79" x4="1328.36" y4="-2685.79" x5="1328.36" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
                <text x="1373.13" y="-2657.37" rotation="0" color="000000" text="8" font="Arial Narrow,40,-1,5,0,0,0,0,0,0,normal" />
                <polygon x1="1507.46" y1="-2628.95" x2="1686.57" y2="-2628.95" x3="1686.57" y3="-2685.79" x4="1507.46" y4="-2685.79" x5="1507.46" y5="-2628.95" closed="false" antialias="false" style="line-style:normal;line-weight:thin;filling:none;color:black" />
 
 
couic ...
 
 
<text x="235.821" y="-749.747" rotation="0" color="000000" text="Įvadas" font="Arial Narrow,26,-1,5,0,0,0,0,0,0,normal" />
                <text x="235.821" y="-708.821" rotation="0" color="000000" text="95 CU, 120 AL" font="Arial Narrow,26,-1,5,0,0,0,0,0,0,normal" />
                <text x="235.821" y="-667.895" rotation="0" color="000000" text="3PEN AC 50Hz ±20V " font="Arial Narrow,26,-1,5,0,0,0,0,0,0,normal" />
                <text x="235.821" y="-626.968" rotation="0" color="000000" text="250A MAX" font="Arial Narrow,26,-1,5,0,0,0,0,0,0,normal" />
                <text x="235.821" y="-586.042" rotation="0" color="000000" text="Instaliuota: 116kW(~200A)" font="Arial Narrow,26,-1,5,0,0,0,0,0,0,normal" />
                <text x="1957.01" y="-1031.12" rotation="90" color="000000" text="TODO!" font="Arial Narrow,23,-1,5,0,0,0,0,0,0,normal" />
                <text x="1634.03" y="-1232.62" rotation="90" color="000000" text="411" font="Arial Narrow,20,-1,5,0,0,0,0,0,0,normal" />
                <text x="2561.19" y="-1465.39" rotation="0" color="000000" text="For sensors" font="Arial Narrow,23,-1,5,0,0,0,0,0,0,normal" />
                <text x="2561.19" y="-1429.01" rotation="0" color="000000" text="and PLC" font="Arial Narrow,23,-1,5,0,0,0,0,0,0,normal" />
        </description>
</definition>

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

Re: New .dxf to .elmt Conversion Program

laurent@debian:/media/backup6/download$ ./dxf2elmt_6 4_inlet.dxf -v > test.elmt

Post's attachments

Attachment icon test.elmt 157.07 kb, 235 downloads since 2022-07-21 

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

Re: New .dxf to .elmt Conversion Program

FYI, you can't use these converted element/elmt directly in your diagram, you need to open it on elment editor; litlle modify it and save it i to calculate reel hotspot with width and height and refresh these values.
After just refresh your collections by right click and you see thumbnail picture in collection widget, now element is ready to usein your diagram.

cat test.elmt

<definition hotspot_x="341" width="4360" type="element" hotspot_y="3233" version="0.90" height="3250" link_type="simple">
    <uuid uuid="{80cc4611-394e-46da-99cc-dfd0b351b507}"/>
    <names>
        <name lang="en">4_inlet</name>
    </names>
    <elementInformations/>
    <informations>Created using dxf2elmt!</informations>
    <description>

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

Re: New .dxf to .elmt Conversion Program

laurent@debian:/media/backup6/download/dxf2elmt-0.3.0$ cargo clean
laurent@debian:/media/backup6/download/dxf2elmt-0.3.0$ cargo build --release -j48
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.126
   Compiling crossbeam-utils v0.8.10
   Compiling once_cell v1.13.0
   Compiling rayon-core v1.9.3
   Compiling scopeguard v1.1.0
   Compiling proc-macro2 v1.0.40
   Compiling serde v1.0.139
   Compiling either v1.7.0
   Compiling crc32fast v1.3.2
   Compiling unicode-ident v1.0.2
   Compiling quote v1.0.20
   Compiling bitflags v1.3.2
   Compiling adler32 v1.2.0
   Compiling byteorder v1.4.3
   Compiling syn v1.0.98
   Compiling adler v1.0.2
   Compiling weezl v0.1.7
   Compiling color_quant v1.1.0
   Compiling encoding_rs v0.8.31
   Compiling scoped_threadpool v0.1.9
   Compiling hashbrown v0.12.3
   Compiling bytemuck v1.10.0
   Compiling fastrand v1.7.0
   Compiling remove_dir_all v0.5.3
   Compiling xml-rs v0.7.0
   Compiling miniz_oxide v0.3.7
   Compiling itertools v0.10.3
   Compiling num-traits v0.2.15
   Compiling memoffset v0.6.5
   Compiling num-integer v0.1.45
   Compiling crossbeam-epoch v0.9.9
   Compiling num-bigint v0.3.3
   Compiling rayon v1.5.3
   Compiling miniz_oxide v0.4.4
   Compiling num-iter v0.1.43
   Compiling num-rational v0.3.2
   Compiling indexmap v1.9.1
   Compiling deflate v0.8.6
   Compiling gif v0.11.4
   Compiling crossbeam-channel v0.5.5
   Compiling png v0.16.8
   Compiling xmltree v0.8.0
   Compiling dxf v0.5.0
   Compiling num_cpus v1.13.1
   Compiling getrandom v0.2.7
   Compiling time v0.1.44
   Compiling tempfile v3.3.0
   Compiling crossbeam-deque v0.8.1
   Compiling simple-xml-builder v1.1.0
   Compiling num-traits v0.1.43
   Compiling num-complex v0.3.1
   Compiling enum_primitive v0.1.1
   Compiling trait-set v0.2.0
   Compiling uuid v0.8.2
   Compiling chrono v0.4.19
   Compiling uuid v1.1.2
   Compiling bspline v1.1.0
   Compiling num v0.3.1
   Compiling jpeg-decoder v0.1.22
   Compiling tiff v0.6.1
   Compiling image v0.23.14
   Compiling dxf2elmt v0.3.0 (/media/backup6/download/dxf2elmt-0.3.0)
    Finished release [optimized] target(s) in 24.71s

Edit : https://doc.rust-lang.org/cargo/command … build.html

-j N
--jobs N
Number of parallel jobs to run. May also be specified with the build.jobs config value. Defaults to the number of CPUs.

Ok, no need to use this option nomicons/smiley-green

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