dxf-viewer icon indicating copy to clipboard operation
dxf-viewer copied to clipboard

Drawing function

Open kamildul opened this issue 2 years ago • 14 comments

Hi everyone! i have a question: It is possible add function for drawing line, polyline or other elements? Thanks!

kamildul avatar May 11 '23 11:05 kamildul

Hi! You can use DxfViewer.GetScene() method to obtain three.js scene object which can be used to add any additional objects to render. To match model space coordinates you should subtract scene origin from your objects coordinates. The origin can be obtained by DxfViewer.GetOrigin() method.

vagran avatar May 11 '23 11:05 vagran

Hi Vagran,

thanks for your response, where is tutorial for instalation without node, i want install only javascript+html version.

When i install via node cmd with command : npm install dxf-viewer I get the result:

obraz

I dont see example version in HTML + Javascript :-(

kamildul avatar May 11 '23 12:05 kamildul

There is currently no any bundle build. You can find usage example in typical full-featured web application here.

vagran avatar May 11 '23 13:05 vagran

Will this compilation be available?

kamildul avatar May 11 '23 14:05 kamildul

Currently it is not planned for this version. Bundle building is planned for next major release which will be rewritten in TypeScript.

vagran avatar May 11 '23 14:05 vagran

I understand, can you help me run your solution from the simplest version without node to open a dxf file? Only html and js?

kamildul avatar May 11 '23 14:05 kamildul

I doubt I can help there, since I am not really familiar with modern web application build toolchain, so I also need to spend some time for some research. You may invest your time in learning some of web building tools (like rollup, webpack, esbuild etc.) and producing a bundle. Then check the code in the example mentioned above to get basic understanding how the library is used.

vagran avatar May 11 '23 14:05 vagran

Ok, where i find documentation?

kamildul avatar May 11 '23 14:05 kamildul

The library API is documented by JsDoc comments in the source code.

vagran avatar May 11 '23 15:05 vagran

Thanks, but still i dont know how i can run this library, i need simple example only index.html where i add patch to the dxf file, and finally in browser index.html show dxf file...

kamildul avatar May 12 '23 11:05 kamildul