Shapefile importer
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 3
- Joined: Sun Oct 17, 2021 6:26 pm
Re: Shapefile importer
Hello,
I think the problem stems from the implementation of the 3D view in the Gui directory. The problem is also experienced in the Blender, Revit, AutoCAD and LibreCAD. Moving "geometry" too far away from the defined internal software coordinate origin point distorts the 3D view (viewport) of the mentioned softwares.
What if it is as simple as switching a data type which increases the distance for non distorted "geometry" in the 3D view? AutoCAD has a larger distance than FreeCAD before it also becomes distorted.
Techdraw projects the "geometry" correctly, but the viewport does not. I have made two screenshots depicting this:
3D view (viewport): Techdraw:
I think the problem stems from the implementation of the 3D view in the Gui directory. The problem is also experienced in the Blender, Revit, AutoCAD and LibreCAD. Moving "geometry" too far away from the defined internal software coordinate origin point distorts the 3D view (viewport) of the mentioned softwares.
What if it is as simple as switching a data type which increases the distance for non distorted "geometry" in the 3D view? AutoCAD has a larger distance than FreeCAD before it also becomes distorted.
Techdraw projects the "geometry" correctly, but the viewport does not. I have made two screenshots depicting this:
3D view (viewport): Techdraw:
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Shapefile importer
We also had this type of problems when we started to develop Trails. I implemented Coin Geo nodes to our objects to solve the issue.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Shapefile importer
How does it work?HakanSeven12 wrote: ↑Mon Oct 18, 2021 8:23 am I implemented Coin Geo nodes to our objects to solve the issue.
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Shapefile importer
Basically it creates a new coordinate system at the origin and renders geo objects by using this origin.
I'm controlling origin by using this object: https://github.com/HakanSeven12/Trails/ ... eorigin.py
I wrote my view providers by using sogeocoordinate nodes like this: https://github.com/HakanSeven12/Trails/ ... section.py
If you want to ask something I can help you.
I'm controlling origin by using this object: https://github.com/HakanSeven12/Trails/ ... eorigin.py
I wrote my view providers by using sogeocoordinate nodes like this: https://github.com/HakanSeven12/Trails/ ... section.py
If you want to ask something I can help you.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
-
- Posts: 3
- Joined: Sun Oct 17, 2021 6:26 pm
Re: Shapefile importer
I have a question about the math behind your workbench. Why is the GeoOrigin Origin x and y values are larger by three digits than the global coordinate values in the bottom right corner?
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Shapefile importer
Because this widget works in meters unit. But values of origin is millimeters. If you want to ask why it's in meters, because it's the standart usage for geological works.
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
-
- Posts: 3
- Joined: Sun Oct 17, 2021 6:26 pm
Re: Shapefile importer
Thank you for the information So I assume that the millimeters are from FreeCAD's internals?HakanSeven12 wrote: ↑Mon Oct 18, 2021 12:55 pm Because this widget works in meters unit. But values of origin is millimeters. If you want to ask why it's in meters, because it's the standart usage for geological works.
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Shapefile importer
Yes
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Shapefile importer
Wow, interesting... I wouldn't have expected that to solve the OpenGL issue (I suppose it's an OpenGL issue since it happens in other OpenGL apps as well).HakanSeven12 wrote: ↑Mon Oct 18, 2021 9:10 am Basically it creates a new coordinate system at the origin and renders geo objects by using this origin.
That might be interesting to use when importing Shapefiles too indeed
Re: Shapefile importer
I think it's more a problem of Coin3d and other libraries because internally they use simple floats instead of doubles. For huge coordinates you will get rounding issues, then.Wow, interesting... I wouldn't have expected that to solve the OpenGL issue (I suppose it's an OpenGL issue since it happens in other OpenGL apps as well).