Civil Engineering Design functions

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
sanzo
Posts: 11
Joined: Mon Sep 22, 2014 8:00 pm

Re: Civil Engineering Design functions

Postby sanzo » Sat Oct 24, 2015 4:11 pm

Hi all,
I'm glad to see this topic gained some traction... (I've noticed it only now, I still forget to subscribe to topics)

Yesterday I discovered a handy feature of civil3d (I don't use it directly, but my colleagues do) that allows to create a terrain surface starting from an .ASC file in 2 simple clicks (one for importing the surface points, the other to create the actual surface). Then I thought that FreeCAD could use some QGIS/GDAL/GRASS power (Also yesterday another colleague asked me if I knew a way to translate a kml file into another projection and put it in autocad and I pointed him to QGIS). Not sure how it can be done (and if we need all the features of qgis).

I'm at home and don't have access to civil3D, but I can offer you some more information:
  • here's a video showing the basics of alignments: https://www.youtube.com/watch?v=hQehH-rid_s
  • after creating the alignment we want to get the profile of the terrain and subsurfaces (or volumes), if they exists
  • another step is to create the profile of our infrastructure (road or tunnel) and convert it to a 3d polyline
  • also we could have the need to do the inverse process, from 3d polyline to alignment + profile, and from alignment+profiles to surfaces (as stated in my previous post)
  • given the cross section of the road/tunnel, place it along the alignment (at some point it can change) to have a 3d representation (and also get 2d views/drawings) of the infrastructure and the volume of earthworks needed (if geological subsurfaces are present, the volume should be divided by strata)
  • There's an open standard called landXML, that could be used for data exchange (used also by civil3D)
More information as soon as I get the chance to analyze thoroughly the workflow of my colleagues
M-Rick
Posts: 39
Joined: Fri Aug 22, 2014 1:03 pm

Re: Civil Engineering Design functions

Postby M-Rick » Thu Oct 29, 2015 9:45 am

FreeCAD will need to support SHP and GML which is an open ISO format. GML is well supported by QGIS and also used in professional softwares like ESRI softwares.
http://www.wikiwand.com/en/Geography_Markup_Language

For the 3D itself, using GML provides access to CityGML which brings SketchUp like modeling feature with GML support in 3D. CityGML is based over LandXML too.
http://www.citygmlwiki.org

There is a nice job already done with Random3Dcity in Python to create 3D models in CityGML.
https://github.com/tudelft3d/Random3Dcity

Some other information by OGC about open geospatial standards.
http://www.opengeospatial.org/standards/citygml
aeroSurveyor
Posts: 8
Joined: Sat Oct 31, 2015 11:15 am

Re: Civil Engineering Design functions

Postby aeroSurveyor » Sat Oct 31, 2015 1:31 pm

I've been reading this thread with great interest. I must say that I don't know freeCAD well yet. Some things might be redundant/ already included in other messages.
I've been working in the geodata sector for many years (different geodata providers) and would like to encourage you integrate geo-functionality into freecad. I've been using QGIS, SAGA-GIS, uDig-GIS in the past. At work, most used are ArcGIS, Microstation and many more specialised programs, many are Microstation MDL - plugins (e.g. for point cloud applications). Also AutoCAD based programs for 3D buildings (which seem to be becoming more and more important) etc...

I think the most important things that would need to be done would be:

1. introduce typical file formats for the type of data you want to work with (I think you can reach this using GDAL/OGR ?). From my point of view and experience:
For vector data: SHP (including access to attribute tables), DXF, DWG, DGN, KML
For imagery: GeoTIFF, ECW, iTIFF, many more, but geotiff would be important.
For other raster data - e.g. digital elevation models: simple ascii *.xyz, ESRI ascii, GeoTIFF, HGT
For point clouds: LAS, LAZ, also simple ascii *.xyz
For TINs (or meshes): (?)
For 3D buildings: CityGML (?)

Maybe imagery is not obvious in a CAD, but remote sensing data and GIS go hand in hand - the interesting products are combinations of all kinds of data. E.g. draping terrain models or city models with high resolution imagery etc...

2. Equally important is the ability to work with different coordinate reference systems, IMO including vertical systems (which most GIS's don't do). You need to be able to reproject data between different CRS's and always know exactly which one your working in (not always obvious when customers are sending you all kinds of different data). Also it would be important to be able to convert between different ellipsoidal and geoid height systems.

3. Be able to work with very large datasets.

I'm not a programmer, but typically these libraries are standard:
https://github.com/OSGeo/gdal
https://github.com/OSGeo/proj.4
https://trac.osgeo.org/geos/
http://www.liblas.org/
maybe also look at http://geographiclib.sourceforge.net/ (I think it is partly integrated into proj4 ?)
also look here: http://www.epsg.org/

Here's also an interesting place to look: http://vterrain.org/
M-Rick
Posts: 39
Joined: Fri Aug 22, 2014 1:03 pm

Re: Civil Engineering Design functions

Postby M-Rick » Sat Oct 31, 2015 11:10 pm

aeroSurveyor wrote:1. introduce typical file formats for the type of data you want to work with (I think you can reach this using GDAL/OGR ?). From my point of view and experience:
For vector data: SHP (including access to attribute tables), DXF, DWG, DGN, KML
For imagery: GeoTIFF, ECW, iTIFF, many more, but geotiff would be important.
For other raster data - e.g. digital elevation models: simple ascii *.xyz, ESRI ascii, GeoTIFF, HGT
For point clouds: LAS, LAZ, also simple ascii *.xyz
For TINs (or meshes): (?)
For 3D buildings: CityGML (?)
I would add GML because it is an open format and has been set as an ISO standard (ISO 19136) as well. By using GDAL/OGR it is supported out-of-the-box.
aeroSurveyor wrote:Maybe imagery is not obvious in a CAD, but remote sensing data and GIS go hand in hand - the interesting products are combinations of all kinds of data. E.g. draping terrain models or city models with high resolution imagery etc...
Currently, I am working on an imagery digitizing projet. We use a special modified CAD software based on Microstation to accomplish this work, because QGIS doesn't include CAD feature advanced and handy enough for this job.

The raster data must be also Jpeg, PNG and JPEG2000, some WMS servers are switching to this. http://professionnels.ign.fr/mises-a-jour
And optionally, ECW, as you said, but it will work only if the GDAL QGIS plug-in if installed to read it.
aeroSurveyor
Posts: 8
Joined: Sat Oct 31, 2015 11:15 am

Re: Civil Engineering Design functions

Postby aeroSurveyor » Sun Nov 01, 2015 7:43 pm

M-Rick, agree with what you say - I just wrote my own point of view. Could also add a whole lot of file formats and also a long wish list, e.g. making libraries like, Saga-GIS, OpenCV, GEOS/Shapely, databases like PostGIS, Spatialite accessible etc... I think via GDAL many data formats should be accessible "out of the box" as you say. Concerning ECW I think there is some licensing problem, ECW being proprietary. It is quite wide spread though.

I would really like to emphasize the importance of having all data's CRS`s registered when loaded, including vertical systems if possible, and the ability to reproject to other systems reliably. But again, this should be manageable with the Proj4 library.
User avatar
yorik
Site Admin
Posts: 11930
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Civil Engineering Design functions

Postby yorik » Mon Nov 02, 2015 5:11 pm

Interesting input, keep it coming...

My 2 cents:

- Additional import formats are indeed a quick and easy thing to add (they can sometimes be very simple python scripts), that can quickly boost enormously the possibilities to use FreeCAD in a certain field. However, sometimes it doesn't make much sense before proper corresponding objects exist in FreeCAD. For example, importing "wall" objects from an IFC file didn't make much sense while a wall object didn't exist in FreeCAD (you could import them as simple shapes, of course, but there was little use to that). Even so, this is certainly a priority. One must take care too that only open (and documented) file formats are easy to implement. Closed, proprietary and undocumented ones are almost impossible to support (DGN for example).

- Image-based workflows: Same as in other areas (mesh modeling for example), FreeCAD is a solid modeller. There are many apps out there much more advanced in that field, where it would require a lot of efforts to make FreeCAD perform as well. My opinion is that when such app exists, our time is much better spent trying to better the in/out workflow between it and FreeCAD, than trying to make FreeCAD do the same as that app. If some app out there can take a height map and create a 3D mesh from it, we'd better make sure we can import and do something with that 3D mesh than try to recreate it ourselves. This certainly needs more investigation among existing GIS apps (what already exists and what doesn't).

- The Point cloud -> 3D mesh -> 3D solid workflow seems to be an important part of the work. Once we have a terrain in solid form, a whole range of operations can be easily performed: Calculating profiles along a baseline / alignment, calculating volumes to be cut/added, intersections, sections and whatsoever. I see two problems for now: 1) the FreeCAD Points module can import 3D poitn clouds from several formats already, but cannot do anything with it yet. Other alls (meshlab) can turn a point cloud into mesh. Could we tap into that somehow? Can any of the libs listed above do that? and 2) terrain data can be very large,, which could make it impossible to work with solid shapes. This should be tested, and maybe alternatives found (leave it as meshes? Convert to solid on-the-fly?)
User avatar
bernd
Posts: 10062
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Civil Engineering Design functions

Postby bernd » Mon Nov 02, 2015 7:57 pm

yorik wrote:- The Point cloud -> 3D mesh -> 3D solid workflow seems to be an important part of the work. Once we have a terrain in solid form, a whole range of operations can be easily performed: Calculating profiles along a baseline / alignment, calculating volumes to be cut/added, intersections, sections and whatsoever. I see two problems for now: 1) the FreeCAD Points module can import 3D poitn clouds from several formats already, but cannot do anything with it yet. ...
FreeCAD can ... It's german, viewtopic.php?f=13&t=12796&start=10 and viewtopic.php?f=3&t=12963
aeroSurveyor
Posts: 8
Joined: Sat Oct 31, 2015 11:15 am

Re: Civil Engineering Design functions

Postby aeroSurveyor » Mon Nov 02, 2015 9:22 pm

Maybe this is of interest:
http://pointclouds.org/
it can produce meshes and is BSD licensed.
Concerning proprietary formats like DGN: there are enough other (open) formats around, we can easily live without these.
There are a whole lot of good apps around. I can*t see an open source one that could serve as a good general basis for 3D geodata though - maybe I'm missing something.
I've loaded a digital elevation into FreeCAD just to see / move around... Slightly over 2 Mio points. As you say, I couldn't do anything with it (just saw Bernd's message, bill have to look at it) and in a GIS I would have wanted a colouring of the terrain according to the z values. Freecad (v. 0.15) did perform quite slow when moving around also, but could have been worse. There also seems to be a unit-issue. I switched the units to m/kg/s/degree and 2 decimals. In the data view measurements seemed to show up correctly. In the main view the coordinates were wrong (wrong decimal point). The dimensions in the bottom right were wrong too. Coordinate system was UTM, so 6 digits for east-west and 7 for north south.
So I was thinking, if FreeCAD could work with large geographic coordinates, a library like proj4 (for projections) and be able to import the main file formats, the basis would be laid. I understand that it would take long for very much functionality to be included, but maybe it would get a new audience (maybe with some programmers among them) interested.
aeroSurveyor
Posts: 8
Joined: Sat Oct 31, 2015 11:15 am

Re: Civil Engineering Design functions

Postby aeroSurveyor » Mon Nov 02, 2015 10:15 pm

Just looked at the threads Bernd points to. So pointclouds (PCL) is already included (forgive my ignorance). Had a look at the Github repository, it looks like OpenCV is also accessible? Wow. So via Python there must already be tons of functionality. Will have to have closer look...
User avatar
bernd
Posts: 10062
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Civil Engineering Design functions

Postby bernd » Tue Nov 03, 2015 5:32 am

aeroSurveyor wrote: in a GIS I would have wanted a colouring of the terrain according to the z values.
try this viewtopic.php?t=6876