Scale issue with .svg

I have done a test with a 100 mm wide and 50 mm height rectangle and Sculpteo made the scaling
image
with this file


Rhino open it correctly but in “printer points”.

But one strange thing is that as I selected the object the “handle” were also part of the file ! It explains the dimensions from Sculpteo that are 100.5 and 50.5. Is it done on purpose ?

My personal though is that pt must be avoided and prefered, if possible, by the unit the user use.

("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?

And some explanation of weirdness of SVG
https://mpetroff.net/2013/08/analysis-of-svg-units/

Thank you for all these informations, I am running a 6.8 revision with still the same issue. I am scaling the model each time I open it and it is ok.
Is there a way to choose the unit when I create a .svg file ? I didn’t see any …

Test.svg.zip (875 Bytes) I am also having issues with the svg export. It doesn’t seem to be scaling the dimensions correctly. Currently my workflow involves saving as an ai and then a svg from illustrator. It would be nice to eliminate the need for illustrator. Here’re my export settings.

I can’t seem to attach and svg but here’s what I get when I import the svg.


I’m on 6.18 for mac.

I want to export a Rhio Layout as svg.

I click on file>export selected>svg

But when the Export SVG dialog pops up I set up the right format, but it doesn’t export the svg correctly.
In the picture attached you see the difference between layout and svg.

On current Rhino 6 exporting to .svg is still messed up.
That print-like UI popping up is really not helpful and confusing. Resulting .svg are on wrong scale with any setting I’ve tried.
Importing the exact same .svg file Rhino6 just exported results in misplaced and mis-scaled curves.
Not reliable.

@laurent_delrieu , your plugin works great on Rhino 5!
It doesn’t work on Rhino 6. Is it expected or it’s happening only to me?

Calling the SaveAsSVG open the path+filename form correctly, but after clicking the “Save” button nothing happens, on Rhino 5 it opens your plugin UI.

Hello - Just testing V6 here with a simple file, exporting 1:1 seems to work fine; dimensions are reading correctly… I’ll try mac.

-Pascal

Hi Pascal.
I’m on windows.
Other than out of scale and misplaced, rhino svg export function also alter the shapes: circles and nurbs curves are deformed in the process.
On Laurent plugin that doesn’t happen.

Hi Riccardo - can you post a simple example (3dm file, svg export, settngs, please) of that? - please also send a version, that you like, from the plug-in.

thanks,

-Pascal

Already on the pseudo-print form you can tell something fishy is going on.

Rhino_svg.zip (31.3 KB)

On plugin page citing 1 year old Laurent comment "… I distributed the sources (to Mc Neel and others) but didn’t see some new work. … "
:no_mouth:

Edit:
and the “virtual sheet” size and resolution shouldn’t be used at all. At least the resolution.
Also, exporting the same geometries with a different camera location results in different position and/or size on the svg file. Sometime even resulting in an empty .svg file!
It behave like a “print”, but it should not. It’s an “export”.

Thanks, that is perfect.

@maje90 - for now, a higher DPI appears to help (600) - however, we are still are not getting the simplified exact circles back, as in the plug-in.

RH-59391 Export SVG - special case circles and arcs.

-Pascal

Hi Riccardo,
you are right my plugin doesn’t work on Rhino 6, I didn’t tried to compile it for Rhino 6. It must not be difficult but it seemed not necessary as Rhino 6 export SVG… Like you I continue to use Rhino 5. I gave all the sources to someone but neither saw a result. I have no problem to put them somewhere as it is not rocket science.
I don’t remember everything but units in SVG are quite a mess. There is a logic but not so simple or not always well implemented in others tools. And yes it is more an export than a print.

From a “vector” source (.3dm , rhino) to a “vector” file, .svg … using the DPI seems, to me, a really really bad and misleading/confusing idea.

But anyway, even with 600 there are big problems:
2020-07-02 20_59_53-Rhino 6 Commerciale - Top
Original is small, exported and reimported is the bigger one, missing curves and out of scale/place.


eh… sadly I and my client need to use Rhino 6.

I am a lot on Visual Studio at the moment, I will try to recompile it this weekend. Hope I don’t need to make too much changes.

1 Like

You are a godsend for this community.

1 Like

I believe circles and arcs still need to be special cased. We currently convert curves to Beziers fit within tolerance defined by the DPI.

My SVG exporter Plugin for V6 is now in Food4Rhino,
it has the same options as before. I didn’t test it a lot. Report the bugs.


In Save As menu it will appear beneath Rhino exporter
image
1 Like

Hi to all,

I’m trying to import SVG (made in other software) to Rhino. Unfortunately, the issue with scaling is still present. The scaling factor is 118.111 and I’m wondering from where (SVG units are in cm)?
Are there any improvements in RH regarding this problem?
Is there any way to overcome the problem?

Stay healthy

RH-44145 is fixed in the latest WIP

Hi Brian. Looking at the notes in RH-44145 - does that mean that svg is able to support / preserve arcs as arcs? I’d always assumed it was like Illustrator and everything became Beziers.

Yes, svg supports an arc element and Rhino 8 tries to write these elements when it encounters arc shaped curves during writing.

1 Like