Replies: 3 comments 4 replies
-
This is certainly something that is possible with the drawing addon. By implementing a custom rendering backend it would be possible to render to a custom data format instead of an image. This would be relatively simple to achieve for your own needs (see the SVG backend for example). For general use (if you would like to contribute the rendering backend upstream), a format like geojson would be appropriate for the use case you are describing I think. |
Beta Was this translation helpful? Give feedback.
-
There is no standard for converting DXF files to JSON. I implemented the simplest possible conversion scheme: DXF Content:
JSON: [
[0, "SECTION"],
[2, "HEADER"],
[9, "$ACADVER"],
[1, "AC1032"],
[9, "$ACADMAINTVER"],
[90, "105"],
[9, "$DWGCODEPAGE"],
[3, "ANSI_1252"],
[9, "$LASTSAVEDBY"],
[1, "ezdxf"],
[9, "$REQUIREDVERSIONS"],
[160, "0"],
[9, "$INSBASE"],
[10, "0.0"],
[20, "0.0"],
[30, "0.0"],
["... many tags ..."],
[0, "EOF"]
] This is a true 1:1 DXF to JSON conversion, but I doubt any application can interpret this. Once you start exporting DXF elements as objects with named attributes, you create a new data format that no one other than your application can interpret. The JSON exporter already exists. If this JSON format is helpful I can also implement an loader for this format. @mbway The |
Beta Was this translation helpful? Give feedback.
-
I added two new backends to the The
|
Beta Was this translation helpful? Give feedback.
-
Although there is already a library for rendering dxf on npm, it is not as comprehensive as the data parsed by ezdxf, so I want to use ezdxf to parse the data on the back end, return the data to the front end through network requests and then use threejs to render. As a further idea, ezdxf internally supports importing and exporting json to support editing and modifying dxf on the web side. I am very grateful to the author of exdxf, he helped me a lot in parsing dxf.
Beta Was this translation helpful? Give feedback.
All reactions