Closed pbxrt closed 2 years ago
As I remember, it was done intentionally. I had some DXF examples which were rendered incorrectly without this code. Despite it is 2D viewer, zScale cannot be completely ignored, as I remember it is used to mirror 2D entities, and is encountered quite often in DXF files. May be such mirrorring should not be applied to block insertion, I will check this fix on all my test samples.
Here is example, which is broken by this fix: Floor plan (mirrorring).dxf.zip
However now I see, that it was not correctly rendered before that as well, so need to figure out proper approach. I use Autodesk online viewer as reference. BTW LibreCAD is not able to display it properly as well.
I see, this fix will cause other problems 😂
I think this is the bug of Autodesk. Below is the proof:
In DWG file, the coordinate of the wash basin is { x: -363.54, y: 189.65 }
Howerer, in the exported DXF file, it's coordinate is { x: 363.54 ,y: 189.65 }
I was wondering, why autodesk can display the dxf file properly according to the wrong coordinate again.
Probably, it is not a bug, but a feature. The problem is, that it is not documented anywhere. And see a bit below these lines, it also has negative Z extrusion direction, probably that is a hint for proper fix. I already apply this negative extrusion to entities definitions, but not to block insertion, because I did not have an example. Now I will try to account it as well.
Seems you were right, Z-scale does not really matter, only extrusion direction does, like it was done for entities in _MirrorEntityVertices
method. I was confused by negative scale for that inserts in my sample, and did not noticed negative extrusion there. I will commit the fix shortly, which will correctly display at least those two files.
Fixed by bcb701aee11b7d74263cf796815c0cc0ad8247ac. I also updated npm package and online demo.
Roger that 👍🏻
Since dxf-viewer is 2D, zScale has no effect on the XY based screen. Below is the problem: In dwg file, the door is in the wall And in dxf-viewer, the door's x and y become -x and -y:
You can Reproduce this bug from the attached dxf.tex file. Since github don't support .dxf file, I change the file extension to txt. dxf.txt