vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
290 stars 86 forks source link

3D entities and arbitrary extrusion direction for planar entities #92

Open wuzejinCN opened 7 months ago

wuzejinCN commented 7 months ago

1, Some arc's position is not correct. 2, Some rectangle was changed to tow triangles. The testing file is attached.

Origin

output TestEntities.zip

vagran commented 5 months ago

Thanks for the nice test sample!

From the first look, it seems there are a lot of entities, which are arbitrary oriented in 3D space. The problematic arc probably has some arbitrary extrusion direction, which now is not fully supported because of 2D-only implementation. I will think about supporting an arbitrary projection plane. It is also an old problem with 3DFACE triangulation, I cannot get proper order of the vertices - an approach, which work on one file, breaks another file. I will revisit it once again.

image

Also checked in QCAD which has similar problems: image

wuzejinCN commented 5 months ago

Indeed, due to the conversion from three dimensions to two dimensions for display, it would be better if this could be resolved. Thanks!