C
by Cyril on 29 Jul 2020, edited 2 Jul 2022
#
I currently use material layers thicknesses to determine wall total thickness but sometimes authoring tool write a material list or a simple material. Thickness data is nowhere. The only way I see to retrieve thickness is to compute it from geometry. Has anyone done this before or know a good algorithm to do this ?
I was thinking of projecting wall on an horizontal plane then try somehow to compute thickness or average thickness.
M
by Moult on 29 Jul 2020
#
+1 votes
Yeah - it's a tricky one!
See relevant discussion: https://github.com/IfcOpenShell/IfcOpenShell/issues/898
See heuristic method I've come up with, not perfect, but a starting point: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/qto.py#L4 - I've tested it on a series of models and seem to get relatively good results on simple geometry.
And see some fundamental issues in how buildingSMART specifies quantity data: https://forums.buildingsmart.org/t/when-is-a-door-not-a-door-choosing-the-correct-entity-classification-for-quantity-take-off/2857/2
C
by Cyril on 29 Jul 2020, edited 29 Jul 2020
#
@Moult said:
See heuristic method I've come up with, not perfect, but a starting point: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcblenderexport/blenderbim/bim/qto.py#L4 - I've tested it on a series of models and seem to get relatively good results on simple geometry.
Bounding box is a good start. Moreover luckily ArchiCAD the one which sometime do not export layer for a single layered wall do export multiple representations including BoundingBox
:

As IfcBoundingBox is clearly defined. On ifc import it is probably more consistent than taking the min(x,y,z) length as it is in local coordinates. I am just not sure for an IfcSlab/IfcRoof if it is still YDim
or rather ZDim
.
My current to be tested solution for the moment (obj is a FreeCAD object) :
def guess_thickness(self, obj, ifc_entity):
if obj.Material:
thickness = getattr(obj.Material, "TotalThickness", 0)
if thickness:
return thickness
if not ifc_entity.Representation:
return 0
if ifc_entity.IsDecomposedBy:
thicknesses = []
for aggregate in ifc_entity.IsDecomposedBy:
thickness = 0
for related in aggregate.RelatedObjects:
thickness += self.guess_thickness(obj, related)
thicknesses.append(thickness)
return max(thicknesses)
for representation in ifc_entity.Representation.Representations:
if representation.RepresentationIdentifier == "Box" and representation.RepresentationType == "BoundingBox":
if self.is_wall_like(obj.IfcType):
return representation.Items[0].YDim * self.fc_scale * self.ifc_scale
elif self.is_slab_like(obj.IfcType):
return representation.Items[0].ZDim * self.fc_scale * self.ifc_scale
else:
return 0
bbox = self._part_by_brep(ifc_entity).BoundBox
if self.is_wall_like(obj.IfcType):
return bbox.YLength
elif self.is_slab_like(obj.IfcType):
return bbox.ZLength
return 0
**@staticmethod**
def is_wall_like(ifc_type):
return ifc_type in ("IfcWall", "IfcWallStandardCase", "IfcCurtainWall")
**@staticmethod**
def is_slab_like(ifc_type):
return ifc_type in ("IfcSlab", "IfcSlabStandardCase", "IfcRoof")
S
by stephen_l on 29 Jul 2020
#
Bounding box for wall is not relevant as you may have L shaped walls. ArchiCad limit wall shape to straight segment, but it is not expected by ifc.
M
by Moult on 29 Jul 2020
#
@stephen_l you're absolutely correct - it is a quick heuristic which works with the majority of commonly used BIM programs, though. It should be possible to allow users to override it if they know more information about the authoring program.
C
by Cyril on 30 Jul 2020
#
@stephen_l said:
Bounding box for wall is not relevant as you may have L shaped walls. ArchiCad limit wall shape to straight segment, but it is not expected by ifc.
Another approach using axis (width perpendicular on xy plane) might be good for L shaped wall as even Revit export it but it doesn't work for slabs/roofs.
S
by stephen_l on 30 Jul 2020, edited 30 Jul 2020
#
Ifc standard allow wall profile / height / width-thickness to vary along axis, and even "free form" representations using brep to support organic shapes / slant. It also handle multiple geometry on composite walls ...
Axis / footprint representation are not required (@Moult correct me if i'm wrong)
So from standard it is not possible to retrieve any dimension in reliable way on many "not so edge cases" and trying to guess size from geometry is a slow process.
Instead of such slow "guess" and maybe return wrong value approach, would handle transfert for such parameters using a propertyset so it is fast and 100% reliable.
Ifc standard lack of proper parameter interchange common definition, but at least it it possible to implement it through propertysets.
S
by stephen_l on 31 Jul 2020
#
Current archipack implementation to retrieve wall thickness from random footprint (entire level at once) rely on 3 steps - 2d to 3d workflow.
-
Monotonize get the rid of crossing / different thickness / complex shapes, result is expected to be a set of linear polygons (including P shaped).
-
Find axis and thickness using a polygon skeleton analysis - same kind of algo than for roof shapes.
-
Snap start and end wall segments to neighboors, to fix wall intersection shape when not crossing at 90°.
M
by Moult on 1 Aug 2020
#
@stephen_l you are right - axis / footprint are optional.
C
by Coen on 30 Jun 2022
#
So is it possible to 'quantify' the width of an IfcWall and IfcWallStandardcase of an IFC file through python script and assign the value to a custom property? Same question for IfcSlab and IfcCovering.
M
by Massimo on 2 Jul 2022
#
+1 votes
@Coen If it helps, under QtoProperties, there is a button that calculate the width of the wall and also other buttons that calculate qto properties (lenght, height, volume, ...)
Also, i did a small script that calculate all the defined QtoProperties for the selected objects (https://github.com/maxfb87/Quantity-estimator)