Page 1 of 1

Creating closed DXF POLYLINEs?

Posted: Wed Jul 30, 2008 12:13 pm
by Pictor
Hello,
I need to produce closed polylines that are encoded/recognizable as a closed thing by POLYLINE or LWPOLYLINE elements in the DXF file.

I have tried (and found frustrating) QCad Demo 2.1.3.0. There is a "Close" Button when drawing Lines, but the whole thing comes as a bunch of single LINE elements in DXF.

Also, I'd like to modify "closed" polylines from some given DXF file into really closed polylines (in the above sense), optimally without redrawing them.

--> Would that work in QCad Professional?

---------------
Not that crucial, but still quite a nuisance: It seems layers can get messed up: I modify one polyline point, and suddenly the thing is on a different layer (the one that by chance was highlighted in the layer box).

--> Is that a bug or a feature?


Greetings,
Martin

Re: Creating closed DXF POLYLINEs?

Posted: Wed Jul 30, 2008 12:38 pm
by andrew
Pictor wrote:Hello,
I need to produce closed polylines that are encoded/recognizable as a closed thing by POLYLINE or LWPOLYLINE elements in the DXF file.

I have tried (and found frustrating) QCad Demo 2.1.3.0. There is a "Close" Button when drawing Lines, but the whole thing comes as a bunch of single LINE elements in DXF.
Please use the polyline tools to either create polylines from scratch or convert line segments into polylines. If you use the "Close" button while drawing a polyline with the polyline tool, the polyline will be saved as closed in the DXF file.
Pictor wrote: Also, I'd like to modify "closed" polylines from some given DXF file into really closed polylines (in the above sense), optimally without redrawing them.
You might have to redraw them since converting segments to a polyline will not create a closed polyline.
Pictor wrote: Not that crucial, but still quite a nuisance: It seems layers can get messed up: I modify one polyline point, and suddenly the thing is on a different layer (the one that by chance was highlighted in the layer box).

--> Is that a bug or a feature?
This might be a bug in the version you are using. Please update to QCad 2.2.1.

Re: Creating closed DXF POLYLINEs?

Posted: Wed Jul 30, 2008 2:22 pm
by Pictor
andrew wrote:Please use the polyline tools to either create polylines from scratch or convert line segments into polylines. If you use the "Close" button while drawing a polyline with the polyline tool, the polyline will be saved as closed in the DXF file.
O-oooooops :oops: First I haven't seen a "Close" button while drawing with the polyline tool -- now suddenly it's there, and it works.

But what I still couldn't find is a conversion/close/re-open tool for existing polylines.
The help browser is not very helpful for searching, but I guess I have looked long enough.

Re: Creating closed DXF POLYLINEs?

Posted: Wed Jul 30, 2008 2:48 pm
by andrew
Pictor wrote: But what I still couldn't find is a conversion/close/re-open tool for existing polylines.
This is indeed not possible at this point. The reason is that for most purposes a polyline that is closed with a closing segment behaves no different from a polyline that is stored with the "closed" attribute. Apparently in your special case it seems to matter.

Re: Creating closed DXF POLYLINEs?

Posted: Wed Jul 30, 2008 3:03 pm
by Pictor
andrew wrote:Apparently in your special case it seems to matter.
Yeah. The DXF stuff gets translated into a Tk Canvas graphics, which does the filling iff the polyline is closed. No need for these triangle fillings with DXF SOLID elements, and more performant e.g. when zooming.

BTW QCad (my old one) stumbles over this DXF (dunno version) weirdness: The SOLIDs from fillings are sometimes drawn mirrored at the y-axis (half of them right, half of them left). That's because if there's a negative z-coordinate (perhaps an infinitesimal one due to float floatings) then the x-coordinate gets mirrored.