js-dxf
js-dxf copied to clipboard
zoom to layers extent
Maybe but i think that is most important a method or function to make "zoom to layers extent"
Originally posted by @clavijojuan in https://github.com/ognjen-petrovic/js-dxf/issues/69#issuecomment-1021588211
what behavior we expect from that feature?
Hi,
I think the feature is fit in view. When you open the dxf the entities not showing up in first time you should make a fit in view to show them.
I have an implementation of this in my lib.
To make this work You need to calculate the bounding box of all entities. So also bounding box for every entity to make this happen need some work and maths. 😢
Hola,
Creo que la función se ajusta a la vista. Cuando abre el dxf, las entidades que no aparecen la primera vez, debe hacer un ajuste a la vista para mostrarlas.
Tengo una implementación de esto en mi lib.
Para que esto funcione, debe calcular el cuadro delimitador de todas las entidades. Entonces, también el cuadro delimitador para cada entidad para que esto suceda necesita algo de trabajo y matemáticas.😢
Hi @tarikjabiri can u share this implementation? I actually have the bbox (extent of entities) because in my app I'm trying to convert geojson features to DXF file. In leaflet u can calculate bbox with function :p
Hi,
I think the feature is fit in view. When you open the dxf the entities not showing up in first time you should make a fit in view to show them.
I have an implementation of this in my lib.
To make this work You need to calculate the bounding box of all entities. So also bounding box for every entity to make this happen need some work and maths. 😢
An easy way to calculate bbox is using turf.js. Hope helps
dxf dev branch I have a class `BoundingBox' and see Sections/Entities/Entities they use this class to calculate bbox and set the center and height of the vport
Or try this lib if it could help you. 😅
I will implement this in this lib when I have time.
Hi,
I think the feature is fit in view. When you open the dxf the entities not showing up in first time you should make a fit in view to show them.
I have an implementation of this in my lib.
To make this work You need to calculate the bounding box of all entities. So also bounding box for every entity to make this happen need some work and maths. 😢
An easy way to calculate bbox is using turf.js. Hope helps
But this work with geojson features not in dxf world there is some deferences.
Hi, I think the feature is fit in view. When you open the dxf the entities not showing up in first time you should make a fit in view to show them. I have an implementation of this in my lib. To make this work You need to calculate the bounding box of all entities. So also bounding box for every entity to make this happen need some work and maths. 😢
An easy way to calculate bbox is using turf.js. Hope helps
But this work with geojson features not in dxf world there is some deferences.
ahh ok sorry :(
I will implement this in this lib when I have time.
Thanks you 👍
I have some time will try to add this feature...
I have some time will try to add this feature...
Thanks you <3
There is new branch fit-zoom. computeBoundingBox method has been added to Line and Circle. In example folder is zoom.js that sets view port height, some other values also should be set as well... In DraftSight it looks ok so far:
Does it look same in AC?
I dont see "zoom.js" on example folder
ah sorry, it is now.
Autocad :
Almost
Hi,
I suggest creating a class BoundingBox
that compute bounding box for every entity and return the global bounding box of all entities so we did not need for creating a method in every entity.
For help I have a function for computing boundingbox of ellipse it is ready so no more work on it I will added it.
I have added centerPoint property to Viewport class. Those are 12 and 22 from the documentation
Here is same circle moved a little bit:
Does the center point work in AC?
Autocad:
Can you try with higher coordinates such as (1200000, 1100000) ?
OK it works. Thanks.
I did not get this:
Can you try with higher coordinates such as (1200000, 1100000) ?
I did not get this:
Can you try with higher coordinates such as (1200000, 1100000) ?
I was referring to create the circle at coordinates away from the origin of usc like so:
const circle = new Circle(1200000, 1100000, 200)
Aha...Could you try to do that?
On Sun, 6 Feb 2022 at 15:45, clavijojuan @.***> wrote:
I did not get this:
Can you try with higher coordinates such as (1200000, 1100000) ?
I was referring to create the circle at coordinates away from the origin of usc like so:
const circle = new Circle(1200000, 1100000, 200)
— Reply to this email directly, view it on GitHub https://github.com/ognjen-petrovic/js-dxf/issues/70#issuecomment-1030846772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA256WQA53DLW6BW4LW3DV3UZ2CQZANCNFSM5MZJIE6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>
Aha...Could you try to do that?
It works