Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link between entities and polylines #144

Open
stevage opened this issue Jan 15, 2025 · 0 comments
Open

Link between entities and polylines #144

stevage opened this issue Jan 15, 2025 · 0 comments

Comments

@stevage
Copy link
Contributor

stevage commented Jan 15, 2025

Hard to pick between bug and feature request so I'll explain:

I use this library in a tool that imports DXFs from a variety of sources and converts to GeoJSON to display on a map. I need information from the raw helper.parsed.entities objects (including entity handle and layer) and other information from the output of helper.toPolylines().polylines (raw coordinates).

Generally these two arrays are synchronised, so I can loop over the entities array and use its index to get the corresponding polylines object.

But I just came across a DXF file which generates two arrays that have different numbers of elements, and hence are not aligned. There didn't seem to be any way access the information I needed without modifying the library.

In my case, it was easy to modify to include a handle property in each polyline to find the right object. But it's hacky.

There are probably lots of better options:

  1. An option to include a polyline object on each parsed entity object
  2. Make sure the two arrays always are aligned
  3. Export the applyTransforms and entityToPolyline functions so one can simply generate the polyline for each entity as needed
  4. Include the handle in the polyline object as above...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant