Syres wrote: ↑Wed Jul 17, 2019 9:34 am
I'll look into it but at least my modification doesn't make things worse which was my first concern.
Humm it seems it is something related to stroke width...
Your previous version is fine if the stroke is set to almost 0mm and the box size is 100mm, the new one is oversizing the box
-
I am conducting my tests here, using SVG files created by me with Inkscape 0.92.4 (5da689c313, 2019-01-14)
I am using the default SVG importer initially.
# CASE 1
First, I am importing three 10 mm x 10 mm squares each of them with different stroke configs.
The square dimensions were set after settings the strokes. So, all of them have the same dimensions considering the stroke.
1. No stroke
2. 0.1 mm stroke
3. 1 mm stroke
In this case, I saw that the Freecad is importing the right dimensions for the square reducing the stroke thickness
1. The square #1 was Imported as 10x10 mm square (top-left corner placed at the origin 0x0)
2. The square #2 was Imported as 9.9x9.9 mm square (top-left corner placed at the origin 0.05x0.05)
3. The square #3 was Imported as 9x9 mm square (top-left corner placed at the origin 0.5x0.5)
It looks like it is respecting Inkscape dimensions, considering the shape. It also moves the object to the half of the stroke thickness down and to the right of the origin.
The objects were converted to a sketch, (using Draft > "Conver bidirectionally..." tool) then measurements were performed using the constraints.
Hi,
You probably know this, but just in case, are you all using the same bounding box model in Inkscape ?
- Edit -> Preferences -> Tools -> Bounding box model to use -> Geometric (ignores stroke width) or Visual.
As I have to go back to income generation today I wanted to leave this at a straight edge.
I've submitted a further commit with all the Github comments/suggestions in the PR and an additional two bugfixes that I found myself but based on @ChrisG's feedback I've left the rectangle code as is and explains why there's no stroke width allowance in that part of the code.
If the PR gets merged, I'll gather together a set of words for the Wiki to bring it in line but may need assistance with the submission.
Ok, I was able to import my flower-like (circular pattern) with the right dimensions by disabling the stroke (I am also using the Geometry view so I can control better what I want). Still using the default importer that comes with Freecad.
I would suggest improving at least the SVG import popup. I also would like to have the origin centered in most of my imports if possible.