Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compute scale? The dxf is vector illustration, how to compute scale in dxf-viewer ? #94

Open
thinkyoyo opened this issue Jan 15, 2024 · 2 comments

Comments

@thinkyoyo
Copy link

The dxf is vector illustration, how to compute scale in dxf-viewer when we change the viewer size?

@vagran
Copy link
Owner

vagran commented Jan 15, 2024

This is defined by three.js OrthographicCamera which can be obtained by viewer.GetCamera(). Three.js world space is DXF model space with some offset applied, scale is not changed, so you can use something like (camera.right - camera.left) / canvasWidth to get model units per pixel.

@thinkyoyo
Copy link
Author

This is defined by three.js OrthographicCamera which can be obtained by viewer.GetCamera(). Three.js world space is DXF model space with some offset applied, scale is not changed, so you can use something like (camera.right - camera.left) / canvasWidth to get model units per pixel.

Please accept my best thanks. I will try use viewer.GetCamera() in my project. It would be great to provide this method by dxf-viewer. Thanks again for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants