Site design in this video starts at min. 30 or so. I wad wondering if Freecad supports somekind of TIN surfacr of import .xyz text files for sites. Drawing outlines is usually not the way site data would behave.
I wad wondering if Freecad supports somekind of TIN surfacr of import .xyz text files for sites.
I don-t think so https://wiki.freecadweb.org/Import_Export
What i usually do with point clouds is to turn them into a mesh with meshlab, then use that as a site object in freecad. You can compile FreeCAD with the pcb library, which gives extra tools in the Points workbench, and i think the meshlab step might be doable directly in freecad, but i havent tested that yet
It's either GIS or pointcloud data. I think retrieving xyz from geotiff is a better and more clean method. It doesn't contain the 'noise'. I would like to try something out in this direction. Starting with some .xyz files i could supply for any demo open project.
Making a surface with surface in FreeCAD or Blender.
Surface with xyz. (I miss the edit function :P)
@magicalcloud_75 if you can supply a sample file as well as what you hope to get out of it, we can demonstrate the workflow in both FreeCAD and Blender and then document it on the OSArch wiki :)
Here is sample data of al plot in my home town. I pulled it out of Geotiff using Qgis. The video demonstates how i use Notepad++ to get rid of unwanted "NoData" entries in the export. These values are where the building would be but are replaced by 0.0 or 3.4E38. Unfortunately Qgis has no option to do this for the .xyz export itselfs. I think both Belnder and Qgis should have some plugin worked out
Video (Notepad++ / xyz data / TIN in CAD) https://youtu.be/npUffhHPhb0
Sample data (Geotif and XYZ export)
@magicalcloud_75 I am not sure if I am understanding exactly what you are doing but have you tried the fill no data algorithm to solve your zero/nodata issues? I did some tests on the various settings and posted them here: https://gis.stackexchange.com/a/293822/94350
As a landscape designer I have been poking around with this lately wanting a alternative to Civil 3D for bringing in surveys and doing site grading and cut and fill calculations. I don't know of you have looked into the FreeCAD Geomatics workbench. https://github.com/HakanSeven12/FreeCAD-Geomatics-Workbench it looks promising and I have managed to get it to work with simple point files.
Currently I use the QGIS interpolation algorithm with points from a CSV and breaklines that I create in QGIS because I use QGIS everyday and I know it inside and out. I find that this works very well. It outputs a raster DEM and 2d TIN lines that I add Z vales to from the DEM. I then bring the 3D TIN lines into Blender using the BlenderGIS addon. Where I merge the vertices by distance and press F to add faces creating a well defined site surface that is easy to edit.
I find this is a good way to end up with a lot of detail and a nimble file. Bringing in the DEM using BlenderGIS also works but if I need a lot of detail it bogs down.
If I need a quick export of a 3D file from QGIS I use the QGIS2threejs plugin and export a gltf file that comes into blender with an image attached and any extruded elements that I set up in QGIS.
I really want to be able to go directly from DWG to Blender and will probably try out Archipack sometime soon for that purpose.
I would also really like to explore how to Convert DEMs and points to QGIS Mesh layers (netcdf or something) so I can use the Mesh styling and analysis that is now part of QGIS thanks to the MDAL library which with ignorant exuberance seems like has a lot of potential. https://www.mdal.xyz/
I just realized that you included your .tif so I brought it into QGIS filled the holes and then used BlenderGIS to bring the TIF into into Blender and the used Mesh>Cleanup>Decimate to get the poly count down.
Could you give a quick explanation of how to do that in QGIS and @baswein ? I'd like to try here...
That looks promising. I just learned from the othwr side that NoData can be turned of while exporting this way. *BlenderGIS* is definitely on my list!
@magicalcloud_75 that is one of the nice things about QGIS because they are operating as a front end for a lot of different processing toolboxes there is usually a number of different ways to do the same thing and so I can often find one that has a feature that I am looking for. The BlenderGIS process was fairly straight forward and I would encorage you to try it. Import it as a Raw DEM and set your CRS to 28992 (Amersfoort).
@yorik in QGIS run the Fill nodata algo (GDAL) with the default settings except I also like to use the original file as a validity mask so it doesn't fill beyond the borders of the image. The Close Gaps algo (SAGA) also would work and does a smoother job but takes longer.
Nice!! Thanks for the explanation. I followed your steps, then exported the mesh to FreeCAD. Also generated contours in QGIS (raster->extraction->contours), then exported as .shp, but BlenderGIS didn't want to import that shapefile. So I exported it to DXF instead, but then it looses height values. Not sure also how to verify that the base mesh has the size it should have... Apparently the exported DXF is in meters.
Anyway, this is really nice and fast! I had never seen so precise geotiff file before, up to building contour level... is that common?
We could try to do something directly in FreeCAD... I see that BlenderGIS uses this library to read shapefiles: https://github.com/domlysz/BlenderGIS/blob/master/core/lib/shapefile.py
That might be usable in FreeCAD as well! I'll try to play with that a bit
Yorik, nice job! this data is coming from AHN database for NL. The whole country is mapped in a grid 0.5×0.5m with a height precision of about 1 or 2 cm. It's pretty precise and useful for the design proces. The builings are filtered out but can be downloaded as apart laserscans to. It would be intresting to use these to visualize the highrise in this erea. I will dig it up and crop it. Later!
I just played for 15 minutes and got some result! The shapefile.py found inside BlenderGIS/lib is super easy to use (instructions here: https://github.com/GeospatialPython/pyshp#reading-geometry ) and with it I was able to import the contour .shp file generated from QGIS. It matches the mesh exported from Blender perfectly... Only they don't arrive in FreeCAD at the same location (which is also not the location where the DXF file imports). But it gives nice and precise contour lines in FreeCAD quite easily:
For who is curious, this what I did (the shapefile.py must be placed somewhere where FreeCAD can find it, for ex. in the Macros folder)
We could pretty easily make a proper module in FreeCAD to read shapefiles now... Just need to extend to read other shape types (the attached script only reads polylines). Anyone interested in working on this? ;)
The challenge here is that this data comes in very large LAZ files covering a area of about 20x20 km Only a small portion needs to be cropped. I tried several routes by it is was quite time consuming and user unfriendly. Converting LAZ to LAS and then using Infraworks for cropping. The LAS tools in Qgis at that time did not work out the way i would like. I'll make it a second try
Download AHN files https://downloads.pdok.nl/ahn3-downloadpage/
Download LAZ filtered buildings https://download.pdok.nl/rws/ahn3/v1_0/laz/C_40BN1.LAZ
LAStools for cropping pointcloud data https://docs.qgis.org/2.14/nl/docs/user_manual/processing_algs/lidartools/lastools.html
Yorik that's great- I didn't have a problem bringing in the shapefile using BlenderGIS. One thing to make sure you have checked is the Produce 3D vector on the Contour algo. I also tried the QGIS DXF export and it resulted in 3D curves in Blender. (although I got an error about the CRS and had to reset it and import it without the georeferencing). I have been trying this with our annoying imperial units (feet) and it has been harder to navigate. Much of the United States has 1m resolution LiDAR derived DEMs available and I use it as the starting point on almost all of our projects. We also have DEMs of the first returns that show the tops of trees and buildings in a melted landscape kind of way. I thought that either the FreeCAD GeoData workbench or the Geomatics workbench had the ability to import shapefiles already but I don't see that now.
A contour drawn and imported as DXF in Qgis
Using LASclip in Qgis LAS of this area is made (LAZ 3.5GB => 300 Mb LAS)
Data added to the same folder.
Using POINTCLOUDCLIP I clipped only the highrise.
I installed BlenderGIS but when i activated it says "please install gdal to support raster projections support"
How is this to be installed?
I don't have GDAL installed for BlenderGIS and I don't think you need to have it installed unless you want to convert between projections. If all your data is coming from QGIS in the same projection then you should be fine.
I did set CRS to be dutch EPSG28992. Otherwise other data might come in wrong. Does this trigger the gdal message? It is working now.
I've found that it gets triggered when I try to add a open street map data after setting my CRS to a different system.
Please read issues, some people mentioned issues related to OSM, Point Clouds, and I think GeoTIFF
Okay, some other route than online services. I have perfected my workflow to make xyz files the right way so i can use this in my BIM/CAD programs. I think best way to import mesh CRS correct into Blender is to make a shp file from GIS data as first step. The challenge here is that seem not so easy to make geotiff into shp. There are a lot of formats supported in Qgis but save as .shp is not there? Is this a raster versus vector issue? I tried LATtools and it makes one but it becomes unreadable in both Qgis and Belnder.
Maybe it will be a dumb question to ask on dutch GIS forum but i will ask anyway. :P
Or perhaps you know the way in this?
Of coarse it's raster2vector :)
It definitely has the looks of a raster.
Not so pretty
Other area, but same principle...
Extract *xyz* from GIS, import it directly in CAD.
Replying to your previous post, actually it seems to me that blender's decimate modifier does quite a good job at "smoothing" the blocky aspect coming from extruding the raster. But qgis might have better tools for that too. I'm interested in working with contour lines too to recreate the surface, because it gives beautiful topology. But recreating faces between the contour lines is a complicated affair, there are all kinds of holes and weird situations... Maybe best to stick with meshes for terrains anyway..
I have found that the QGIS interpolation algo is good for making a TIN from contours because it uses the contours as breaklines plus you can add additional breaklines and control how the triangles are created. Unfortunately it only gives you a raster and 2D TIN lines. I add Z vales to the TIN lines from the DEM. I then bring the 3D TIN lines into Blender using the BlenderGIS addon. Where I merge the vertices by distance and press F to add faces creating a well defined site surface that is easy to edit.
I was going to post some screenshots but I can't seem to do that right now. I'll try in a bit.
BTW I extended the script above a little bit and it's now part of freecad https://forum.freecadweb.org/viewtopic.php?f=9&t=46150