FeedBack => Bug Reports => Topic started by: GeoffreyGRoy on June 10, 2021, 08:56:34 am

Title: [V1 - 69] Interesting DXF bug
Post by: GeoffreyGRoy on June 10, 2021, 08:56:34 am
I have found an interesting bug that I would hope to get some help.  The problem arose with the import of a DXF file (I know, there can be issues).

The problem is evident when attempting to create an profile MOP around the shape.  The attached image show two Polylines, the one on the left was imported from a DXF file.  The import is "fine" and here are the Coordinates:
            X                       Y                  Z       B
       50.127622   120.647283   0.0   0.0
   50.125258   26.419638   0.0   0.0
   66.015498   26.417098   0.0   0.0
   66.018123   120.64408   0.0   -12.708828

The one on the right was created in CamBam

         X               Y                 Z             B
         157.0   120.989795   0.0        0.0
   157.0   29.0                   0.0       0.0
   177.0   29.0                   0.0       0.0
   177.0   120.989795   0.0   -0.356394
   217.0   72.0                  0.0   -0.57735
   142.0   28.69873          0.0   -0.57735
   142.0   115.30127   0.0   -0.080735

I am also attaching the CamBam file.

The significant difference between the two Polylines lies in the number of Arc segments created in CamBam.  But they both seem to be valid Closed Polylines.

The MOP profiles shown in the image are both using "Outside".  As can be seen the left one results in a wrong (inside) profile.  Also if the setting is changed to "Inside" the result is also incorrect.

I would be interested to know if anyone else can produce this error, and of more interest to know what the problems is.

Title: Re: Interesting DXF bug
Post by: pixelmaker on June 10, 2021, 09:29:09 am
if I add to the polyline on the left of DXF only one node, the toolpath runs on the correct side.
If I edit the polyline created in CamBam with ->Menue -> edit -> polyline -> Arc Fit and a value of 0.01 the nodes are reduced so that there are no more nodes in the arc. Then the toolpath jumps to the wrong side.

This tells me that it is not the DXF and the generating software but how CamBam identifies the direction of an arc.

This behavior exists only in version 1 of CamBam. In the 0.9.8 this bug does not exist.

Title: Re: Interesting DXF bug
Post by: dave benson on June 10, 2021, 10:19:46 am
HI Geoff\Ralf

The first thing I did was check using 0.98 and like Ralf says , it was ok. that's the first thing I do as well Ralf.
When you have an .dxf from an unknown source, it's always been problematic
in CB to import some files. In a lot of cases it's not CB's fault . dxf is not as
universal, an exchange format that it could be.

What I did then was load up CB ver 1 and generated the code, and it did
have problems. What I then did was run the file cleaner over the geometry and used that
in a second comparison mop and generated the code, it was ok.
A good "tell" that the polyline doctor has done something, is the start point will have changed
I've highlighted the different start points.
You can use those polylines in the working layer as they are CB ver1 mop friendly.
I have had to use it also, after a break at intersections in a CB ver1 drawing where I've had lots
of polylines and other drawing objects in a selection you can get small almost micro segments of polylines in
the drawing.
Title: Re: Interesting DXF bug
Post by: pixelmaker on June 10, 2021, 22:50:31 pm
I have tried to construct this object in Cambam where the nodes are in the same place.
This is hardly possible if you cut the objects and reunite them. It is only possible if you create an arc with a sweep of 345 and take that as the basis. Then I can trigger the bug.
When DXF is imported from other programmes, it must be checked and cleaned up.

Since the error does not occur in 0.9.8, I would still add it to the list as a bug.
As a workaround it can be stated that adding a single node to the arc solves the problem.
This requires the Polyline Add Points plugin ( to be installed and the Polyline Move Points Plugin ( as well.
Diese beiden Funktionen sollten auch nativ in CamBam eingebaut werden.

I could not fix the bug with the File Cleaner.

Title: Re: [V1 - 69] Interesting DXF bug
Post by: dh42 on June 10, 2021, 23:45:58 pm

Added to bug list ;)

Title: Re: [V1 - 69] Interesting DXF bug
Post by: GeoffreyGRoy on June 11, 2021, 00:59:27 am
Dear Dave and Ralf

Many thanks for the feedback and comments, and the the work-around by adding a new point in the Arc segment.

Dealing with third-party DXFs can be problematical at best, but it is useful to know what underlies this particular issue.

Title: Re: [V1 - 69] Interesting DXF bug
Post by: dh42 on June 11, 2021, 03:09:46 am
Hello ;)

Seems it's not only related to the arc sweep value because adding a new point do not always works (bottom shape) and the same sweep value (right shapes) can works depending of the rest of the shape.

On the 2 shapes at the right side, the only change has been to move the 2 points that are at the bottom of the groove.

Title: Re: [V1 - 69] Interesting DXF bug
Post by: dave benson on June 11, 2021, 06:39:00 am
HI Geoff\Ralf\David

I'll post my file which has been tested with the sim and works ok.
I'll post the settings in the file cleaner that I used.

There are some things to consider here other than the geometry. If it was only that simple.

What I found doing the CC was that sometimes there were issues with the polylines
and so made the FC, while testing it, I found one ployline formed from 3 segments
had produced a dodgy path, I went to the polyline and exploded it into three segments.
I clicked on the segment and found that it had a extra line (an overlap) so it was hard to see.
I removed the overlap and re-applied the mop to the polyline and everything went ok
path generation wise. I did sim it.
However I had to later go back and modify that polyline and after exploding it and clicking
on another segment this time, I found that it also had a overlapping line but had not caused
any pathing errors.
After some more testing I discovered that CB's pathing was pretty robust to dodgy lines.
So not all geometry errors cause errors in the toolpath, I believe this is to do with settings
in the methods that CB uses to path a polyline. for example remove overlaps has a tolerance
value in a UI method.
One of my lines was within some threshold value and the other outside of it.
I don't know what that value is though and didn't look into it any further.
If you have VS studio you can have a look at the pathing methods which might provide more light on the subject.
EDIT I see Davids posted a file and I'll have a look at it.
Title: Re: [V1 - 69] Interesting DXF bug
Post by: EddyCurrent on June 11, 2021, 09:53:42 am

Diese beiden Funktionen sollten auch nativ in CamBam eingebaut werden.


ja absolut !

In my opinion, Andy should include a lot of those plugins in future updates (assuming there will be any).  In addition, I can't understand how there are several instances of code that worked in 0.9.8 but now have bugs in 1.0