Giter Site home page Giter Site logo

dxf-viewer-example-src's People

Contributors

vagran avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dxf-viewer-example-src's Issues

help: about draw text

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?

import mainFont from "@/assets/fonts/Roboto-LightItalic.ttf"
import aux1Font from "@/assets/fonts/NotoSansDisplay-SemiCondensedLightItalic.ttf"
import aux2Font from "@/assets/fonts/NanumGothic-Regular.ttf"

Typescript errors in version 1.0.26

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

The background-color is not showed correctly

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.

You may need an additional loader to handle the result of these loaders.

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;
| 

Unsupported OpenType signature

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

Rotate image output

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)?

A WebGL context could not be created. in React.js + Typescript

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)
        }

Sample App for reactjs

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?

Dimensions

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

dxf_dim

Unsupported OpenType signature

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

I cant run

Hello, I am quite a novice. I follow the commands but I can't run them. What should I do? sorry for taking your time
1
2

webpack解析出错

./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

Worker: Unmatched message sequence: 1

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.