Login  Register

Re: how to check if every entity/polyline on your drawing is closed? and strange behaviour of creating polylines

Posted by tetukowski on Jan 29, 2022; 3:55pm
URL: https://forum.librecad.org/how-to-check-if-every-entity-polyline-on-your-drawing-is-closed-and-strange-behaviour-of-creating-pos-tp5721401p5721405.html

Hi, LordOfBikes (it's always you, thank you!)

I have not tried the list entities plugin yet, but I will, for sure!

I want to add something to our discussion about "closed."

First, I don't use the polyline tool.
I draw an entity using lines, circles, trim it, etc.
In the end, I use the Create Polylines from existing segments.
Of course, polyline won't be created if there's a disconnected vertex.
But this is not a problem.

I have re-checked what causes the problem, and I can repeat the problem this time.
If you're interested, try this:
1. Draw a rectangle using four straight lines. (Do not use rectangle tool)
2. use "Create Polylines from existing segments,"
3. In the command line, we will see: polyline created (a single rectangle)
4. use Properties --> select the entity --> on the window: "Closed" is checked.
5. deselect
6. Repeat step 2-->4 on the same rectangle
7. Although the rectangle is not broken, this time you will see:


I'm guessing this is a bug (?).

From the programming point of view, I don't understand what does "closed" means.
But this is the effect of "closed" or "no-closed" using Klayout software (also open-source).
I use Klayout to create a mask file for the next step.

When we open the DXF file that contains the rectangle In the Klayout:
The closed rectangle is a single polygon with four coordinates points.
The no-closed rectangle becomes a " path ", i.e. a connected line with eight coordinate points.
Both appear as a polyline in the LibreCAD.
Here is an example from the Klayout, left is the no-closed entity, right is the closed entity:


So this is the effect of "closed" or "no closed" polyline read by another software.
Before this, I always thought a polyline was always "closed."
What is a polyline that is not closed?
We can check and uncheck the "closed" checkbox using the Properties tool.

In AutoCAD, if we move a single line on a closed entity, the shape will change, but it stays as a single entity.
If we move a line from the not-closed entity, the vertex which is not connected will stay at its position.
And the polyline will be disconnected (broken).  

It is a big problem for a drawing with many entities.
The bulk-changing is crucial.
Too bad there is no solution.

Many thanks!