Skip to content

Commit e0e8281

Browse files
committed
Allow tree.select(BRepElement)
1 parent 1cdf695 commit e0e8281

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/ifcgeom/IfcGeomTree.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ namespace IfcGeom {
224224
return ts_filtered;
225225
}
226226

227+
std::vector<T> select(const IfcGeom::BRepElement* elem, bool completely_within = false, double extend = -1.e-5) const {
228+
auto compound = elem->geometry().as_compound();
229+
compound.Move(elem->transformation().data());
230+
return select(compound, completely_within, extend);
231+
}
232+
227233
std::vector<T> select(const gp_Pnt& p, double extend=0.0) const {
228234
distances_.clear();
229235

src/ifcopenshell-python/ifcopenshell/geom/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def unwrap(value):
146146
return value
147147

148148
args = [self, unwrap(value)]
149-
if isinstance(value, entity_instance):
149+
if isinstance(value, (entity_instance, ifcopenshell_wrapper.BRepElement)):
150150
args.append(kwargs.get("completely_within", False))
151151
if "extend" in kwargs:
152152
args.append(kwargs["extend"])

src/ifcwrap/IfcGeomWrapper.i

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@
127127
return IfcGeom_tree_vector_to_list(ps);
128128
}
129129

130+
aggregate_of_instance::ptr select(const IfcGeom::BRepElement* elem, bool completely_within = false, double extend = -1.e-5) const {
131+
std::vector<IfcUtil::IfcBaseEntity*> ps = $self->select(elem, completely_within, extend);
132+
return IfcGeom_tree_vector_to_list(ps);
133+
}
134+
130135
}
131136

132137
// A visitor

0 commit comments

Comments
 (0)