I have exported a schematic diagram from the EAGLE printed circuit CAD program as a DXF file. I want to use QCAD-Pro to make some adjustments to that DXF and then export it as SVG for inclusion in documentation. The import into QCAD works fine. However, each line of the diagram is composed of three polylines, one for the length of the line and two arcs to make rounded ends on the line. The width of the line is controlled by the width parameter of the polyline. This renders correctly in the graphics view of QCAD, but in the SVG output the line is reduced to a simple line with width determined by the linewidth parameter and the arcs look like knobs on the ends of the line. See the attachments lc.dxf and lc.svg which are a single stroke taken from a vector-font character in the schematic scaled up by 100 for easier viewing of the SVG in Firefox. The corresponding screenshots are pro.png and svg.png.
It would be straightforward to achieve correct rendering in SVG by exporting the line segment as a rectangle with the length determined by the line length and the width determined by the polyline width using stroke-width:0 and filling with the polyline's color. Similarly the arcs would be rendered as closed, filled semi-circles. In fact, for this particular construction of lines using a linear polyline and two arc polylines, a further optimization would be to output just one filled shape composed of the two arc and the two sides of the rectangle. That's what I have done by hacking the SVG for this test image, producing lco.svg and hacked.png. But that optimization would not be necessary for correct rendering.
I wanted to try to implement this idea (and also investigate the problems I mentioned in https://qcad.org/rsforum/viewtopic.php? ... 322#p24286) so I updated my local repo from github. Then I came to realize that the community version does not support SVG export at all. In fact, the community version appears to ignore the polyline width parameter completely because it renders the graphics view in the same problematic way as the SVG output from QCAD-Pro, see community.png. Is there any way that I could work on this?
SVG export ignores polyline width
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: SVG export ignores polyline width
I cannot reproduce this problem.
Please make sure that the option "Preserve Geometry" is disabled in the export options (File > Advanced SVG Export).
With "Preserve Geometry" on, the focus is on getting the geometry / coordinates of the defining data across. With "Preserve Geometry" off, the presentation is preserved.
Please make sure that the option "Preserve Geometry" is disabled in the export options (File > Advanced SVG Export).
With "Preserve Geometry" on, the focus is on getting the geometry / coordinates of the defining data across. With "Preserve Geometry" off, the presentation is preserved.
Re: SVG export ignores polyline width
Should be mentioned there are also two unused Blocks with solids centered on the origin.
I do not know if they might interfere but they are of similar size.
I know for sure, Andrew will stricktly stick to the file format definition.
and I totally agree with him on that.
Reading the posts in the forum a lot of these issues pop up.
It is usually not the Host to blame but rather the Target application.
In half of the cases the posting ends in a void.
To represent any line width not limited by dxf there are two solutions.
A hairline contour and a fill, that's a hatch because there isn't a fill option.
A poly with Global Width and two arcs for a pen with a round tip.
As the number of hatches rizes, the performance drops.
The choise is simply made.
The Target application might not like the use of some less common used properties.
There are other candidates:
ByLayer, ByBlock, Default, 0.00
Continuous, Linetype Scale, Polyline Pattern (*set to no! in my case)
Global Width, local's, GlobalZ, local's (*zero!)
See also https://qcad.org/rsforum/viewtopic.php?f=8&t=6467
Regards
I do not know if they might interfere but they are of similar size.
I know for sure, Andrew will stricktly stick to the file format definition.
and I totally agree with him on that.
Reading the posts in the forum a lot of these issues pop up.
It is usually not the Host to blame but rather the Target application.
In half of the cases the posting ends in a void.
To represent any line width not limited by dxf there are two solutions.
A hairline contour and a fill, that's a hatch because there isn't a fill option.
A poly with Global Width and two arcs for a pen with a round tip.
As the number of hatches rizes, the performance drops.
The choise is simply made.
The Target application might not like the use of some less common used properties.
There are other candidates:
ByLayer, ByBlock, Default, 0.00
Continuous, Linetype Scale, Polyline Pattern (*set to no! in my case)
Global Width, local's, GlobalZ, local's (*zero!)
See also https://qcad.org/rsforum/viewtopic.php?f=8&t=6467
Regards
Re: SVG export ignores polyline width
Andrew - You correctly identified the problem; after clearing the "Preserve Geometry" option, the shape is rendered as expected in SVG. I may have set that option when I was trying to fix the poor rendering of a solid-fill hatch between arcs as reported in https://qcad.org/rsforum/viewtopic.php? ... 322#p24286 (but it didn't help). I'll file a separate topic for that problem with a reduced example file.
CHM - The reason for the two unused blocks is that my example file was reduced from a larger diagram incorporating those blocks. They were not the cause of the undesired rendering in SVG.
Also, you say there is not a fill option. Do you mean in SVG? There is a fill option that does solid fill, and it works well. The SVG export from QCAD does use it when "Preserve Geometry" is not set.
CHM - The reason for the two unused blocks is that my example file was reduced from a larger diagram incorporating those blocks. They were not the cause of the undesired rendering in SVG.
Also, you say there is not a fill option. Do you mean in SVG? There is a fill option that does solid fill, and it works well. The SVG export from QCAD does use it when "Preserve Geometry" is not set.
Re: SVG export ignores polyline width
Sorry, I meant CVH, not CHM. I have "CHM" on my mind because I have been at the Computer History Museum a lot recently.
Re: SVG export ignores polyline width
from svg, dxf has no fill, that's why the workarround with line widths and pen tips.
To svg, it can be either the bare entities or what they were representing.
To svg, it can be either the bare entities or what they were representing.