skymakerolof / dxf

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

include layer information for each polyline for post-processing. #141

Open msantic opened 1 month ago

msantic commented 1 month ago

The user might want to filter some polylines by layer name later in their pipeline.

skymakerolof commented 1 month ago

Thank you for contributing! Do you have an actual use case for this? Some test would also be welcome to support your change.

msantic commented 1 month ago

@skymakerolof Sure! The use case for this is when you want to extrude a 2D sketch of an aluminum profile. Modern aluminum profiles have a thermal break, which is in a separate layer and needs to be rendered as a different material. To optimize the whole pipeline—since there might be tens or hundreds of profiles and to avoid manual AutoCAD work—I want to use the original sketches. Your library does a great job of reading DXF files and extracting the polylines needed for the extrusion process. However, in order to have two or more different materials in the final 3D model, I need a way to separate polylines based on their layers.

Screenshot 2024-08-30 at 13 50 47 Screenshot 2024-08-30 at 13 52 54

I will try to write test as well.

Thank you for sharing the library

msantic commented 1 month ago

@skymakerolof hey, just letting you know I fixed test. Please let me know if there is anything else I can do for this PR