vagran / dxf-viewer

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

DXF generated by Autodesk Revit not displaying correctly #40

Closed jdh-invicara closed 1 year ago

jdh-invicara commented 1 year ago

When I open a 3D DXF file in the dxf-viewer I would expect to see a top-down view. This works as expected with output from Rhino.

Here's a 3D model generated from Rhino displayed in Autodesk DWG Trueview:

image

Here's the same model with camera orbited to look top-down:

image

And here's the same model when loaded into dxf-viewer-example:

image

However, when I open a DXF file generated from Autodesk Revit model's 3D view I get "extra lines drawn".

Here's a DXF output from a Revit model in Autodesk DWG Trueview (viewed top-down):

image

And here's the same model when loaded into dxf-viewer-example:

image

Here are the two DXF files - one from Rhino and one from Revit:

sampleDXFs3D.zip

vagran commented 1 year ago

Thanks! Such kind of sample files are very valuable for the project. I have figured out that the problematic file uses POLYLINE entity kind called "Polyface mesh", which proper support is not yet implemented. Will try to fix it soon.

vagran commented 1 year ago

Fixed in v1.0.23. Demo page updated.

Note that wireframe rendering of meshes is controlled by sceneOptions.wireframeMesh options which was false on the demo page. I have set it true now which probably better suits common use cases. One day will make some control in UI for that. Without wireframe it is now rendered like this:

2023-04-06_11-52

jdh-invicara commented 1 year ago

Wow - fantastic! Thanks :-)