Author Topic: SVG loader  (Read 11412 times)

Offline maot0341

  • Ewok
  • *
  • Posts: 12
    • View Profile
SVG loader
« on: May 03, 2020, 07:58:21 am »
I do almost all my design with Inkscape / SVG. So I needed a Plugin. And here you are. It's  working pretty well for me on Linux. Rich support for path and nested transformations as well. And it's FREE.

Detailed descriptions + source code + binaries:
GitHub (deprecated):  [/https://github.com/maot0341/SVG-Import/wiki]
GitLab: [https://gitlab.com/maot0341/SVG-Import]


Binary setup: unzip attached DLL in your CamBan plugin folder and restart application.

Cheers.
« Last Edit: May 08, 2020, 10:03:15 am by maot0341 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: SVG loader
« Reply #1 on: May 04, 2020, 12:32:03 pm »
Hello

Welcome to the forum, and thanks for this plugin  :)

Tested on CamBam V1.0 - 64 Bits (Windows 7) ; works well !!

++
David

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1944
    • View Profile
    • pixelmaker
Re: SVG loader
« Reply #2 on: May 04, 2020, 13:33:08 pm »
It don't work for me in CB 64bit with SVG from Illustrator.
Plugin imports 100 "Polylines" but every Polyline is only one knot

ralf

Offline maot0341

  • Ewok
  • *
  • Posts: 12
    • View Profile
Re: SVG loader
« Reply #3 on: May 07, 2020, 11:28:34 am »
@pixelmaker:
For exact scaling we need all of this attributes in the svg-node (root): height, width, viewBox. Only viewBox was given. I added with and height and it works. Still some bugs, I see.

I needed exact scaling in my application. So it's this way.

Offline maot0341

  • Ewok
  • *
  • Posts: 12
    • View Profile
Re: SVG loader
« Reply #4 on: May 07, 2020, 18:46:24 pm »
It don't work for me in CB 64bit with SVG from Illustrator.
Plugin imports 100 "Polylines" but every Polyline is only one knot

ralf

Two Bugs (fixed):
 - SVG root node needs width=... and height=... attributes for exact scaling. (mandatory)
 - Missed implementation of [sS] path sequence (i.e. cubic bezier continuation), fixed in attached version.

Updates on GitHub upcoming.
Thx for this example. Stay tuned.
Work still in progress.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: SVG loader
« Reply #5 on: May 07, 2020, 18:58:56 pm »
How about SVG export from CamBam ? that would be ideal for some of my laser jobs.
Filmed in Supermarionation

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2617
    • View Profile
Re: SVG loader
« Reply #6 on: May 08, 2020, 14:43:44 pm »
Tried it on CB 1.0-Linux and seems to work OK.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: SVG loader
« Reply #7 on: June 12, 2021, 23:23:53 pm »
Hello

I tried gears created with this soft

http://hessmer.org/gears/InvoluteSpurGearBuilder.html?circularPitch=5&pressureAngle=25&clearance=0.05&backlash=0.05&profileShift=0.01&gear1ToothCount=0&gear1CenterHoleDiamater=5&gear2ToothCount=7&gear2CenterHoleDiamater=4&showOption=2

But it seems that the plugin fail on the line: (the index is outside the limits of the array)

<path d="M-1.9254079070592334 6.770190155071996  L-2.0179231814188405 6.58935 ...........

I attach an example file.

Can you have a look ?

Thanks

++
David

« Last Edit: June 12, 2021, 23:28:15 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: SVG loader
« Reply #8 on: June 13, 2021, 14:34:41 pm »
David,

I found the problem.
There is a debug test function that uses a loop based upon the length of an array. The array is initially based upon transforms which uses x,y,z (length of array = 3),  but later it's used to calculate only x,y, values (length of array = 2) so when the loop reaches 3 it crashes.
I'll get that fixed and post it here later.

Edit: Another problem.
Some numbers in the svg file are in scientific notation e.g. 2.4154872234042437e-16 and this is causing problems.

Edit: When saving an SVG file from Inkscape for example, use "Plain SVG", this seems to prevent scientific notation being used.
« Last Edit: June 13, 2021, 18:23:36 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: SVG loader
« Reply #9 on: June 13, 2021, 18:43:42 pm »
The only reason I have looked at this is because the original author last logged in October 2020.
If member "maot0341" returns I shall willingly delete this stuff in preference to any updates they provide.

I got the source from Github but can't be sure it's the latest one  ???

Three files attached.

David's "involute_gear_0_to_7.svg" saved as "Plain SVG" format from Inkscape.

Fixed SVG-Loader plugin, "Verbose", this leaves all the message text in place as the SVG file is being processed.
Fixed SVG-Loader plugin, "silent", all the message text is disabled to speed things up.

You can't have both installed so choose the one you prefer.
« Last Edit: June 13, 2021, 19:33:05 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: SVG loader
« Reply #10 on: June 13, 2021, 19:37:40 pm »
Hello Eddy ;)

Thanks ;)

Plugin Repair Express  ;D

Works OK with the "plain" file you provide, but there is a "broken" teeth with the file generated by the software (it has no settings to select plain mode) it's because scientific notation ?

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: SVG loader
« Reply #11 on: June 13, 2021, 19:40:58 pm »
Yes, Notepad++ for example can be used to edit the incorrect numbers.
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: SVG loader
« Reply #12 on: June 13, 2021, 21:10:34 pm »
re

Yes after some tests with other gears and editing the file with notepad, seems that all values that should be 0 (Y) are coded as X.XXXXe-15 or -16 ...

++
David
« Last Edit: June 13, 2021, 21:13:04 pm by dh42 »

Offline maot0341

  • Ewok
  • *
  • Posts: 12
    • View Profile
Re: SVG loader
« Reply #13 on: March 12, 2022, 12:31:37 pm »
Bugfix in 1.0.14. File "involute_gear_0_to_7.svg" works fine for me now.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: SVG loader
« Reply #14 on: March 12, 2022, 14:12:35 pm »
Hello

Thanks, but where is the .dll to download ?

++
David