vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
310 stars 97 forks source link

how to deal transform of insert in insert? #4

Closed ghost closed 3 years ago

ghost commented 3 years ago

I also want show dxf draws by three, I meet a problem, for example, image my code image the structure image your image I don't know how to deal it. Orz

ghost commented 3 years ago

oh, I konw, this is because Base point of block, all of block entities need subtract it.

vagran commented 3 years ago

Hello, I am glad you deal out with it. However, this is actually not an easy topic with lot of pitfalls in real world files. Even Autodesk did not get it fully, their official online viewer does not implement properly blocks handling and I have examples which are not properly displayed there. Most important points:

So, you can learn this indeed on simple examples, but implementing correct blocks rendering which will work properly for all real-world files is not an easy task at all. I would advice to learn dxf-viewer code, especially trying to follow all logic behing blocks handling.

ghost commented 3 years ago

Thank you.

ghost commented 3 years ago

As I recall, in addition to dxF-Viewer, we can also learn related specifications in the official DXF documentation. It looks like this: image You should download .exe at first. https://knowledge.autodesk.com/zh-hans/support/autocad/learn-explore/caas/downloads/downloads/CHS/content/download-install-autocad-2021-product-help.html

vagran commented 3 years ago

Yes, I used it during dxf- viewer implementation. But it is just file format specification (which has also many tricky areas not fully clear from the specification itself, e.g. trick with the extrusion direction, its influence to 2D render). It will not tell anything about proper implementation of renderer of such files.