Coder Social home page Coder Social logo

Comments (13)

domlysz avatar domlysz commented on May 22, 2024

Unfortunately, it's not possible to proceed like this because the real issue behind the offset trick is that Blender stores coordinates as single precision (float32) number which has about 7 significant digits of precision. On the other hand, geographic data must be represented as double precision (float64) number. Without the offset, coordinates will be rounded and we will lose accuracy.

A workaround for this use case will be to create an addon that just compute the deltas between the 2 origins offset and apply it to the appended objects.

from blendergis.

s-leger avatar s-leger commented on May 22, 2024

Your workarround is exactly what i'm looking for !

Basemap addon move objects and update scene dx dy, but i cant keep a consistant dx dy across multiple files. And setting dx dy by hand is not possible at this time (as far as i can tell). Osm also use the dx dy to import data. Maybe an option is to allow keeping a consistant dx dy as it when set, and import maps and data at center of window.

Also another usefull tool we should have is to create a plane with the background map as texture, so we can import more than 1 map at time to get better resolution.

I'm aware of the 32 bits precision probs, allready facing with it in late 97 under 3dsmax 3.

On the other hand, when an object pivot position is greater than 100k, only the final representation of offset+local coords is wrong, as internally the mesh vertices coords stay the same (as long as you don't apply location), whenever the object pivot is.
So centering such object just improve the final precision, without any loose.

from blendergis.

domlysz avatar domlysz commented on May 22, 2024

Some tricks that may help

  • it's possible to lock the origin location in basemaps options
  • it's also possible to set the offset by hand, values are just stored in scene custom properties :

selection_001

so you can preset the origin before using the different tools and get something consistent by preventing basemaps updating the origin.

if you want to update the offset for a scene which already contains some objects you can use this snippet, it will move the objects according to the new offset values

import bpy

#import BlenderGIS modules depends on how the package is named
#if the addon is installed through github zip archive 
#then the name contains an illegal hyphen
#bellow an hacky workaround
import sys
sys.modules['BlenderGIS'] = __import__('BlenderGIS-master')

from BlenderGIS.geoscene import GeoScene

scn = bpy.context.scene
geoscn = GeoScene(scn)

#define here the new origin values
ox, oy = -55500, 5448000

dx = ox - geoscn.crsx
dy = oy - geoscn.crsy

geoscn.moveOriginPrj(dx, dy)

print(geoscn.getOriginPrj())

Also another usefull tool we should have is to create a plane with the background map as texture, so we can import more than 1 map at time to get better resolution.

yes this feature is already in my roadmap, high priority

On the other hand, when an object pivot position is greater than 100k, only the final representation of offset+local coords is wrong, as internally the mesh vertices coords stay the same (as long as you don't apply location), whenever the object pivot is.
So centering such object just improve the final precision, without any loose.

Very interesting, this solution can help to deal with some situations where we need to release the offset, for example if we want to use the dxf exporter to get a correctly georef dxf file.

from blendergis.

s-leger avatar s-leger commented on May 22, 2024

Great, you made my dreams comes true !

Was working with Qgis but your add-on greatly improves the workflow.
Maps and osm reprojected imports right in blender are invaluables !

I only encounter a crash issue while setting up GDAL wheel under windows 10 due to a wrong GDAL_DATA environnement variable.

The trick with > 100k pivot position and scene georef is to ensure the precision by taking account of the 7 significant digits of offset so you lower the risk to loose precision, even with larger offsets.

from blendergis.

kikislater avatar kikislater commented on May 22, 2024

Very interesting the manual offset, thanks Dominique.
For DXF I make a translation in draftsight but I have to open drafsight, it's a little bit boring ...
libopencad is new and in a few time released. There is also an implementation for Qgis with Gdal https://github.com/sandyre/libopencad

from blendergis.

domlysz avatar domlysz commented on May 22, 2024

an open source lib for dwg that's great ! It's so sad there is no strong open source cad app, librecad development seems so slow...

from blendergis.

kikislater avatar kikislater commented on May 22, 2024

Yes It's great. About what I heard, anytime sometimes want to create an opensource version, autodesk bring this to the court, the big company win and then project died ...
This one shoudl be good because there is a ton of aim from different opensource communities !

from blendergis.

s-leger avatar s-leger commented on May 22, 2024

Fork it 1000 times so it take 100 years to autodesk to bring everyone to the court.

from blendergis.

kikislater avatar kikislater commented on May 22, 2024

👍
Interesting ^_^

from blendergis.

domlysz avatar domlysz commented on May 22, 2024

todo list for fixing this issue:

  • add an append tool that take georef into account
  • add a tool to force georef origin to an user def value and move objects accordingly

from blendergis.

s-leger avatar s-leger commented on May 22, 2024

Reference links to link/append.
http://blender.stackexchange.com/questions/23926/how-to-show-open-dialog-box-that-can-navigate-to-blender-datablocks

https://www.blender.org/api/blender_python_api_2_77_release/bpy.types.BlendDataLibraries.html

from blendergis.

domlysz avatar domlysz commented on May 22, 2024

now origin location is editable in geoscene panel

selection_002

from blendergis.

bvgnt avatar bvgnt commented on May 22, 2024

I confirm as an architect that i systematicaly choose a point near my project and relocate all plans with wich i work. Here is the workflow i use.

  • Open survey file and delimitate the zone (could be a part of the city) i need by drawing a rectangle.
  • place it so project zone is in the more or less in the middle but the lower left corner should get an integer coordinate like 756 600, 456 200
  • Select all and bring this point to 0,0
    Now you can work easily with your plan in bim software.

Seems your not far from it, would be cool to get this rectangle (or any other shape) perimeter wich could then crop all imported data a bit like in Qgis.
By the way nice job. you plugin is really impressive.

from blendergis.

Related Issues (20)

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.