diff --git a/src/ifcgeom_schema_agnostic/IfcGeomTree.h b/src/ifcgeom_schema_agnostic/IfcGeomTree.h index 1f9637dc85..ffb190dae2 100644 --- a/src/ifcgeom_schema_agnostic/IfcGeomTree.h +++ b/src/ifcgeom_schema_agnostic/IfcGeomTree.h @@ -633,8 +633,7 @@ namespace IfcGeom { v_protrusion_point = {v.X(), v.Y(), v.Z()}; v_surface_point = {point_on_b.X(), point_on_b.Y(), point_on_b.Z()}; - if (( ! check_all && v_protrusion > tolerance) - || v_protrusion > (max_protrusion - 1e-3)) { + if ( ! check_all && v_protrusion > tolerance) { clash_types_.push_back(0); protrusion_distances_.push_back(v_protrusion); protrusion_points_.push_back(v_protrusion_point); @@ -653,6 +652,13 @@ namespace IfcGeom { protrusion = v_protrusion; protrusion_point = v_protrusion_point; surface_point = v_surface_point; + if (protrusion > (max_protrusion - 1e-3)) { + clash_types_.push_back(0); + protrusion_distances_.push_back(protrusion); + protrusion_points_.push_back(protrusion_point); + surface_points_.push_back(surface_point); + return true; + } } } } diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index 52592265e5..fface2ad9e 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -106,11 +106,11 @@ return IfcGeom_tree_vector_to_list(ps); } - aggregate_of_instance::ptr clash_intersection(IfcUtil::IfcBaseClass* e, double tolerance = 0.002) const { + aggregate_of_instance::ptr clash_intersection(IfcUtil::IfcBaseClass* e, double tolerance = 0.002, bool check_all = true) const { if (!e->declaration().is("IfcProduct")) { throw IfcParse::IfcException("Instance should be an IfcProduct"); } - std::vector ps = $self->clash_intersection((IfcUtil::IfcBaseEntity*)e, tolerance); + std::vector ps = $self->clash_intersection((IfcUtil::IfcBaseEntity*)e, tolerance, check_all); return IfcGeom_tree_vector_to_list(ps); } @@ -122,11 +122,11 @@ return IfcGeom_tree_vector_to_list(ps); } - aggregate_of_instance::ptr clash_clearance(IfcUtil::IfcBaseClass* e, double clearance = 0.05) const { + aggregate_of_instance::ptr clash_clearance(IfcUtil::IfcBaseClass* e, double clearance = 0.05, bool check_all = false) const { if (!e->declaration().is("IfcProduct")) { throw IfcParse::IfcException("Instance should be an IfcProduct"); } - std::vector ps = $self->clash_clearance((IfcUtil::IfcBaseEntity*)e, clearance); + std::vector ps = $self->clash_clearance((IfcUtil::IfcBaseEntity*)e, clearance, check_all); return IfcGeom_tree_vector_to_list(ps); }