vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
310 stars 97 forks source link

attrib parsing and rendering #49

Closed dotoritos-kim closed 1 year ago

dotoritos-kim commented 1 year ago

aec original aec dxf-viewer

As you can see in the image above, it is now fully rendered. The previous pull request has been closed.

I used this example.

dotoritos-kim commented 1 year ago

This ATTRIB with dimension lines does not load the layers correctly. Anyone have any guesses?

vagran commented 1 year ago

Just tried to test it:

DxfWorker.js?7c56:66 TypeError: Cannot read properties of undefined (reading 'get')
    at DxfScene._DecomposeATTRIB (DxfScene.js?feb7:583:1)
    at _DecomposeATTRIB.next (<anonymous>)
    at DxfScene._ProcessDxfEntity (DxfScene.js?feb7:288:1)
    at DxfScene.Build (DxfScene.js?feb7:148:1)
    at async DxfWorker._Load (DxfWorker.js?7c56:159:1)
    at async DxfWorker._ProcessRequestMessage (DxfWorker.js?7c56:80:1)
    at async DxfWorker._ProcessRequest (DxfWorker.js?7c56:64:1)
dotoritos-kim commented 1 year ago

Just tried to test it:

DxfWorker.js?7c56:66 TypeError: Cannot read properties of undefined (reading 'get')
    at DxfScene._DecomposeATTRIB (DxfScene.js?feb7:583:1)
    at _DecomposeATTRIB.next (<anonymous>)
    at DxfScene._ProcessDxfEntity (DxfScene.js?feb7:288:1)
    at DxfScene.Build (DxfScene.js?feb7:148:1)
    at async DxfWorker._Load (DxfWorker.js?7c56:159:1)
    at async DxfWorker._ProcessRequestMessage (DxfWorker.js?7c56:80:1)
    at async DxfWorker._ProcessRequest (DxfWorker.js?7c56:64:1)

It was a problem caused by fontStyle not being defined, and it was quickly fixed.

vagran commented 1 year ago

Just tried to test it:

DxfWorker.js?7c56:66 TypeError: Cannot read properties of undefined (reading 'get')
    at DxfScene._DecomposeATTRIB (DxfScene.js?feb7:583:1)
    at _DecomposeATTRIB.next (<anonymous>)
    at DxfScene._ProcessDxfEntity (DxfScene.js?feb7:288:1)
    at DxfScene.Build (DxfScene.js?feb7:148:1)
    at async DxfWorker._Load (DxfWorker.js?7c56:159:1)
    at async DxfWorker._ProcessRequestMessage (DxfWorker.js?7c56:80:1)
    at async DxfWorker._ProcessRequest (DxfWorker.js?7c56:64:1)

It was a problem caused by fontStyle not being defined, and it was quickly fixed.

Still failing:

TypeError: Cannot read properties of undefined (reading 'widthFactor')
    at DxfScene._DecomposeATTRIB (DxfScene.js?feb7:600:1)
    at _DecomposeATTRIB.next (<anonymous>)
    at DxfScene._ProcessDxfEntity (DxfScene.js?feb7:295:1)
    at DxfScene.Build (DxfScene.js?feb7:155:1)
    at async DxfWorker._Load (DxfWorker.js?7c56:159:1)
    at async DxfWorker._ProcessRequestMessage (DxfWorker.js?7c56:80:1)
    at async DxfWorker._ProcessRequest (DxfWorker.js?7c56:64:1)

Seems you do not handle a situation, when the font style is not found. BTW shouldn't it be found in that file? May be it is worth to double check why it happens?

vagran commented 1 year ago

It still missing some critical part - preprocessing text entities in _FetchFonts() but I will add it myself.