From e463dca0dfd4988bc108c9ce5d2be0263afb4a09 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 2 Nov 2018 16:37:54 +0100 Subject: [PATCH] Absolute value for dot product in projected areas --- src/ifcgeom/IfcGeomRepresentation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ifcgeom/IfcGeomRepresentation.cpp b/src/ifcgeom/IfcGeomRepresentation.cpp index de15bb239d..e46d8ca4b2 100644 --- a/src/ifcgeom/IfcGeomRepresentation.cpp +++ b/src/ifcgeom/IfcGeomRepresentation.cpp @@ -104,9 +104,9 @@ TopoDS_Compound IfcGeom::Representation::BRep::as_compound() const { namespace { void accumulate(const gp_Ax3& ax, const gp_Dir& normal, double area, double& along_x, double& along_y, double& along_z) { - along_x += area * ax.XDirection().Dot(normal); - along_y += area * ax.YDirection().Dot(normal); - along_z += area * ax.Direction().Dot(normal); + along_x += area * fabs(ax.XDirection().Dot(normal)); + along_y += area * fabs(ax.YDirection().Dot(normal)); + along_z += area * fabs(ax.Direction().Dot(normal)); } void surface_area_along_direction(double tol, const TopoDS_Shape& s, const gp_Ax3& ax, double& along_x, double& along_y, double& along_z) {