gdsestimating / three-dxf

A dxf viewer for the browser using three.js
MIT License
538 stars 171 forks source link

Cannot import ThreeDxf in Blazor #80

Closed eavidal closed 2 years ago

eavidal commented 2 years ago

I'm using the following CDN link to import the library in a Blazor app. I have managed to parse the file using "dxf-parser", but cannot make the viewer work. I've tried using ThreeDxf.Viewer and Viewer, but none of them work:

cadCanvas = new ThreeDxf.Viewer(dxf, document.getElementById("dxf-canvas"), 400, 400);
cadCanvas = new Viewer(dxf, document.getElementById("dxf-canvas"), 400, 400);

Always getting the following error:

image

The scripts are correctly loaded, and DxfParser is available.

image

UPDATE:

Finally I managed to import the three-dxf Viewer, but it doesn't work in Blazor server. It returns the following error. Any hint?

image

eavidal commented 2 years ago

The issue was on the Blazor side and has been resolved here