DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

zero length lines - old topic revisted

Started by virgal, June 21, 2011, 09:17:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

virgal

Hi all
I am in need of a macro that will find and eliminate zero length lines.

I did a search on the forum and found a macro to do that (supplied by Rob) but it will not work with V18 express or Max 21.  It shuts the program down.

Is there an updated version out there?

thank you

Alan


Bob P


virgal


REF

Have you tried 2D Lines Cleanup at the bottom of the Tools Menu?
DesignCAD user since 1990

virgal

Ref

that does not work for me. I work in "mm"  and even at .001 it removes too much.

Alan

DrollTroll

Try this macro "DeleteMicroLines.d3m". It should select all lines (and only lines, no arcs, curves or other entities) with a length less than 0.000001 (1e-6).
When the message box pops up, it gives you the option to delete them or examine them in the Info Box.

While I'm at it, I'll also attach "DeleteMicroText3.d3m", which selects and optionally removes all suspiciously tiny text entities, and all empty strings.
25 years with DesignCAD

JJG

Thank's a lot, DT !!!
Very efficient for cleaning files such as "save as 2D projection" from 3D-files , which may contain a lot of such "zero-lenght" lines !

virgal

DT
The macros did not work for us. 

More background.
The files that I am generating are used for laser cutting.  The laser we are using does not have a print driver so the files need to be converted to dxf.  The laser operator uses another program to review the files before cutting.  That is where the zero length lines show up.  If the lines are not removed we get a hole where the zero length line exists.
 
DT
if you private message me I will forward you a drawing that has the problem in it.

Question: how are these zero length lines being created in DC? Is there something I can do to avoid them?

Alan

DrollTroll

25 years with DesignCAD

Dr PR

Alan,

I have see these zero-length lines in files that were generated with "File/Save As" with the save as 2D projection option selected. Lines that project directly into the drawing along the line of sight in the projection view produce single points in the projection.

Imagine you have a cube viewed in Parallel view directly perpendicular to the nearest face. When converted to lines you get the front square, the rear square and the lines at the top and bottom of the sides. It is these lines along the top and bottom of the sides that are parallel to the viewing direction, and they become points in the drawing. Depending upon how you think about it, this may be correct. A line viewed end on is a point - geometrically speaking.

Unfortunately, none of the cleanup options eliminates these points. The cleanup will remove the redundant rear square, leaving just the four lines of the front square face of the cube. But these side line points are not redundant, and don't get cleaned up.

I solve this problem by using the 2D projection as a template and trace over it on another layer. This allows me to clean up the drawing and discard a lot of useless lines, such as facets of grid surfaces. Of course it is a lot of work.

Phil
DesignCAD user since 1987

DrollTroll

#10
OK, I got the files. Let me mention one thing I vaguely recall from back in the days of DOS tech support:
Laser cutters don't like to stop and restart on the same point. Take the example of a box: If the box is drawn as a polyline (line of multiple segments), the laser cutter moves along each segment at a fairly constant speed, from start to finish. However, if the box is drawn as four segments, the laser cutter starts up at the beginning of the first segment, stops at the end, then starts up again at the same point which is the beginning fo the next segment. It then stops and restarts at the end of that segment, starts up again at the same point which is the beginning of the third segment... etc. As I recall, it was this stopping and restarting at the same point that made the "holes".

In your drawing, (and in the dxf file) you have a number of shapes rather like this. I am using different colors to indicate where lines are broken into different entities:


My guess is that you are getting "holes" at the points where the laser stops tracing one line segment, then starts again at the exact same point to start the next segment. I am attaching the DesignCAD drawing that was used to create this image -- this should allow you to verify whether this is indeed the source of the problem.

If that's the case, you should be able to eliminate the holes by using the Combine Lines command to combine two or more adjacent lines into one line.

If you're getting the same problem at the junction between a straight line and an arc, you may also have to combine the lines and arcs. This will have the unfortunate side effect of destroying the arcs and turning them into lines with many many short segments, but if it's the only solution, give it a try.
25 years with DesignCAD

Bob P

I send many of my files (via dxf) to be cut by a Trump laser.  My contact has never mentioned that he wants continuous lines, so I suspect that (at least) the Trump software is smarter now.

virgal

Dr PR
The drawings were drawn with V18 express.  No 2D projection option available.
DT
Your logic is sound, but that has not been an issue.

it is the zero length lines.   

Alan

magic

Hi all,

In ContourCAM you number the lines that you want cut, and ContourCAM will ignore any other lines (including text and arrows), unless the lines are connected to the end of a numbered line.

Therefore you don't get the start/stop holes and you don't need to worry about zero length lines.

See examples below.

You can find a 15 day trial version of ContourCAm here: http://www.magicsystems.com/usa/Demos.php
It's a kind of magic!




DrollTroll

virgal, I am not finding *any* zero length lines in either the dcd file or the dxf file that you sent. Could this be some effect of the post-processor that digests the dxf files?

Do you get similar "zero length lines" after exporting my small sample to dxf and running it through the review program?
25 years with DesignCAD