Arch site: backfill calculation

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Julien
Posts: 5
Joined: Tue Jan 08, 2019 1:49 pm
Location: Paris, France

Arch site: backfill calculation

Post by Julien »

Hi,

I am working on Freecad 0.17 for few days, to determine with the Arch workbench the volume of required backfill for a construction project, as explained in the documentation (https://www.freecadweb.org/wiki/Arch_Site).
I import the terrain as a mesh from a STL file, but its properties aren't calculated (area, perimeter).
Then the bakfill volume, at the moment represented as an simple extruded solid (the real surface will be more complex, but I try to work step by step ^^), can be "add" to the Site object, but this action doesn't have any visible effect.

The final goal of this work is to obtain the "addition volume" in the Site properties.

As Arch can't give any terrain properties, I guess there is a problem with my mesh, but I don't find what is it? The only point I see is the geometry complexity...

Image

Some information on the study context: the project takes place in a flood zone. We have to implant the equipments (it's an industrial project) above a minimum level given by the authorities (6.7m here). So, a backfill volume has to be add to the terrain, but legislation requires than an equal volume has to be excavated on another part of the terrain. This is why I need to know this volume.

My workflow before Freecad:
Raw data are contour lines from a LIDAR survey (SHP file)
In QGIS, I extract the vertices of the lines, for my working zone, in a .SHP file
In BLENDER and its module Blender GIS, I create the mesh from these vertices (Delaunay triangulation) and I export the result in a .STL file
Backfill volume is created from a polyline imported in a DWF file, and simply extruded.

Files can be downloaded here:
https://drive.google.com/open?id=12Pocm ... wTsrW-3K5P

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/France (fr_FR)
User avatar
Roy_043
Veteran
Posts: 7389
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch site: backfill calculation

Post by Roy_043 »

The Arch workbench requires solids. So you will have to convert the mesh:
https://www.freecadweb.org/wiki/Import_from_STL_or_OBJ
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch site: backfill calculation

Post by furti »

Roy_043 wrote: Tue Jan 08, 2019 6:23 pm The Arch workbench requires solids

I think the Arch Site Object does not Need a solid. At least for the Terrain.

The documentation (https://www.freecadweb.org/wiki/Arch_Site) says
The terrain must be an open shell or surface.
User avatar
Roy_043
Veteran
Posts: 7389
Joined: Thu Dec 27, 2018 12:28 pm

Re: Arch site: backfill calculation

Post by Roy_043 »

It may be that this information is not up to date:
https://www.freecadweb.org/wiki/Arch_panel_tutorial wrote:Several workbenches (PartDesign and Arch) are made to work only with solid objects, and will refuse to work on objects that are not solid.
User avatar
yorik
Founder
Posts: 13466
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch site: backfill calculation

Post by yorik »

The arch site indeed doesn't need a solid. That is precisely why I implemented it that way, because 99.9% of he terrain data you get out there are meshes. What it does internally, is 1) convert the mesh to a shape, and 2) extrude that shape along the negative Z axis (downwards). So internally, it has a solid copy of the terrain.

The problem I believe here is probably the huge complexity of the mesh... Mesh-to-solid operations, and subsequently boolean operations probably become very heavy...

I would try to not use the arch site, but do this process manually, you'll get the same results at the end, but with more control over the bottlenecks.

1) I would simplify the mesh a bit. In Blender, there is a very useful interactive modifier called decimate https://docs.blender.org/manual/en/late ... imate.html I would try using that to get a bit lighter version (from your image, I think many smaller triangles could be unified without really loosing much terrain resolution)
2) The Part workbench has a "Part from Mesh" tool to create a shape from a mesh
3) Provide your mesh has no defects or holes, this should give you a shell (open shape). Use Part Extrude to extrude it downwards
4) If you want to have a bottom flat face, subtract a big, flat object from it
5) you now have a solid, you can use the part boolean tools (subtraction, intersection, etc) to get a backfill volume.
6) You can get the volume with the ShapeInfo macro (not 100% sure about the name, but there is one that prints shapes information), or via python:

Code: Select all

FreeCADGui.Selection.getSelection()[0].Shape.Volume
Julien
Posts: 5
Joined: Tue Jan 08, 2019 1:49 pm
Location: Paris, France

Re: Arch site: backfill calculation

Post by Julien »

Thank you for your help.

I am still working on my problem, with few success up to now. I have simplified the mesh with the decimate modifier in Blender, but the generated mesh doesn't work in Freecad: the software crashes when I try to extrude the shape (I analyse & repair the mesh before the conversion to shape).
I will try another solution with MeshLab to generate a smarter mesh, to use in Freecad, instead of Blender.
User avatar
yorik
Founder
Posts: 13466
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch site: backfill calculation

Post by yorik »

There is one more possibility i just remembered, is to generate a nurbs surface from your mesh.. https://yorik.uncreated.net/guestblog.php?2016=274
Julien
Posts: 5
Joined: Tue Jan 08, 2019 1:49 pm
Location: Paris, France

Re: Arch site: backfill calculation

Post by Julien »

I have finally succeed to obtain an operational mesh with Blender: after some steps of decimate modifier (in planar then collapse successively), I delete the faces & edges to keep only the resulting vertices, to reapply a Delaunay triangulation. Then, I delete manually some faces along the boundaries of the modelled surface.

A mesh error before the new Delaunay triangulation:
Image

Comparison between the original mesh (black) & the final one (orange):
Image

In freecad, I follow the steps given by Yorik to calculate the backfill volume. Nevertheless, a new problem appears: the Boolean difference between the backfill volume & the terrain doesn't work on some faces.
Do you have an idea to solve this? (I use the analyse & repair mesh tool after the mesh import, to check its integrity, there was 2-3 normal inversion, but not for these faces)

Backfill & terrain, with extrusion:
Image

Bottom view of the backfill volume, after the boolean difference:
Image

For the nurbs surface, it was the first method I followed in fact (with your blog, Yorik :) ). But I had a problem with polylines & the DXF file: Freecad imported my DXF without elevation. After some research, I have discovered my contour lines was saved as LWPOLYLINE while they have to be converted in 2D POLYLINE, to keep the elevation attribute in the DXF file (I use Draftsight, not Autocad). I have now installed an old version of Autocad (LT 2008) to do this conversion, if needed.
User avatar
yorik
Founder
Posts: 13466
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Arch site: backfill calculation

Post by yorik »

Apparently some faces have normals flipped. That happens often, in Blender since both faces are rendered equally, it's often hard to spot them. In blender, in the panel that appears when you press N, in edit mode, you can show face normals. the CTRL+SHIFT+ALT+N also recalculates all normals to be all pointing in the same direction. However, if you have manifold edges in your mesh (that you can find with CTRL+SHIFT+ALT+M), that operation could not be fully accurate.

I also see that in freecad each facet seems to have been extruded separately. If, before extruding, you turn your whole group of facets into a shell, it should fix the normals automatically. I think if you use the mesh to shape tool it should do it automatically. If not, this in the python console will do it:

Code: Select all

myObj = FreeCADGui.Selection.getSelection()[0] # get the selected object
import Part
myShell = Part.Shell(myObj.Shape.Faces) # build a shell from the faces of the selected object
Part.show(myShell) # create an object in the document from our shell
Julien
Posts: 5
Joined: Tue Jan 08, 2019 1:49 pm
Location: Paris, France

Re: Arch site: backfill calculation

Post by Julien »

Hello,
First of all, sorry for the week without answer, I was out of the office a part of this week.

I have discovered the "check geometry" tool, which returns a lot of "intersecting wires" errors. I assume this can be the cause of the extrude problem. So, in Blender, I used the "Remove doubles" function then import again the resulting mesh in Freecad: no intersecting wires with the new shape.
Nevertheless, Freecad can't extrude this one (I have left my PC one entire night processing this operation without result).

Check geometry result, before correction with Blender:
Image

Check geometry result, after correction with Blender:
Image

Plan B: I have opened in Blender the extruded volume from last week, to manually delete the unwanted faces (but also remove doubles and correct normals for this mesh). Then, after a reimport in Freecad, I obtain a first backfill volume (8900 m3 for information).

One example of unwanted faces (before/after the removal):
Image
Image

The next step is to refine the backfill level: up to now, a flat surface was considered, corresponding to the buildings floors; but slopes & banks will take place between them (as we don't need to reach a minimum level for traffic zones).
So, I am going to model the buildings floors and cants in their neighbourhood to obtain a more precise backfill volume (and avoid to dig 3 or 4 Olympic-size swimming pools somewhere else in the factory, as required by legislation...)

If I can't achieve the extrusion and/or boolean operation with my current mesh, I think to also model basically the terrain.
Post Reply