skymakerolof / dxf

DXF parser for node/browser
https://www.npmjs.com/package/dxf
MIT License
330 stars 122 forks source link

Use color of entity even no corresponding layer is found #139

Closed apriljunge closed 2 weeks ago

apriljunge commented 5 months ago

In .toPolyLines() the color of the entity is only parsed when a matching layer is found. If theres no layer found, the color is set to black even when the entity has an color attribute. Is this intended?

https://github.com/skymakerolof/dxf/blob/9895f4f23dbda0ce504dc7b5cc1715a3c66f5ba8/src/toPolylines.js#L14-L25

skymakerolof commented 3 months ago

It seems strange that the color attribute of the entity is only parsed when a matching layer is found, and defaults to black otherwise, even if the entity has a specified color. I'm not entirely sure about the intended behavior here, but it does raise some questions. A pull request to address this would be welcome.

skymakerolof commented 2 weeks ago

https://github.com/skymakerolof/dxf/pull/140 Released as 5.1.1