Export to SVG challenge

unhandled

#21

Interesting. I’m on SR12, and if I check for updates online, I get: “Your installation is the newest available.”


(Wim Dekeyser) #22

See:


(Laurent Delrieu) #23

Thanks for the comments
I understand that you don’t want layer which are groups in SVG
For the header I will look at it. I found some errors I didn’t read carefully specification, hope it will work. Width and height are pixels for the output so I have to adapt that.


(Laurent Delrieu) #24

I will post in few days a new version not compiled in debug mode. I will change net framework to 4.5.2. Hope it will work better.


(Laurent Delrieu) #25

I implemented line command so on the next release it will work better


(Wim Dekeyser) #26

No, layers as groups in SVG is fine.

I am talking about layouts also being saved.
In this picture you see that the only geometry in model space are the circle, the rounded rectangle, a hatched rectangle, a polyline, and a text object. When you save as SVG, you also get what is on all layouts that are in the file - in this case a bunch of P&ID symbols on my “Symbols” layout. I was hoping that it could be that only geometry in the model space is saved.


#27

Upgraded to SR13, and the plugin still fails. Complete log:

Loading Neon for Rhino, version Aug 23 2013  05:19:36
Loading Brazil 2.0 for Rhino 5.0 version Sep 20 2013 15:59:46
Loading Rhino Render, version 1.50, Sep 13 2016, 23:38:59
File "C:\Temp\Karte.3dm" successfully read
Command: _SaveAs
Error writing file C:\Temp\Karte.svg
Error saving file C:\Temp\Karte.svg

(Laurent Delrieu) #28

Here is an update,
with several corrections mainly on XML header some small errors with big effects :frowning:
Now it works on saveas menu, export selected menu and saveasSVG command.
Beware of line size, if unit is far from mm like m, km … lines appears on the windows but will be faint on SVG viewers.
@Win, For me export selected just work for selected objects.

If it works well for other people, I will post that on food4rhino.



(Laurent Delrieu) #29

Here is a ZIP I put on Food4Rhino. I think text curves are far better. The text is now in a single path so the fill is correctly done. Change the extension “zip” to “rhi” and double click on it it will install that on Rhino 5.0
There is no change in unit, except the linewidth, point size that are like in Rhino in mm.
SaveAsSVG_Rhino5_0.3.zip (180.4 KB)


texts.svg.txt (51.4 KB)


(Wim Dekeyser) #30

Hi Laurent,
It seems that Thomas is running into problems in this thread:

@Thomas_Helzle, what error do you get?

@laurent_delrieu, I just exported a rectangle and a few circles that were created in the Front view and these get exported with the rectangle in the top view and the circles in the front view (well - partly anyway):


Perhaps you could add an option to either export the Top view or the current view?


#31

I get the same error as @feklee above, “error writing file” and “error saving file”. I never see the save window shown in this thread - after I select SVG as an option in the save as or export selected dialog, nothing else happens other than those two errors showing up.

Do I need to install some specific MS runtime or something like that? I should have most of them on this system, but if it works for others, maybe that’s what’s missing?

I tried the file “SaveAsSVG_Rhino5_0.3.zip” Laurent linked to above, but it’s exactly the same as with “first release” on Food4Rhino.

Cheers and thanks,

Tom


(Laurent Delrieu) #32

The Rhp will install 2 file a Rhp I made and SVG.dll
Is the dll unblocked? The dll is used to display the SVG so it is necessary got the options windows.
Yes I can add option for front view current view …
I will be happy to test the tool with you. I can send updates this weekend.


#33

I have answered via email and will report back here if we find a solution.
Thanks Laurent and wim!

Would be great to have a good export strategy for Affinity Designer, now that it’s available for OSX and Windows.

Cheeers,

Tom


(Laurent Delrieu) #34

I put a new version which didn’t require svg.dll, it uses now winforms. Hope it will work better. For @Thomas_Helzle with 2500 curves it is quite slow, so wait a bit !


#35

Heheheh - that was one of my smaller files :wink:
Often it’s more like 126000 or more.
Adobe Illustrator took up to half an hour to open these or chocked completely…
Affinity Designer handles it quite a bit better.

Thanks a lot for your work, it’s great that it handles coloured lines now!

Cheers,

Tom


(Laurent Delrieu) #36

My exporter will not be good with so many points, it could be possible to disable the preview or not open the windows and save Without preview/options. Tell me if it could be useful,


#37

I guess I’m not exactly typical with those extreme files? :wink:

In theory, the preview could be optional and maybe it could save it’s last state, so if I know I’ll export something large, I could disable it first, saving a small selection only?
But I don’t want to cause you too much work - if it’s simple to implement, it would be helpful.

Cheers,

Tom


#38

I’m having problems with getting this plugin to work - I think the same problems as mentioned earlier in the thread by @Thomas_Helzle and @feklee . I can call the command SaveAsSVG (it appears in the autocomplete list on the command line) and the plugin is listed in Options and shows as loaded. However, no dialogue box appears other than a standard Windows one asking me to name the file and save it. If I go ahead and save, nothing is created. This is in Rhino V5, by the way. The plugin installer was “saveassvg04”.

How do I get the “Save as SVG” dialogue to appear, as shown in the above posts?

@laurent_delrieu - how do I go about unblocking the dll that you mention?


(Laurent Delrieu) #39

Hello,
I install this plugin today on my new PC and it works. The files “SaveAsSVG.rhp” goes there
C:\Program Files\Common Files\McNeel\Rhinoceros\5.0\Plug-ins\SaveAsSVG 0.4 (d53509a7-95ea-4cbe-92a6-e4a7fb400825)\0.0.0.4
Did you have this file ? Is it unblocked ?
If no UI is showing I don’t know what is the problem. I am not a real programmer so I don’t master all Windows subtilities.
SVG is now implemented in Rh6 but it seems they still didn’t implement layers, nor circle detection !
Rhino 6 SVG of 3 simples shapes

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="612pt" height="792pt" viewBox="0 0 612 792" overflow="visible" version="1.1" xmlns="http://www.w3.org/2000/svg">
  <path d="M211.259,340.358 C237.4706,341.6157 265.3212,347.4762 292.0472,358.8018 C318.7733,370.1274 344.3748,386.9182 365.8274,407.9424 C387.2799,428.9666 404.5835,454.2244 416.4458,480.7166 C428.3081,507.2088 434.729,534.9355 436.515,561.1165" stroke="#FF7F00" stroke-width="0.48" fill-opacity="0" />
  <path d="M248.2032,404.7066 C255.5873,395.1939 261.841,383.5262 265.5931,370.4999 C269.3453,357.4736 270.5958,343.0888 268.8142,329.09 C267.0325,315.0912 262.2186,301.4782 255.3232,289.8071 C248.4277,278.136 239.4508,268.4066 229.9193,261.0469 C220.4066,253.6628 208.7388,247.4091 195.7125,243.657 C182.6863,239.9048 168.3015,238.6543 154.3027,240.4359 C140.3038,242.2176 126.6909,247.0315 115.0198,253.9269 C103.3487,260.8224 93.61931,269.7993 86.25954,279.3308 C78.87546,288.8435 72.62176,300.5113 68.86963,313.5376 C65.11749,326.5638 63.86694,340.9486 65.64861,354.9474 C67.43028,368.9463 72.24418,382.5592 79.13961,394.2303 C86.03505,405.9015 95.01202,415.6308 104.5435,422.9906 C114.0562,430.3746 125.724,436.6284 138.7502,440.3805 C151.7765,444.1326 166.1613,445.3832 180.1601,443.6015 C194.1589,441.8198 207.7719,437.0059 219.443,430.1105 C231.1141,423.2151 240.8435,414.2381 248.2032,404.7066 z" stroke="#7FFF00" stroke-width="2.16" fill-opacity="0" />
  <path d="M359.2131,462.1705 L612,462.1705" stroke="#000000" stroke-width="5.76" fill-opacity="0" />
  <path d="M612,338.1007 L359.2131,338.1007 L359.2131,462.1705" stroke="#000000" stroke-width="5.76" fill-opacity="0" />
</svg>

Laurent Delrieu SVG exporter

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//Dtd SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/Dtd/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" width="53.5909mm" height="31.738921mm" viewBox="-37.4222172736867 -16.9114142183378 53.5909 31.738921" version="1.1" preserveAspectratio="xMidYMid">
  <!--SVG version of Rhinoceros 5.0 file untitled.3dm-->
  <!-- Millimeters in Rhinoceros file-->
  <!-- Millimeters in SVG file-->
  <!--Export Rhino to SVG, version 0.3, 21 of November 2016, Laurent Delrieu email:-->
  <g id="Default" stroke-width="2" stroke="rgb(0,0,0)" stroke-opacity="1" stroke-linecap="round" stroke-linejoin="round" fill="none">
    <path d="M -8.055775 6.170381L 16.168683 6.170381L 16.168683 -4.684919L -8.055775 -4.684919z" fill="none" />
    <g id="Layer 01" stroke-width="0.8" stroke="rgb(127,255,0)" stroke-opacity="1" stroke-linecap="round" stroke-linejoin="round" fill="none">
      <circle cx="-24.852923" cy="-4.34212" r="8.959528" fill="none" />
    </g>
  </g>
  <g id="Layer 02" stroke-width="0.13" stroke="rgb(255,127,0)" stroke-opacity="1" stroke-linecap="round" stroke-linejoin="round" fill="none">
    <path d="M -21.000791 -4.487424 C-18.706848,-4.378389 -16.271825,-3.862489 -13.932844,-2.874462 C-12.763354,-2.380448 -11.617873,-1.768403 -10.53119,-1.047046 C-9.444508,-0.32569 -8.416622,0.504979 -7.477066,1.425776 C-6.537509,2.346573 -5.686281,3.357498 -4.943157,4.429413 C-4.200033,5.501328 -3.565013,6.634233 -3.047517,7.793524 C-2.012523,10.112105 -1.447623,12.536229 -1.292351,14.827507 " fill="none" />
  </g>
</svg>

#40

Hi Laurent - yes , the file you mention is there and there is nothing in the file properties to say it is blocked. I unblocked the installer and it seemed to install OK. But I see no dialogue box and there is no output when I try to save as an SVG.

This is a real shame, as it would be very, very useful to me for the work with which I’m currently involved.

Is it worth me un-installing and re-installing it?

Matt