From a5cf4cd421fd14fecd1cac9557157ef8982b37fa Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 12 Feb 2024 11:57:23 +1100 Subject: [PATCH] Remove 1:N clash functions --- src/ifcgeom_schema_agnostic/IfcGeomTree.h | 79 ------------------- .../ifcopenshell/geom/main.py | 27 ------- src/ifcwrap/IfcGeomWrapper.i | 24 ------ 3 files changed, 130 deletions(-) diff --git a/src/ifcgeom_schema_agnostic/IfcGeomTree.h b/src/ifcgeom_schema_agnostic/IfcGeomTree.h index e23df73710..a64f105a7d 100644 --- a/src/ifcgeom_schema_agnostic/IfcGeomTree.h +++ b/src/ifcgeom_schema_agnostic/IfcGeomTree.h @@ -1412,85 +1412,6 @@ namespace IfcGeom { return results; } - std::vector clash_intersection(const T& t, double tolerance = 0.002, bool check_all = true) const { - std::vector ts = select_box(t, true, 1e-5); - if (ts.empty()) { - return ts; - } - - std::vector ts_filtered; - ts_filtered.reserve(ts.size()); - - typename std::vector::const_iterator it = ts.begin(); - for (it = ts.begin(); it != ts.end(); ++it) { - if (t == *it) { - continue; // Don't clash against itself. - } - - if (is_manifold_.find(*it)->second) { - if (test_intersection(t, *it, tolerance, check_all).clash_type != -1) { - ts_filtered.push_back(*it); - } - } else { - if (test_collision(t, *it, false).clash_type != -1) { - ts_filtered.push_back(*it); - } - } - } - std::cout << "Tri count " << tri_count_ << std::endl; - - return ts_filtered; - } - - - std::vector clash_collision(const T& t, bool allow_touching = false) const { - std::vector ts = select_box(t, true, 1e-5); - if (ts.empty()) { - return ts; - } - - std::vector ts_filtered; - ts_filtered.reserve(ts.size()); - - typename std::vector::const_iterator it = ts.begin(); - for (it = ts.begin(); it != ts.end(); ++it) { - if (t == *it) { - continue; // Don't clash against itself. - } - - if (test_collision(t, *it, allow_touching).clash_type != -1) { - ts_filtered.push_back(*it); - } - } - std::cout << "Tri count " << tri_count_ << std::endl; - - return ts_filtered; - } - - std::vector clash_clearance(const T& t, double clearance, bool check_all) const { - std::vector ts = select_box(t, true, clearance); - if (ts.empty()) { - return ts; - } - - std::vector ts_filtered; - ts_filtered.reserve(ts.size()); - - typename std::vector::const_iterator it = ts.begin(); - for (it = ts.begin(); it != ts.end(); ++it) { - if (t == *it) { - continue; // Don't clash against itself. - } - - if (test_clearance(t, *it, clearance, check_all).clash_type != -1) { - ts_filtered.push_back(*it); - } - } - std::cout << "Tri count " << tri_count_ << std::endl; - - return ts_filtered; - } - std::vector select(const T& t, bool completely_within = false, double extend = 0.0) const { distances_.clear(); protrusion_distances_.clear(); diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 725d82dab2..74ea55de8e 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -193,33 +193,6 @@ class tree(ifcopenshell_wrapper.tree): args = [self, [e.wrapped_data for e in set_a], [e.wrapped_data for e in set_b], clearance, check_all] return ifcopenshell_wrapper.tree.clash_clearance_many(*args) - def clash_intersection(self, value, tolerance=0.002, check_all=True): - def unwrap(value): - if isinstance(value, entity_instance): - return value.wrapped_data - return value - - args = [self, unwrap(value), tolerance, check_all] - return [entity_instance(e) for e in ifcopenshell_wrapper.tree.clash_intersection(*args)] - - def clash_collision(self, value, allow_touching=False): - def unwrap(value): - if isinstance(value, entity_instance): - return value.wrapped_data - return value - - args = [self, unwrap(value), allow_touching] - return [entity_instance(e) for e in ifcopenshell_wrapper.tree.clash_collision(*args)] - - def clash_clearance(self, value, clearance=0.05, check_all=False): - def unwrap(value): - if isinstance(value, entity_instance): - return value.wrapped_data - return value - - args = [self, unwrap(value), clearance, check_all] - return [entity_instance(e) for e in ifcopenshell_wrapper.tree.clash_clearance(*args)] - def create_shape(settings, inst, repr=None): """ diff --git a/src/ifcwrap/IfcGeomWrapper.i b/src/ifcwrap/IfcGeomWrapper.i index d6ed5f234d..20b34ee0d7 100644 --- a/src/ifcwrap/IfcGeomWrapper.i +++ b/src/ifcwrap/IfcGeomWrapper.i @@ -182,30 +182,6 @@ return $self->clash_clearance_many(set_a_entities, set_b_entities, clearance, check_all); } - 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, check_all); - return IfcGeom_tree_vector_to_list(ps); - } - - aggregate_of_instance::ptr clash_collision(IfcUtil::IfcBaseClass* e, bool allow_touching = false) const { - if (!e->declaration().is("IfcProduct")) { - throw IfcParse::IfcException("Instance should be an IfcProduct"); - } - std::vector ps = $self->clash_collision((IfcUtil::IfcBaseEntity*)e, allow_touching); - return IfcGeom_tree_vector_to_list(ps); - } - - 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, check_all); - return IfcGeom_tree_vector_to_list(ps); - } - aggregate_of_instance::ptr select(IfcUtil::IfcBaseClass* e, bool completely_within = false, double extend = 0.0) const { if (!e->declaration().is("IfcProduct")) { throw IfcParse::IfcException("Instance should be an IfcProduct");