Categories:
-
3d 96 articles
-
animations 16 articles
-
architecture 47 articles
-
blender 98 articles
-
bédé 19 articles
-
techdrawing 24 articles
-
freecad 189 articles
-
gaming 1 articles
-
idsampa 8 articles
-
inthepress 8 articles
-
linux 57 articles
-
music 1 articles
-
nativeifc 30 articles
-
opensource 266 articles
-
orange 4 articles
-
photo 16 articles
-
projects 35 articles
-
receitas 176 articles
-
saopaulo 18 articles
-
sketches 163 articles
-
talks 25 articles
-
techdrawing 24 articles
-
textes 7 articles
-
trilhas 3 articles
-
urbanoids 1 articles
-
video 47 articles
-
webdesign 7 articles
-
works 151 articles
Archives:
-
2007 22 articles
-
2008 32 articles
-
2009 66 articles
-
2010 74 articles
-
2011 74 articles
-
2012 47 articles
-
2013 31 articles
-
2014 38 articles
-
2015 28 articles
-
2016 36 articles
-
2017 41 articles
-
2018 46 articles
-
2019 59 articles
-
2020 18 articles
-
2021 20 articles
-
2022 7 articles
-
2023 25 articles
-
2024 14 articles
Working with terrain in
Since I have not much new FreeCAD-related development to show this week, I'll showcase an existing feature that has been around for some time, which is an external workbench named geodata, programmed by the long-time FreeCAD community member and guru Microelly2.
That workbench is part of the FreeCAD addons collection, which is a collection of additional workbenches that are not part of the core FreeCAD package but, since they are programmed entirely in Python and therefore don't need to be compiled, can be easily added to an existing FreeCAD installation. The FreeCAD addons repo linked above also provides a macro, which, once run inside FreeCAD, gives you an easy graphical installer that allows you to install, update or remove any of those additional workbenches. Click the link above and you'll get all the necessary instructions.
Also, this year was the first participation of FreeCAD to the Google Summer of Code. We got one student, Mandeep, who worked on building a more solid plugins installer for FreeCAD, capable of installing these workbenches but also all the macros found on the wiki. The work is not finished yet, but no doubt in the near future we will finally have a decent way to install all these additional features in FreeCAD.
Microelly2's geodata workbench basically allows you to fetch terrain data from the net, basically roads and building data from openstreetmap and terrain height data from both openstreetmap (but it doesn't always have accurate data) and NASA's SRTM data.
The procedure to get a piece of terrain with its height data in FreeCAD is quite simple:
- Install the geodata workbench and restart FreeCAD
- Switch to the geodata workbench
- Get the exact coordinates of the center of the zone you wish to import. You can do that simply by zooming in openstreetmap or in google maps, and you will see the coordinates in the URL bar of your browser
- In FreeCAD, menu GeoData -> Import OSM Map, fill in the coordinates. Leave "process elevation data" off. Buildings and roads are imported
- Click menu GeoData->Import OSM Heights and/or GeoData -> Import SRTM Heights to import height data from these two sources (use the same coordinates).
When done, you will get a piece of terrain with the roads and buildings, and the two terrain data (the SRTM data comes as a points cloud):
There will still be a bit of work necessary to turn this into data you can work with, but it's already a huge part of the work done.
The reason why I got interested in terrain data this week is aalso because I'm working on extending the Arch Site tool. Currently it is a simple container (it's actually simply a FreeCAD group with a couple of additional properties), but the idea is to turn it into something useful to:
- Hold and process terrain data coming in various forms, such as meshes
- Be able to get basic properties such as perimeter length or area
- Be able to subtract or add volumes to it
A made already a couple of experiments to see how far that is possible, and it actually works surprisingly well. In the image below, a mesh was quickly made in Blender, imported and scaled in FreeCAD, then turned into an open Part shape (a shell). Doing boolean operations with shells gives a lot of interesting possibilities, and it's totally possible to keep the terrain surface "open" (no need to add an artificial thickness to it), and be able to subtract or add solids to/from it. Of course the volumes of earth that need to be added/removed are therefore easily computable.
I still need to solve a couple of minor issues, then all this should be in the FreeCAD code pretty soon.