vagran / dxf-viewer-example-src Goto Github PK
View Code? Open in Web Editor NEWSource for dxf-viewer-example GitHub pages repository
License: MIT License
Source for dxf-viewer-example GitHub pages repository
License: MIT License
if i need draw text, i must offer a xxx.ttf file?my language is zh-Hans, it's means i have to load a large size ttf file, any suggestion or best practices?
dxf-viewer-example-src/src/components/ViewerPage.vue
Lines 17 to 19 in 0b16e6f
Issue: TypeScript Errors and Breakage after Updating to Version 1.0.26
Description: I updated the dxf-viewer package in my Angular application from version 1.0.22 to the latest version (1.0.26), and I encountered TypeScript errors and breakage in functionality.
Steps to Reproduce:
Update the dxf-viewer package in an Angular application from version 1.0.22 to the latest version (1.0.26).
Build and run the application.
Observe the TypeScript errors and issues in the functionality.
Observed Issues:
Error: node_modules/dxf-viewer/src/index.d.ts:83:42 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
constructor(lines: PatternLineDef[], name: string | null = null)
Error: node_modules/dxf-viewer/src/index.d.ts:88:51 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
export function RegisterPattern(pattern: Pattern, isMetric: boolean = true): void
Error: node_modules/dxf-viewer/src/index.d.ts:91:45 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
export function LookupPattern(name: string, isMetric: boolean = true): Pattern | null
I used the code
import * as three from "three"
..
clearColor: new three.Color("#fff")
but it doesn't work at all ,the canvas I got is full of black. Does it have something to do with DxfViewerWorker?? I didn't import it.
Hello, thank you very much for your example. I am a beginner for dxf. I have this error after porting the example in exaxple to my project. Is there any solution?
Failed to compile.
./node_modules/dxf-viewer/src/DxfViewer.js 848:105
Module parse failed: Unexpected token (848:105)
File was processed with these loaders:
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
| const materialFactory = this.key.geometryType === BatchingKey.GeometryType.POINTS || this.key.geometryType === BatchingKey.GeometryType.POINT_INSTANCE ? this.viewer._GetSimplePointMaterial : this.viewer._GetSimpleColorMaterial;
> const material = materialFactory.call(this.viewer, this.viewer._TransformColor(color), instanceBatch?.GetInstanceType() ?? InstanceType.NONE);
| let objConstructor;
|
I don't know what i'm doing wrong !
I'm getting this error trying to render a dxf file.
Error: Unsupported OpenType signature <htm DxfViewerWorker.4542b64f.worker.js:7:647698
_ProcessRequest https://dev.geoofficepro.com.br/js/DxfViewerWorker.4542b64f.worker.js:7
r https://dev.geoofficepro.com.br/js/DxfViewerWorker.4542b64f.worker.js:16
l https://dev.geoofficepro.com.br/js/DxfViewerWorker.4542b64f.worker.js:16
but, before this error above i've got
GET https://dev.geoofficepro.com.br/js/fonts/Roboto-LightItalic.2eeb30eb.ttf
[HTTP/1.1 404 Not Found 9ms]
i'm missing something that i can't figure out !
any help , any thoughts will be appreciate, thanks
Hello and thanks for DXF viewer.
I have a question: how to rotate the image generated by DXF viewer?
Let's say 90 degrees (left-right)?
I have a question because the project I want to apply it to uses the old HTML and Javascript methods.
It is possible add function for drawing line or polyline?
THREE.WebGLRenderer: A WebGL context could not be created. Reason: Canvas has an existing context of a different type
The error occurs about here.
DxfViewer.js
renderer.setSize(this.canvasWidth, this.canvasHeight)
this.canvas = renderer.domElement
this.canvas.getContext("webgl", { premultipliedAlpha: false }) <--
domContainer.style.display = "block"
if (options.autoResize) {
this.canvas.style.position = "absolute"
this.resizeObserver = new ResizeObserver(entries => this._OnResize(entries[0]))
this.resizeObserver.observe(domContainer)
}
How can I select and import the blocks of a dxf file?
Hey there I don't know vue js too much and I want to make the same example for react js. Is there any GitHub repo that uses dxf-viewer or any blog?
Hi, How to use this viewer in the old school way?
I mean including some JS files with <script> tag and then passing the chosen file to the dxf-viewer functions. (no Webpack and NPM)
something like this could be so helpful:
https://github.sre.pub/kovacsv/occt-import-js#use-from-the-browser
I can't figure this out, there are so many js files!
Thanks.
Hi all, I am new to github I noticed that dxf dimensions is not rendered correctly - here is a screen shot of the outcome.
also installation in a local server is long process and also ends by a link for the sample dxf - a YouTube clip or more guidance is appreciated to ensure a quick and smooth process
The fonts used to worker loader work's nicely on dev mode, but when we make quasar build the fonts are not imported.
Getting error Unsupported OpenType signature
DxfViewerWorker.28d49fcb.worker.js:7 Error: Unsupported OpenType signature 404
at Object.Ha [as parse] (DxfViewerWorker.28d49fcb.worker.js:9:169116)
at DxfViewerWorker.28d49fcb.worker.js:7:649524
at Generator.next (<anonymous>)
at r (DxfViewerWorker.28d49fcb.worker.js:16:21839)
at o (DxfViewerWorker.28d49fcb.worker.js:16:22042)
(anonymous) @ DxfViewerWorker.28d49fcb.worker.js:7
i don't have any clue in what i'm doing wrong
PS: using quasar.conf.js
./node_modules/dxf-viewer/src/DxfViewer.js 764:60
Module parse failed: Unexpected token (764:60)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| const material = materialFactory.call(this.viewer, this.viewer._TransformColor(color),
instanceBatch?.GetInstanceType() ?? InstanceType.NONE)
|
| let objConstructor
How to add fonts
I am trying to use the viewer in an Angular app and it works as a charm. However, since I am loading rather large DXFs, I would like to use a web worker.
Here is the code that I use:
async load(url: string, fonts: any, cb?: any) {
await this._dxfViewer.Load({
url,
fonts,
progressCbk: cb?.bind(this),
workerFactory: () => new Worker(
new URL('./DxfViewerWorker.js', import.meta.url)
)
});
}
My DxfViewerWorker.js-file looks like this:
import {DxfViewer} from "dxf-viewer"
DxfViewer.SetupWorker()
When I try to load a file I get the following error: Unmatched message sequence: 1
. What causes this error? My Angular app is set up to use web workers and I also successfully make use of them elsewhere.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.