QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help > Check for Updates)


FS#603 - SVG import straight path segments

Attached to Project: QCAD
Opened by Peter (hungerburg) - Thursday, 24 May 2012, 11:43 GMT+1
Last edited by Andrew (andrew) - Thursday, 31 May 2012, 10:58 GMT+1
Task Type Bug Report
Category QCAD (main)
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Low
Priority Normal
Reported Version 3 RC5
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


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;
This task depends upon

Closed by  Andrew (andrew)
Thursday, 31 May 2012, 10:58 GMT+1
Reason for closing:  Fixed
Comment by Andrew (andrew) - Thursday, 24 May 2012, 12:22 GMT+1

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.

Comment by Peter (hungerburg) - Thursday, 24 May 2012, 16:38 GMT+1

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 ;)

Comment by Andrew (andrew) - Thursday, 24 May 2012, 17:32 GMT+1

Of course, sorry!

Thanks for the information for getting rid of transforms. I was looking for that.

Comment by Peter (hungerburg) - Thursday, 24 May 2012, 22:02 GMT+1

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


Comment by Andrew (andrew) - Thursday, 24 May 2012, 22:54 GMT+1

Thanks again.

Indeed a problem in ShapeAlgorithms:

Line 738 is:

if (arc.getRadius()>1000.0) {

but should be:

if (splineIsArc && arc.getRadius()>1000.0) {