Skip to content

Commit

Permalink
Allow tree.select(BRepElement)
Browse files Browse the repository at this point in the history
  • Loading branch information
aothms committed Nov 7, 2021
1 parent 1cdf695 commit e0e8281
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/ifcgeom/IfcGeomTree.h
Expand Up @@ -224,6 +224,12 @@ namespace IfcGeom {
return ts_filtered;
}

std::vector<T> select(const IfcGeom::BRepElement* elem, bool completely_within = false, double extend = -1.e-5) const {
auto compound = elem->geometry().as_compound();
compound.Move(elem->transformation().data());
return select(compound, completely_within, extend);
}

std::vector<T> select(const gp_Pnt& p, double extend=0.0) const {
distances_.clear();

Expand Down
2 changes: 1 addition & 1 deletion src/ifcopenshell-python/ifcopenshell/geom/main.py
Expand Up @@ -146,7 +146,7 @@ def unwrap(value):
return value

args = [self, unwrap(value)]
if isinstance(value, entity_instance):
if isinstance(value, (entity_instance, ifcopenshell_wrapper.BRepElement)):
args.append(kwargs.get("completely_within", False))
if "extend" in kwargs:
args.append(kwargs["extend"])
Expand Down
5 changes: 5 additions & 0 deletions src/ifcwrap/IfcGeomWrapper.i
Expand Up @@ -127,6 +127,11 @@
return IfcGeom_tree_vector_to_list(ps);
}

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

}

// A visitor
Expand Down

1 comment on commit e0e8281

@IfcOpenBot
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I've created the following builds for your commit:

Linux Win macOS
Blender py37 64bit 32bit / 64bit 64bit
Blender py38 64bit 32bit / 64bit 64bit
Blender py39 64bit 32bit / 64bit 64bit
IfcConvert 64bit 32bit / 64bit 64bit
IfcGeomServer 64bit 32bit / 64bit 64bit
Python 31 64bit 32bit / 64bit 64bit
Python 36 64bit 32bit / 64bit 64bit
Python 37 64bit 32bit / 64bit 64bit
Python 38 64bit 32bit / 64bit 64bit
Python 39 64bit 32bit / 64bit 64bit
svgfill 64bit 32bit / 64bit 64bit

Kind regards,
IfcOpenBot

Please sign in to comment.