Merge branch 'IfcOpenShell:v0.8.0' into v0.8.0

This commit is contained in:
Richard Brice
2023-12-01 07:22:29 -08:00
committed by GitHub
5 changed files with 32 additions and 12 deletions
+8 -2
View File
@@ -42,10 +42,16 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRepresentation* inst) {
// @todo // @todo
// if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) { // if (s.ShapeType() == TopAbs_COMPOUND && TopoDS_Iterator(s).More() && TopoDS_Iterator(s).Value().ShapeType() == TopAbs_SOLID) {
return filter_in_place(items, [&use_body](taxonomy::ptr i) { auto filtered = filter_in_place(items, [&use_body](taxonomy::ptr i) {
// @todo just filter loops for now. // @todo just filter loops for now.
return (i->kind() != taxonomy::LOOP) == use_body; return (i->kind() != taxonomy::LOOP && i->kind() != taxonomy::PIECEWISE_FUNCTION) == use_body;
}); });
if (filtered->children.empty()) {
return nullptr;
}
return filtered;
} }
/* /*
+5 -7
View File
@@ -236,14 +236,12 @@ void mapping::get_representations(std::vector<geometry_conversion_task>& tasks,
} }
// @todo, fix this properly by considering the mapped geometry types in the representation. // @todo, fix this properly by considering the mapped geometry types in the representation.
if (representation->RepresentationIdentifier() && *representation->RepresentationIdentifier() == "Body") { geometry_conversion_task task;
geometry_conversion_task task; task.index = task_index++;
task.index = task_index++; task.representation = representation;
task.representation = representation; task.products = ifcproducts->generalize();
task.products = ifcproducts->generalize();
tasks.emplace_back(task); tasks.emplace_back(task);
}
} }
} }
+8
View File
@@ -1,3 +1,4 @@
#include "../ifcparse/IfcLogger.h"
#include "taxonomy.h" #include "taxonomy.h"
#include "profile_helper.h" #include "profile_helper.h"
@@ -478,6 +479,13 @@ ifcopenshell::geometry::taxonomy::item::ptr ifcopenshell::geometry::taxonomy::pi
polygon.push_back(taxonomy::make<taxonomy::point3>(m.col(3)(0), m.col(3)(1), m.col(3)(2))); polygon.push_back(taxonomy::make<taxonomy::point3>(m.col(3)(0), m.col(3)(1), m.col(3)(2)));
} }
// @nb temporary debugging - can be removed later.
std::ostringstream oss;
for (auto it = polygon.begin(); it != polygon.end() && std::distance(polygon.begin(), it) < 5; ++it) {
(**it).print(oss);
}
Logger::Notice("Evaluated points: " + oss.str(), instance);
return polygon_from_points(polygon); return polygon_from_points(polygon);
} }
+5 -2
View File
@@ -83,6 +83,9 @@
void set_(const std::string& name, int val) { void set_(const std::string& name, int val) {
return $self->set(name, val); return $self->set(name, val);
} }
void set_(const std::string& name, ifcopenshell::geometry::settings::IteratorOutputOptions val) {
return $self->set(name, val);
}
void set_(const std::string& name, double val) { void set_(const std::string& name, double val) {
return $self->set(name, val); return $self->set(name, val);
} }
@@ -92,7 +95,7 @@
void set_(const std::string& name, const std::set<int>& val) { void set_(const std::string& name, const std::set<int>& val) {
return $self->set(name, val); return $self->set(name, val);
} }
boost::variant<bool, int, double, std::string, std::set<int>> get_(const std::string& name) { ifcopenshell::geometry::Settings::value_variant_t get_(const std::string& name) {
return $self->get(name); return $self->get(name);
} }
std::vector<std::string> setting_names() { std::vector<std::string> setting_names() {
@@ -116,7 +119,7 @@
void set_(const std::string& name, const std::set<int>& val) { void set_(const std::string& name, const std::set<int>& val) {
return $self->set(name, val); return $self->set(name, val);
} }
boost::variant<bool, int, double, std::string, std::set<int>> get_(const std::string& name) { ifcopenshell::geometry::SerializerSettings::value_variant_t get_(const std::string& name) {
return $self->get(name); return $self->get(name);
} }
std::vector<std::string> setting_names() { std::vector<std::string> setting_names() {
+6 -1
View File
@@ -148,7 +148,12 @@ CREATE_VECTOR_TYPEMAP_OUT(IfcParse::entity const *)
CREATE_VECTOR_TYPEMAP_OUT(IfcParse::declaration const *) CREATE_VECTOR_TYPEMAP_OUT(IfcParse::declaration const *)
CREATE_VECTOR_TYPEMAP_OUT(IfcGeom::ConversionResultShape *) CREATE_VECTOR_TYPEMAP_OUT(IfcGeom::ConversionResultShape *)
%typemap(out) boost::variant<bool, int, double, std::string, std::set<int>> { %typemap(out) ifcopenshell::geometry::Settings::value_variant_t {
pythonizing_visitor vis;
$result = $1.apply_visitor(vis);
}
%typemap(out) ifcopenshell::geometry::SerializerSettings::value_variant_t {
pythonizing_visitor vis; pythonizing_visitor vis;
$result = $1.apply_visitor(vis); $result = $1.apply_visitor(vis);
} }