vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
320 stars 98 forks source link

Wrong render result of 'Dimension pre-rendered block' #122

Open Sululu666 opened 4 days ago

Sululu666 commented 4 days ago

The problem is when open this file, some dimension part not display. zhongwangpeixun1.zip

Here is the result: 1.by other product: image

2.by dxf-viewer: image

It took a while found that when not use dimension pre-rendered block, image

those part will show: image (with wrong text as actualMeasurement of dimension not handle)

Question: Is there any lack of judgement to decide whether use 'Dimension pre-rendered block', like the content integrity of block? If it is because development is not complete, please ignore this issue.

vagran commented 3 days ago

Thanks for the report and sample file. I do not think the problem is in the pre-rendering block selection, most probably something in the block is not rendered properly for some reason (maybe not implemented). Rendering dimensions in fall-back path (without the block) is quite tricky and in most cases produces a result which is not identical to one in the CAD software (dimension rendering usually is very software-specific, that is probably the reason these blocks are introduced in DXF and used in most files). So will need to investigate why the block is not rendered correctly.

Sululu666 commented 3 days ago

Thanks for the answer. By the way, I've found that those pre-renderd blocks' color and colorIndex are both undefined and for temporary test I set the color to 'byLayer. 企业微信截图_17323338052003

then the render result is right: image

hope this give you train of thought