pcbnew: plot dxf draws 2 lines instead 1 with the right width

Bug #1643330 reported by Eldar Khayrullin on 2016-11-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Wishlist
Eldar Khayrullin

Bug Description

Pcbnew plot dxf draws 2 lines instead 1 with the right width.

It will be usefull to select to plot in two modes: as is (with lines width) and sketch (w/o width).

Application: kicad
Version: 201611201047+7364~55~ubuntu16.10.1-product, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.50.1 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.33 librtmp/2.3
Platform: Linux 4.8.0-27-generic x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.61.0
Curl: 7.50.1
KiCad - Compiler: GCC 6.2.0 with C++ ABI 1010
        Settings: USE_WX_GRAPHICS_CONTEXT=OFF
                  USE_WX_OVERLAY=OFF
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_SCH_IO_MANAGER=OFF
                  KICAD_USE_OCE=ON

Eldar Khayrullin (eldar) wrote :
Changed in kicad:
importance: Undecided → Wishlist
Eldar Khayrullin (eldar) on 2017-04-16
Changed in kicad:
assignee: nobody → Eldar Khayrullin (eldar)
status: New → In Progress

I just tested these patches an the do not plot the line thickness
properly. All I see is a 1px wide line for text and lines. If you fix
the line thickness issue, I would be willing to commit this. As it
stands, these changes result in less accurate DXF plots compared to the
current outline plots.

On 4/16/2017 8:21 AM, Eldar Khayrullin wrote:
> ** Patch added: "0003-Pcbnew-plots-to-DXF-arcs-with-valid-width.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4863031/+files/0003-Pcbnew-plots-to-DXF-arcs-with-valid-width.patch
>

Eldar Khayrullin (eldar) wrote :

Hi Wayne.
I have no issue.
See picture (left - pcb, right - import ploted DXF files)

Eldar Khayrullin (eldar) wrote :

PS Wayne if you use FreeCad it doesn't support dxf drawing thickness

Wayne Stambaugh (stambaughw) wrote :

@Eldar, I used DraftSight to validate the DXF files. Maybe DraftSight
doesn't support DXF drawing thickness either. Please attach the DXF
files generated from the sample you posted so I can verify if the
problem is DraftSight and not your patches.

On 4/17/2017 12:47 PM, Eldar Khayrullin wrote:
> PS Wayne if you use FreeCad it doesn't support dxf drawing thickness
>

Eldar Khayrullin (eldar) wrote :
Eldar Khayrullin (eldar) wrote :
Eldar Khayrullin (eldar) wrote :
Eldar Khayrullin (eldar) wrote :
Wayne Stambaugh (stambaughw) wrote :

I opened the all of the DXF files you posted with Draftsight 2017,
SolidWorks eDrawings 2017, IntelliCad 2001, and FreeCAD 0.16 and none
of them display the lines with thickness. What application are you
using that renders these DXF files with line thickness?

On 4/18/2017 11:14 AM, Eldar Khayrullin wrote:
> ** Attachment added: "dxf-test.kicad_pcb"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4864247/+files/dxf-test.kicad_pcb
>

Eldar Khayrullin (eldar) wrote :

@Wayne, I open this DXF files with KiCad import (that support line thickness).
I think that Autocad 2012 support it too (http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf)

Wayne Stambaugh (stambaughw) wrote :

@Eldar, this is going to be an issue for me. I use DXF export to
generate fabrication drawing where I work. I need DXF files that are
representative of the board. If I cannot get segments, arc, circles,
etc without the correct line thickness, these changes will break my
workflow. Is it possible that this has something to do with DXF file
versioning? I don't claim to be a DXF file format expert. Does anyone
have a program that shows Eldar's DXF files with the correct line
thickness besides KiCad?

On 4/18/2017 12:28 PM, Eldar Khayrullin wrote:
> @Wayne, I open this DXF files with KiCad import (that support line thickness).
> I think that Autocad 2012 support it too (http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf)
>

Eldar Khayrullin (eldar) wrote :

@Wayne, current behaviour (outline of lines) break my workflow :)
Is it important to import Fabrication layers with thickness for you?
If you mean a topological copper, it plots with current behaviour (with outlines)

Wayne Stambaugh (stambaughw) wrote :

This doesn't just effect the fabrication layers. It effects the
silkscreen layers which are part of the board representation.

On 4/18/2017 1:36 PM, Eldar Khayrullin wrote:
> @Wayne, current behaviour (outline of lines) break my workflow :)
> Is it important to import Fabrication layers with thickness for you?
> If you mean a topological copper, it plots with current behaviour (with outlines)
>

I am using acmecad (a free tool) to display dxf files.

It is seen like a reference to display dxf files by many users.
It also shows items without thickness.

It all tools used to display items with thickness show these items without thickness, there is a problem.

I also tried Librecad, with no success (lines have no thickness).
Only pcbnew (which uses the dxf library used in Librecad!) shows the thickness.

Eldar Khayrullin (eldar) wrote :

I'll try to test this dxf files in Solid Edge, Autocad, Inventor, Kompas yesterday in my work.

Wayne Stambaugh (stambaughw) wrote :

That's two more drawing tools that do not show thickness. This is why I
was wondering if it's a DXF file version issue. It may be possible that
line thickness was introduced in later DXF file versions which is
ignored by the drawing tools tested where KiCad happily uses the
thickness parameter. It could also be some other setting within the DXF
file that controls the display of line thickness that we are not setting
correctly when exporting. I find it hard to believe that we are the
only application doing this correctly given that DXF has been around a
really long time.

On 4/18/2017 2:25 PM, jean-pierre charras wrote:
> I also tried Librecad, with no success (lines have no thickness).
> Only pcbnew (which uses the dxf library used in Librecad!) shows the thickness.
>

Eldar Khayrullin (eldar) wrote :

I have tried to open these files Autocad 2011, Solid Edge ST8, Kompas 16. All no import line width.
I can to make option plot in outline or line width mode (for future usage).
For me outline mode usable for topological and unusable for plot fab layers.

Wayne Stambaugh (stambaughw) wrote :

I would say your testing constitutes a trend. There is something that
everyone else seems to know about DXF import that we do not. Otherwise,
at least some of these applications would have rendered your DXF files
with with line thickness.

I am open to the idea of making line thickness on DXF plots optional.
The existing behavior should be the default.

I would still feel better if we understood why the DXF plots with line
thickness do not render in other applications and be compatible with
their behavior. This will do nothing but confuse users.

On 4/19/2017 12:23 PM, Eldar Khayrullin wrote:
> I have tried to open these files Autocad 2011, Solid Edge ST8, Kompas 16. All no import line width.
> I can to make option plot in outline or line width mode (for future usage).
> For me outline mode usable for topological and unusable for plot fab layers.
>

Eldar Khayrullin (eldar) wrote :

Ok. I do it (plot with line width) optional.

Eldar Khayrullin (eldar) wrote :

I add rebased patch set with option ploting lines in outline mode.
@Wayne, can you watch it?

Eldar Khayrullin (eldar) wrote :

I understood probably Thickness parameter in DXF it is need for extrusion because graphic ENTITY have parameter 'Extrusion direction' and doesn't have extrusion height parameter.

Eldar Khayrullin (eldar) wrote :

And https://a360.autodesk.com/viewer/ use the Thickness parameter as extrusion height. Kicad DXF import interpretate extrusion thickness as line width. Probably DXF doesn't support lines width.

Eldar Khayrullin (eldar) wrote :

Maybe I should use Plot mode option Outline or Sketch.
@Wayne, you don't mind?
Then I rebuild my patches.

Eldar Khayrullin (eldar) wrote :

Last patch without lines width. Please ignore previous patches

Wayne Stambaugh (stambaughw) wrote :

@Eldar, if this is the proper use of the DXF line thickness parameter,
then your changes would not correctly represent a DXF file. I don't
think it's a good idea to be using the DXF thickness parameter in a
non-standard way just for own purposes. It will only confuse users who
generated DXF files using third party CAD tools for importing them into
KiCad. Exporting them will cause the same confusion because users will
assume as I did that setting the thickness parameter will be renderer as
lines with thickness in third party CAD tools. Does anyone else out
there have enough knowledge of the DXF file format to verify that I am
correct about this?

On 4/22/2017 1:55 PM, Eldar Khayrullin wrote:
> And https://a360.autodesk.com/viewer/ use the Thickness parameter as
> extrusion height. Kicad DXF import interpretate extrusion thickness as
> line width. Probably DXF doesn't support lines width.
>

Eldar Khayrullin (eldar) wrote :

@Wayne, my last patch doesn't use the DXF line thickness parameter. I add option 'Plot line in outline mode'. If it is disabled then plot lines without thickness (in sketch mode). I agree with you, we shouldn't use DXF format in a non-standard way.
I didn't patch Kicad DXF import. I think it is bug in Pcbnew to use extrusion thickness as line width.
Can you watch my last patch?

Wayne Stambaugh (stambaughw) wrote :

@Eldar, all of the links to the patches in this response seem to be broken.

On 4/23/2017 2:52 PM, Eldar Khayrullin wrote:
> @Wayne, my last patch doesn't use the DXF line thickness parameter. I add option 'Plot line in outline mode'. If it is disabled then plot lines without thickness (in sketch mode). I agree with you, we shouldn't use DXF format in a non-standard way.
> I didn't patch Kicad DXF import. I think it is bug in Pcbnew to use extrusion thickness as line width.
> Can you watch my last patch?
>
> ** Patch removed: "0001-Pcbnew-plots-segments-to-DXF-copper-mask-adhes-paste.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4866381/+files/0001-Pcbnew-plots-segments-to-DXF-copper-mask-adhes-paste.patch
>
> ** Patch removed: "0002-Pcbnew-plots-to-DXF-circles-with-valid-width.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4866382/+files/0002-Pcbnew-plots-to-DXF-circles-with-valid-width.patch
>
> ** Patch removed: "0003-Pcbnew-plots-to-DXF-arcs-with-valid-width.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4866383/+files/0003-Pcbnew-plots-to-DXF-arcs-with-valid-width.patch
>
> ** Patch removed: "0004-Make-option-to-plot-lines-in-outline-mode-optional-i.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4866384/+files/0004-Make-option-to-plot-lines-in-outline-mode-optional-i.patch
>

Eldar Khayrullin (eldar) wrote :

@Wayne, please try again

Wayne Stambaugh (stambaughw) wrote :

@Eldar, I merged your patch into the master branch. I would prefer that
the current behavior be the default setting (checked) but I can live
with it for now. The tooltip for the new checkbox is not very clear but
that can be updated later as well. In the future, please follow the
commit message policy[1] when submitting patches. Thank you for your
contribution to KiCad.

[1]: http://docs.kicad-pcb.org/doxygen/commit_messages.html

On 4/24/2017 12:11 PM, Eldar Khayrullin wrote:
> @Wayne, please try again
>
> ** Patch added: "0001-Enable-for-pcbnew-plotting-to-DXF-lines-in-outline-m.patch"
> https://bugs.launchpad.net/kicad/+bug/1643330/+attachment/4867367/+files/0001-Enable-for-pcbnew-plotting-to-DXF-lines-in-outline-m.patch
>

KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 0af5695e51733445c0f246eb688c98201601cd76
https://git.launchpad.net/kicad/patch/?id=0af5695e51733445c0f246eb688c98201601cd76

Changed in kicad:
status: In Progress → Fix Committed
Eldar Khayrullin (eldar) wrote :

Thank you, Wayne.

Eldar Khayrullin (eldar) wrote :

It will be cool if you released this fix later.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers