Open KaivnD opened 1 year ago
Hi! Regarding dimensions support, in most real world files I have touched, dimensions are defined among with a pre-rendered block, which is referenced by a DIMENSION
entity. These blocks already contain proper representation of a dimension in a form of lines, polygons, texts and other primitives, generated by a CAD software, so the DXF viewer can display them exactly in the same way as seen in the corresponding CAD software. On the other hand, dimension can be described by dozens of parameters which in theory should result in the same displayed result, however it is not really well documented to properly implement it, and also each CAD software may interpret it slightly differently. dxf-viewer
has some implementation for rendering dimension based solely on the specified parameters, however, due to a lack of sufficient amount of examples and lack of proper specification of that, it is not really well tested and is still considered experimental. Current implementation is mostly based on findings documented in ezdxf
project. Currently, it does not account DIMBLK
parameter. As you properly noticed, switching between ticks and arrows is based on DIMTSZ
parameter value, which is based on AutoDesk documentation for this parameter.
As I see in your example file, DIMTSZ
parameter is not specified (so is zero by default, according to the same documentation). Also, in your file DIMBLK
parameter has empty string value, and DIMBLK1
and DIMBLK2
are not present. So there is probably some misunderstanding about ArchitecturalTick
value, which is not present in the example file you have provided. We can add some support for these parameters, having proper example and some understanding about how they should be properly handled.
@vagran thanks for explanation I'll take a look why AutoCAD present this file correctly. and here is some relevant code, to explain why I say earlier
use DIMBLK1 and DIMBLK2 for dimension arrow style, which is ArchitecturalTick
Hi! I have a dxf file export from netDxf, like this![image](https://github.com/vagran/dxf-viewer/assets/37983330/35a6a72f-fda3-48c3-a615-512e19ddcb0b)
the LinearDimension in this drawing use![image](https://github.com/vagran/dxf-viewer/assets/37983330/5a17772f-9d45-4e3c-bf00-166a90c85844)
DIMBLK1
andDIMBLK2
for dimension arrow style, which isArchitecturalTick
, but when I open it usedxf-viewer
arrow style becomes thisI found out only
DIMTSZ
is larger than 0 will draw arrow as tick, my question is, willdxf-viewer
support DIMBLK for Dimension arrow rendering? https://github.com/vagran/dxf-viewer/blob/63485967cc7fdd06d93960b76ba0508f525d96f2/src/LinearDimension.js#L101here is my dxf file DIMBLK.zip