dxf-viewer
dxf-viewer copied to clipboard
Could not load ShapePath imported by node_modules textRenderer.js
Dear developer,
I'm struggling with bundling the project. I've installed the libraries and somehow the node_modules is having problems to import files form three js library. Would you mind helping me with this one, here is the repo. Literally no code, just setting up the rollup bundle:
https://github.com/MiguelG97/dxfViewer
All the best Miguel G
Hi,
Actually I am not familiar with rollup and never tried to use it with this library. From the first look, it seems that it cannot resolve that imports without .js extensions. Probably the extensions should be added in TextRenderer.js:
import {ShapePath} from "three/src/extras/core/ShapePath.js"
import {ShapeUtils} from "three/src/extras/ShapeUtils.js"
I will fix it in the mainline, you can now fix it locally as a workaround.
Dear vagran, The issue persist somehow
By the way, does dxf-viewer provides a measurement tool? if that's not the case, would you mind pointing to me to some topics, approaches or documentation that can help me to build a measurement tool?
Best regards, Miguel G.
The fix is in master branch, not yet released in npm (there still other problems most probably will occur). You can use it directly by specifying this in your package.json:
"dxf-viewer": "github:vagran/dxf-viewer#master"
By the way, does dxf-viewer provides a measurement tool?
No, the library is just a renderer. Any tools are a subject for implementation in applications built on top of the library. For measuring distance between two points you can use some spatial 2D index for indexing all vertices received in rendering batches, then use it to lookup nearest vertex to snap to. However, currently all information about vertex semantic is lost, so it is not possible to filter out, e.g. vertices of text glyphs or tesselated arcs.
Dear @vagran I fix up the import reference issue and in addition I included the "export default" on the node_modules\loglevel\lib\loglevel.js file since rollup was asking for it: https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module
However, now I'm facing the following issue:
any ideas on how to fix it up?
here is the repo: https://github.com/MiguelG97/dxfViewer
Best regards, Miguel G
However, now I'm facing the following issue:
any ideas on how to fix it up?
Best regards, Miguel G
It is difficult to say where the problem is without any reference to the original sources. Try to build with source maps generation enabled, so it will hopefully provide reference to a place in the original sources.
Here is the link to the original repo: https://github.com/MiguelG97/dxfViewer
Something going on at line 30850 apparently
any ideas on how to fix it up?