DXF export creates multiple lines of the same segment

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

DXF export creates multiple lines of the same segment

Post by PAS_Drafter »

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31917 (Git)
Build type: Release
Branch: master
Hash: 4639283b459f9ff9093e289908cc003db8745b82
Python 3.10.9, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.5
  * CurvedShapes 1.0.4
  * Curves 0.6.5
  * fasteners 0.4.53
  * sheetmetal 0.2.60

I've simplified a file down to a simple box with holes. I have it orientated on the XY axis I select the Pad and then go to File, Export, Give it a name, and Ok the preferences and it converts a file. I am using the non legacy converter for this.

SelectPad.png
SelectPad.png (47.7 KiB) Viewed 589 times

I load he file in LibreCAD to take a look. At first glance everything looks great.

LibreCAD Original.png
LibreCAD Original.png (4.11 KiB) Viewed 589 times

However I can select each segment of the polygon and then move it. This GIF shows that process

Move.gif
Move.gif (813.98 KiB) Viewed 589 times

I can repeat those steps 2 more times before I get to the original segments.


Additionally I find that after I delete all the large segments, I have missed some very small ones that are still duplicated. If they try to run this file in their Plasma table, the torch path ends up duplicating cuts and trying to cut places that already have been cut. Additionally, it treats the insides and outsides of circles differently so they are cut to wide. Needless to say it makes it useless unless I go in and manually clean up the file.

One or two files is manageable. Cleaning up 100s is not.

I can export the file using the Legacy export and I get something different. Instead of each segment being independent, the whole boundary, including the inclusion circles. act as one. If you click anywhere on the boundary, the whole boundary is selected.

legacyexport.png
legacyexport.png (4.78 KiB) Viewed 589 times


I have no idea of what is going on. I thought I followed the correct procedure to make this work, but I must be missing something.
Attachments
Side_Boom_Lift_Bracket_PAS_Breakaway2.FCStd
(20.03 KiB) Downloaded 8 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: DXF export creates multiple lines of the same segment

Post by Roy_043 »

Confirmed. The non-legacy importer does not project (or merge) the edges of the faces (see image). If you use the legacy exporter the problem does not occur. For the non-legacy exporter you would need to create a 2D projection with Draft_Shape2DView first.
Attachments
non_legacy_dxf.png
non_legacy_dxf.png (2.45 KiB) Viewed 560 times
User avatar
papyblaise
Veteran
Posts: 7865
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: DXF export creates multiple lines of the same segment

Post by papyblaise »

it is a flow known to DXF, it creates as many lines as it sees edges on a volume
one solution is to export the DXF of the sketch if it contains all the lines
some machines work from STL, that's another track
I don't know laser cuts, I don't know how to make the adjustment so that the ray is on the right side and have a blank of the right dimensions with the ray that cuts the outside outwards, and the inside of a hole inside
Workshop_Notes
Posts: 590
Joined: Wed Sep 29, 2021 8:35 am

Re: DXF export creates multiple lines of the same segment

Post by Workshop_Notes »

Is it possible to examine (post) the dxf? Is it a 2D dxf with multiple repeated entities all at z=0 or a 3D dxf? I am not sure if you can view it 'from the side' in LibreCAD.

If it is a 3D dxf, it is a poor solution becasue it involves a bit of Python, but you could use the ezdxf library from Python and delete all entities in the file that do not have a Z-coordinate of zero. That would get you a proper, flat, 2D DXF.

It is a bit of work at the beginning, but once done, the process would be the same on every DXF you want to laser.

The suggestion of exporting the sketch as a DXF is probably the most pragmatic.
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: DXF export creates multiple lines of the same segment

Post by PAS_Drafter »

Workshop_Notes wrote: Thu Mar 23, 2023 9:55 am Is it possible to examine (post) the dxf? Is it a 2D dxf with multiple repeated entities all at z=0 or a 3D dxf? I am not sure if you can view it 'from the side' in LibreCAD.
Here is the DXF export with the "extra" segments.

Working with my Plasma table operator this morning, we have found a way to be successful most of the time. I am now just exporting the sketch if it is a simple part built with one sketch. If it a more complex sketch, I have been using Draft to create a Face Binder of the side I want to export and then export that. It seems to solve the problem of having multiple edges most of the time. I have gone back to the Legacy exporter since it will work no matter what direction the sketch is orientated, as long as I open the sketch first before exporting.

This has worked most of the time, but we still ran into a few pieces where there were gaps in the boundary when it got to the plasma software. In those cases, I had to import the data into a third party software, locate the gaps, fix them, and then export them out again. After doing that, he was able to import the part successfully. NOT an ideal situation, but it at least has us going again.

Right now I have little faith in the non-legacy exporter. The limitation of only exporting from one angle is a killer for me.
Attachments
BreakawayPad5.dxf
(14.81 KiB) Downloaded 6 times
Post Reply