From 790bdee195e2d93bfb95506b7618cad795ac9dbd Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 22 Mar 2014 18:46:07 +0000 Subject: [PATCH] Correctly treat IfcLShapeProfileDef.Width as optional attribute Fix IfcCShapeProfileDef having Width and Depth interchanged --- src/ifcgeom/IfcGeomFaces.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ifcgeom/IfcGeomFaces.cpp b/src/ifcgeom/IfcGeomFaces.cpp index 7a206d7f96..d8a6b0b687 100644 --- a/src/ifcgeom/IfcGeomFaces.cpp +++ b/src/ifcgeom/IfcGeomFaces.cpp @@ -243,8 +243,8 @@ bool IfcGeom::convert(const Ifc2x3::IfcIShapeProfileDef::ptr l, TopoDS_Face& fac return IfcGeom::profile_helper(12,coords,doFillet ? 4 : 0,fillets,radii,trsf2d,face); } bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr l, TopoDS_Face& face) { - const double x = l->Depth() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); - const double y = l->Width() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); + const double y = l->Depth() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); + const double x = l->Width() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); const double d1 = l->WallThickness() * IfcGeom::GetValue(GV_LENGTH_UNIT); const double d2 = l->Girth() * IfcGeom::GetValue(GV_LENGTH_UNIT); bool doFillet = l->hasInternalFilletRadius(); @@ -269,7 +269,7 @@ bool IfcGeom::convert(const Ifc2x3::IfcCShapeProfileDef::ptr l, TopoDS_Face& fac } bool IfcGeom::convert(const Ifc2x3::IfcLShapeProfileDef::ptr l, TopoDS_Face& face) { const double y = l->Depth() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); - const double x = l->Width() / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); + const double x = (l->hasWidth() ? l->Width() : l->Depth()) / 2.0f * IfcGeom::GetValue(GV_LENGTH_UNIT); const double d = l->Thickness() * IfcGeom::GetValue(GV_LENGTH_UNIT); bool doEdgeFillet = l->hasEdgeRadius(); bool doFillet = l->hasFilletRadius();