mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 23:50:59 +00:00
ifcviewer: include spatial elements in iterator filter
Match bonsai's process_element_filter for the no-filter branch: IfcSpatialStructureElement on IFC2X3, IfcSpatialElement otherwise. They flow through the same net/gross split as IfcElement. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -299,10 +299,10 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
|
|||||||
|
|
||||||
// Mirror bonsai's IfcImporter.process_element_filter: walk IfcElement
|
// Mirror bonsai's IfcImporter.process_element_filter: walk IfcElement
|
||||||
// (plus IfcProxy on IFC2X3/IFC4), drop IfcFeatureElement except
|
// (plus IfcProxy on IFC2X3/IFC4), drop IfcFeatureElement except
|
||||||
// IfcSurfaceFeature, and split elements with more openings than the
|
// IfcSurfaceFeature, pick up spatial elements, and split elements
|
||||||
// configured void limit into a "gross" set that is rendered without
|
// with more openings than the configured void limit into a "gross"
|
||||||
// opening subtractions. Both sets become include filters so we don't
|
// set that is rendered without opening subtractions. Both sets
|
||||||
// waste time mapping openings, spaces, grids, etc.
|
// become include filters so we don't waste time mapping openings.
|
||||||
std::set<int> net_ids;
|
std::set<int> net_ids;
|
||||||
std::set<int> gross_ids;
|
std::set<int> gross_ids;
|
||||||
{
|
{
|
||||||
@@ -313,6 +313,11 @@ void GeometryStreamer::run(const std::string& path, int num_threads) {
|
|||||||
auto proxies = ifc_file_->instances_by_type("IfcProxy");
|
auto proxies = ifc_file_->instances_by_type("IfcProxy");
|
||||||
elements.insert(elements.end(), proxies.begin(), proxies.end());
|
elements.insert(elements.end(), proxies.begin(), proxies.end());
|
||||||
}
|
}
|
||||||
|
const char* spatial_root = (schema_name == "IFC2X3")
|
||||||
|
? "IfcSpatialStructureElement"
|
||||||
|
: "IfcSpatialElement";
|
||||||
|
auto spatials = ifc_file_->instances_by_type(spatial_root);
|
||||||
|
elements.insert(elements.end(), spatials.begin(), spatials.end());
|
||||||
|
|
||||||
const int void_limit = AppSettings::instance().voidLimit();
|
const int void_limit = AppSettings::instance().voidLimit();
|
||||||
for (const auto& e : elements) {
|
for (const auto& e : elements) {
|
||||||
|
|||||||
Reference in New Issue
Block a user