Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DIMBLK #80

Open
KaivnD opened this issue Aug 1, 2023 · 2 comments
Open

Support DIMBLK #80

KaivnD opened this issue Aug 1, 2023 · 2 comments

Comments

@KaivnD
Copy link

KaivnD commented Aug 1, 2023

Hi! I have a dxf file export from netDxf, like this
image

the LinearDimension in this drawing use DIMBLK1 and DIMBLK2 for dimension arrow style, which is ArchitecturalTick , but when I open it use dxf-viewer arrow style becomes this
image

I found out only DIMTSZ is larger than 0 will draw arrow as tick, my question is, will dxf-viewer support DIMBLK for Dimension arrow rendering?

const tickSize = (this.styleResolver("DIMTSZ") ?? 0) * dimScale

here is my dxf file
DIMBLK.zip

@vagran
Copy link
Owner

vagran commented Aug 1, 2023

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.

@KaivnD
Copy link
Author

KaivnD commented Aug 1, 2023

@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

https://github.com/haplokuon/netDxf/blob/9bb9df935ec364f52ac8d2dea79b89ebfdbd20e5/netDxf/Tables/DimensionStyle.cs#L596-L618

https://github.com/haplokuon/netDxf/blob/9bb9df935ec364f52ac8d2dea79b89ebfdbd20e5/netDxf/Entities/DimensionArrowhead.cs#L675-L698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants