mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Remove 1:N clash functions
This commit is contained in:
@@ -1412,85 +1412,6 @@ namespace IfcGeom {
|
||||
return results;
|
||||
}
|
||||
|
||||
std::vector<T> clash_intersection(const T& t, double tolerance = 0.002, bool check_all = true) const {
|
||||
std::vector<T> ts = select_box(t, true, 1e-5);
|
||||
if (ts.empty()) {
|
||||
return ts;
|
||||
}
|
||||
|
||||
std::vector<T> ts_filtered;
|
||||
ts_filtered.reserve(ts.size());
|
||||
|
||||
typename std::vector<T>::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<T> clash_collision(const T& t, bool allow_touching = false) const {
|
||||
std::vector<T> ts = select_box(t, true, 1e-5);
|
||||
if (ts.empty()) {
|
||||
return ts;
|
||||
}
|
||||
|
||||
std::vector<T> ts_filtered;
|
||||
ts_filtered.reserve(ts.size());
|
||||
|
||||
typename std::vector<T>::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<T> clash_clearance(const T& t, double clearance, bool check_all) const {
|
||||
std::vector<T> ts = select_box(t, true, clearance);
|
||||
if (ts.empty()) {
|
||||
return ts;
|
||||
}
|
||||
|
||||
std::vector<T> ts_filtered;
|
||||
ts_filtered.reserve(ts.size());
|
||||
|
||||
typename std::vector<T>::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<T> select(const T& t, bool completely_within = false, double extend = 0.0) const {
|
||||
distances_.clear();
|
||||
protrusion_distances_.clear();
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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<IfcUtil::IfcBaseEntity*> 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<IfcUtil::IfcBaseEntity*> 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<IfcUtil::IfcBaseEntity*> 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");
|
||||
|
||||
Reference in New Issue
Block a user