FS#603SVG import straight path segments
- Type
- Bug
- Status
- Closed
- Resolution
- Fixed
- Category
- QCAD (main)
- Severity
- Low
- Priority
- Low
- Reported version
- 3 RC5
- Operating system
- All
- Reported
- 2012-05-24 by hungerburg
- Closed
- 2012-05-31 by andrew
I noticed, that paths are not fully imported into QCAD. I rewrote case "m" of "SvgImporter" like below, that way also straight line segments are drawn correctly. Case "M" should be similar:
case 'm':
x = ox = coords[0];
y = oy = coords[1];
x0 = x;
y0 = y;
for (k=2; k<coords.length; k+=2) {
x += coords[k+0];
y += coords[k+1];
this.importLine(ox, oy, x, y);
ox = x;
oy = y;
}
break;
Comments (5)
Thanks. There are also some other known problems with the SVG path importer of QCAD 3 RC5.
Please try the attached file - it should fix also the problem mentioned.
Note that QCAD 3 SVG import is limited to a few elements and does not support any transformations.
I guess you wanted to attach "ImportExport/SvgImporter/SvgImporter.js" instead of "File/SvgImport/SvgImport.js"?
I understand that I can get rid of transforms on paths in inkscape by grouping and ungrouping them ;)
Of course, sorry!
Thanks for the information for getting rid of transforms. I was looking for that.
I imported three files, that I exported from QCAD and of course transforms handling is missing, because everything is mirrored horizontally. Yet, this is no problem at all for me. Otherwise, the files displayed fine, just one of them showed an artifact: One spline gets rendered as a line. Stepping thru the debugger, this happens in ShapeAlgorithms.splineToLineOrArc(). Maybe tomorrow I will look at it again. In case you are interested, file attached. The offending command is "C38,114,36,136,29,139".
Kind Regards
Peter
Thanks again.
Indeed a problem in ShapeAlgorithms:
Line 738 is:
but should be: