Unfortunately I don’t understand how to turn Rhino curves into Bézier curves for SVG, something to investigate when I have some time.
You could try convert to arcs on the spline before export. The export from the plug in are unitless so for me I work in mm in Rhino and Fusion and they come in the correct size. Some programs use pixel or points and will need scaling.
Just for fun, I dug up a script that I wrote in 2001 (and later slightly modified for RH5). It was tailor-made for my own purposes and consequently doesn’t handle everything equally well.
This is my result (renamed by adding .txt behind the .svg extension to be able to upload it here): Karte-0.1.0004.svg.txt (113.4 KB)
Thanks for uploading the 2 sample files, I noticed the lines in my version where missing, after some investigation I found I was using Line instead of line. Fusion read everything OK but it didn’t work in chrome.
I’ve updated the plugin also borrowed a line from your example so it scales to fit the browser window.
There was no manual post-processing of the svg file, no. For reasons I don’t remember, my script tries to join curves together. Apparently sometimes this causes the joined curve to end up on a different layer.
here is my first program for Rhino. I did components for Grasshopper, but my last UI was with Borland C++. So I have still a lot to learn.
So here is an SVG exporter with a what you see is what you get. It is still a WIP but some advices could be interesting.
I use Rhinocommon with c#, XMLdocument to put the SVG in memory, Winform and SVG rendering library 2.2.1 for rendering SVG (https://www.nuget.org/packages/Svg/).
I installed the rhp in Rhino 5 (and tried the WIP also) by dragging and dropping it into Rhino and then ran the SaveAsSVGCommand command but nothing happens. Are there any special steps I have to take to get it to start?
When in model space, perhaps saving things in layouts is not optimal. I understand that a SaveAs is just saving everything in the file to another file but it seems counter-productive for the SVG format. I suppose the easy way out for me is to use export selected… But still…
The file header is making Chrome not render the SVG but rather print the xml. It seems like it doesn’t like the width and height properties in the <svg xmnls=“http://www.w3.org/2000/svg” width="[X]" height="[Y]" viewBox="[…]> header line. Would throwing these out cause problems elsewhere? Inkscape seems to be reading both without problems…