DXF Plots and dxflib

48 views
Skip to first unread message

John Timms

unread,
Jun 5, 2023, 4:12:51 AM6/5/23
to KiCad Developers
Hello,

I am new to the project and interested in contributing on Issue #2446 DXF export should export dimension items as DXF dimensions (lp:#1832717).

The 7.0.0 release does not plot KiCad dimension items at all with the option "Plot graphic items using their contours" selected. With the option de-selected, then KiCad dimension items are plotted using LINE entities, as stated in the issue.

Looking at what would be required to implement the DXF standard's DIMENSION entity, the minimum change would involve changes to DXF_PLOTTER::StartPlot() (The DIMENSION entities require a BLOCKS section to be defined.) in addition to whatever changes will be needed to the rest of the DXF plotting code. 

Because KiCad allows a number of customizations to the appearance of KiCad dimension items, the "minimal change" would likely not result in efficiently reproducing the dimension items exactly as they appear in KiCad in the DXF plot output. 

I see that QCAD's dxflib is already included in thirdparty, I assume this is used for DXF import? Rather than reinventing the wheel for plotting DIMENSION entities, what if dxflib was used for DXF plotting also?

I assume there is a good reason for the DXF plotter being the way it is now. Is there a specific design intent that prevents using dxflib to plot? In general, could I get some advice on what kind of approach to take, what kind of contribution would be most helpful?

John


Seth Hillbrand

unread,
Jun 5, 2023, 4:33:41 PM6/5/23
to dev...@kicad.org
Hi John,

The plotter code pre-dates the dxflib import code by some number of years.  That is the simple reason why the library isn't used for plotting.

If you were to revise the dxf plotting code to use dxflib, I doubt anyone would have any heartburn over this change as long as you worked within the PLOTTER class. 

As to advice on the approach, I'd start with mapping out the calls you need and ensuring that the overloads in DXF_PLOTTER will work with the calling structure expected by dxflib

Let us know if you'd like to be assigned the issue in GitLab. 

Seth


KiCad Services Corporation Logo
Seth Hillbrand
Lead Developer
+1-530-302-5483
Long Beach, CA
www.kipro-pcb.com    in...@kipro-pcb.com


--
You received this message because you are subscribed to the Google Groups "KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/f84e169d-692f-48d6-981e-f37a3fdfb39cn%40kicad.org.

John Timms

unread,
Jun 6, 2023, 3:15:32 PM6/6/23
to dev...@kicad.org
Hello Seth,

Thanks. I took a day before writing to look at what would need to be done assuming no migration to dxflib. I will take a look now and make sure I haven't underestimated the complexity of migrating.

John



You received this message because you are subscribed to a topic in the Google Groups "KiCad Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/a/kicad.org/d/topic/devlist/opU06Y4ktwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to devlist+u...@kicad.org.
To view this discussion on the web visit https://groups.google.com/a/kicad.org/d/msgid/devlist/CAFdeG-rjYcMsJ5hmt1qdAy%3Di_36yv_YQF6xotfBSJmrLYP2hBA%40mail.gmail.com.

Wayne Stambaugh

unread,
Jun 6, 2023, 3:23:30 PM6/6/23
to dev...@kicad.org

Hi John,

You may want to consider creating a DXFLIB_PLOTTER object along with the logic to use it rather than risking breaking the existing DXF_PLOTTER.  I don't know that anyone on the development team has any experience with using dxflib to write to DXF.  Once the DXFLIB_PLOTTER object is proven to be the equivalent or better than the existing DXF_PLOTTER object, we can replace it at that time.

Wayne

Reply all
Reply to author
Forward
0 new messages