mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
After-merge clean-ups
This commit is contained in:
@@ -68,7 +68,7 @@ IfcGeom::ConversionResultShape* ifcopenshell::geometry::OpenCascadeShape::clone(
|
||||
return new OpenCascadeShape(shape_);
|
||||
}
|
||||
|
||||
void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id, Logger& logger) const {
|
||||
void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id, ::logger& logger) const {
|
||||
|
||||
// @todo remove duplication with OpenCascadeKernel::convert(const taxonomy::matrix4::ptr matrix, gp_GTrsf& trsf);
|
||||
// above can be static?
|
||||
@@ -108,7 +108,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr
|
||||
try {
|
||||
BRepMesh_IncrementalMesh(shape_, settings.get<settings::MesherLinearDeflection>().get(), false, settings.get<settings::MesherAngularDeflection>().get());
|
||||
} catch (...) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 183, "Failed to triangulate shape");
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 183, "Failed to triangulate shape");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr
|
||||
opencascade::handle<Poly_Triangulation> tri = BRep_Tool::Triangulation(face, loc);
|
||||
|
||||
if (tri.IsNull()) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 184, "Triangulation missing for face");
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 184, "Triangulation missing for face");
|
||||
} else {
|
||||
// Keep track of the number of times an edge is used
|
||||
// Manifold edges (i.e. edges used twice) are deemed invisible
|
||||
@@ -195,7 +195,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr
|
||||
else triangles(i).Get(n1, n2, n3);
|
||||
|
||||
if (dict[n1] == dict[n2] || dict[n2] == dict[n3] || dict[n3] == dict[n1]) {
|
||||
logger.Warning("GEO", 185, "Mesher generated a degenerate triangle, ignoring");
|
||||
logger.warning("GEO", 185, "Mesher generated a degenerate triangle, ignoring");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ namespace {
|
||||
try {
|
||||
BRepMesh_IncrementalMesh(s, tol);
|
||||
} catch (...) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 186, "Failed to triangulate shape");
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 186, "Failed to triangulate shape");
|
||||
return;
|
||||
}
|
||||
meshed = true;
|
||||
|
||||
@@ -42,18 +42,14 @@ namespace ifcopenshell {
|
||||
|
||||
class IFC_GEOMLIBRARY_API OpenCascadeShape : public IfcGeom::ConversionResultShape {
|
||||
public:
|
||||
std::string type() const override { return "OpenCascadeShape"; }
|
||||
|
||||
OpenCascadeShape(const TopoDS_Shape& shape)
|
||||
: shape_(shape) {}
|
||||
OpenCascadeShape(TopoDS_Shape&& shape)
|
||||
: shape_(std::move(shape)) {}
|
||||
OpenCascadeShape(const TopoDS_Shape& shape);
|
||||
OpenCascadeShape(TopoDS_Shape&& shape);
|
||||
|
||||
const TopoDS_Shape& shape() const;
|
||||
operator const TopoDS_Shape& ();
|
||||
virtual std::string_view backend_id() const;
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id, Logger& logger = Logger::Root()) const;
|
||||
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id, ::logger& logger = ::logger::root()) const;
|
||||
virtual void Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual IfcGeom::ConversionResultShape* clone() const;
|
||||
|
||||
@@ -120,7 +120,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
|
||||
auto it3_shape = std::static_pointer_cast<OpenCascadeShape>(it3->Shape())->shape();
|
||||
if (it3_shape.IsNull()) {
|
||||
logger_.Error("GEO", 187, "Null operand");
|
||||
logger_.error("GEO", 187, "Null operand");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
IfcGeom::util::create_solid_from_faces(list, entity_part, settings_.get<settings::Precision>().get(), true);
|
||||
is_manifold = util::is_manifold(entity_part);
|
||||
if (is_manifold) {
|
||||
logger_.Warning("GEO", 188, "Successfully sewed non-manifold first operand");
|
||||
logger_.warning("GEO", 188, "Successfully sewed non-manifold first operand");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,17 +163,17 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
failure = "Empty result (no faces) for BOPAlgo_MakerVolume; original was " + std::to_string(IfcGeom::util::count(entity_part, TopAbs_FACE));
|
||||
} else {
|
||||
is_manifold = util::is_manifold(entity_part_2);
|
||||
logger_.Warning("GEO", 189, std::string("Sucessfully detected exterior volume to non-manifold first operand; shape is now ") + (is_manifold ? std::string("manifold") : std::string("non-manifold")));
|
||||
logger_.warning("GEO", 189, std::string("Sucessfully detected exterior volume to non-manifold first operand; shape is now ") + (is_manifold ? std::string("manifold") : std::string("non-manifold")));
|
||||
entity_part = entity_part_2;
|
||||
}
|
||||
} catch (const Standard_Failure& e) {
|
||||
failure.emplace(e.GetMessageString());
|
||||
}
|
||||
if (failure) {
|
||||
logger_.Warning("GEO", 190, "MakeVolume failed: " + *failure, entity);
|
||||
logger_.warning("GEO", 190, "MakeVolume failed: " + *failure, entity);
|
||||
}
|
||||
} else {
|
||||
logger_.Warning("GEO", 191, "Non-manifold first operand, use --make-volume to try and make manifold");
|
||||
logger_.warning("GEO", 191, "Non-manifold first operand, use --make-volume to try and make manifold");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
const auto& m = it3->Placement()->ccomponents();
|
||||
// @todo
|
||||
// if (entity_shape_gtrsf.Form() == gp_Other) {
|
||||
// logger::message(logger::LOG_WARNING, "Applying non uniform transformation to:", entity);
|
||||
// ::logger::root().message(::logger::LOG_WARNING, "Applying non uniform transformation to:", entity);
|
||||
// }
|
||||
gp_Trsf entity_shape_gtrsf;
|
||||
entity_shape_gtrsf.SetValues(
|
||||
@@ -216,7 +216,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
if (util::boolean_operation(bst, result, opening_list, BOPAlgo_CUT, intermediate_result)) {
|
||||
result = intermediate_result;
|
||||
} else {
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 192, "Opening subtraction failed for " + boost::lexical_cast<std::string>(std::distance(jt, it)) + " openings", entity);
|
||||
logger_.message(::logger::LOG_ERROR, "GEO", 192, "Opening subtraction failed for " + boost::lexical_cast<std::string>(std::distance(jt, it)) + " openings", entity);
|
||||
}
|
||||
|
||||
jt = it;
|
||||
@@ -237,7 +237,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const express::Base& entity, c
|
||||
// where we keep the first operand as is (a compound of faces probably,
|
||||
// unless --orient-shells was activated in which case we're already lost).
|
||||
if (!is_manifold) {
|
||||
logger_.Warning("GEO", 193, "Retrying boolean operation on individual faces");
|
||||
logger_.warning("GEO", 193, "Retrying boolean operation on individual faces");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// }
|
||||
//
|
||||
// if (!success) {
|
||||
// logger::error("Failed processing layerset");
|
||||
// ::logger::root().error("Failed processing layerset");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -444,7 +444,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// }
|
||||
// }
|
||||
// if (some_items_without_style) {
|
||||
// logger::warning("No material and surface styles for:", product);
|
||||
// ::logger::root().warning("No material and surface styles for:", product);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@@ -471,7 +471,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// parent_id = parent_object->data().id();
|
||||
// }
|
||||
// } catch (const std::exception& e) {
|
||||
// logger::error(e);
|
||||
// ::logger::root().error(e);
|
||||
// }
|
||||
//
|
||||
// const std::string name = product->Name().value_or("");
|
||||
@@ -483,9 +483,9 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// convert(product->ObjectPlacement(), trsf);
|
||||
// }
|
||||
// } catch (const std::exception& e) {
|
||||
// logger::error(e);
|
||||
// ::logger::root().error(e);
|
||||
// } catch (...) {
|
||||
// logger::error("Failed to construct placement");
|
||||
// ::logger::root().error("Failed to construct placement");
|
||||
// }
|
||||
//
|
||||
// // Does the IfcElement have any IfcOpenings?
|
||||
@@ -506,10 +506,10 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// try {
|
||||
// convert_openings(product, openings, shapes, trsf, opened_shapes);
|
||||
// } catch (const std::exception& e) {
|
||||
// logger::message(logger::LOG_ERROR, std::string("error processing openings for: ") + e.what() + ":", product);
|
||||
// ::logger::root().message(::logger::LOG_ERROR, std::string("error processing openings for: ") + e.what() + ":", product);
|
||||
// caught_error = true;
|
||||
// } catch (...) {
|
||||
// logger::message(logger::LOG_ERROR, "error processing openings for:", product);
|
||||
// ::logger::root().message(::logger::LOG_ERROR, "error processing openings for:", product);
|
||||
// }
|
||||
//
|
||||
// if (caught_error && opened_shapes.size() < shapes.size()) {
|
||||
@@ -574,12 +574,12 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// if (elem->geometry().calculate_surface_area(a_calc)) {
|
||||
// double diff = std::abs(a_calc - a_file);
|
||||
// if (diff / std::sqrt(a_file) > getValue(GV_PRECISION)) {
|
||||
// logger::error("Validation of surface area failed for:", product);
|
||||
// ::logger::root().error("Validation of surface area failed for:", product);
|
||||
// } else {
|
||||
// logger::notice("Validation of surface area succeeded for:", product);
|
||||
// ::logger::root().notice("Validation of surface area succeeded for:", product);
|
||||
// }
|
||||
// } else {
|
||||
// logger::error("Validation of surface area failed for:", product);
|
||||
// ::logger::root().error("Validation of surface area failed for:", product);
|
||||
// }
|
||||
// } else if (q->as<IfcSchema::IfcQuantityVolume>() && q->Name() == "Volume") {
|
||||
// double v_calc;
|
||||
@@ -587,12 +587,12 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// if (elem->geometry().calculate_volume(v_calc)) {
|
||||
// double diff = std::abs(v_calc - v_file);
|
||||
// if (diff / std::sqrt(v_file) > getValue(GV_PRECISION)) {
|
||||
// logger::error("Validation of volume failed for:", product);
|
||||
// ::logger::root().error("Validation of volume failed for:", product);
|
||||
// } else {
|
||||
// logger::notice("Validation of volume succeeded for:", product);
|
||||
// ::logger::root().notice("Validation of volume succeeded for:", product);
|
||||
// }
|
||||
// } else {
|
||||
// logger::error("Validation of volume failed for:", product);
|
||||
// ::logger::root().error("Validation of volume failed for:", product);
|
||||
// }
|
||||
// } else if (q->as<IfcSchema::IfcPhysicalComplexQuantity>() && q->Name() == "Shape Validation Properties") {
|
||||
// auto qs2 = q->as<IfcSchema::IfcPhysicalComplexQuantity>()->HasQuantities();
|
||||
@@ -611,9 +611,9 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// }
|
||||
// }
|
||||
// if (!all_succeeded) {
|
||||
// logger::error("Validation of surface genus failed for:", product);
|
||||
// ::logger::root().error("Validation of surface genus failed for:", product);
|
||||
// } else {
|
||||
// logger::notice("Validation of surface genus succeeded for:", product);
|
||||
// ::logger::root().notice("Validation of surface genus succeeded for:", product);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -645,7 +645,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// }
|
||||
// }
|
||||
// } catch (const ifcopenshell::exception& e) {
|
||||
// logger::error(e);
|
||||
// ::logger::root().error(e);
|
||||
// // @todo reset representation_mapped_to to zero?
|
||||
// }
|
||||
// return representation_mapped_to;
|
||||
@@ -669,15 +669,15 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// IfcSchema::IfcRepresentationMap::list::ptr maps = representation->RepresentationMap();
|
||||
//
|
||||
// if (products->size() && maps->size()) {
|
||||
// logger::warning("Representation used by IfcRepresentationMap and IfcProductDefinitionShape", representation);
|
||||
// ::logger::root().warning("Representation used by IfcRepresentationMap and IfcProductDefinitionShape", representation);
|
||||
// }
|
||||
//
|
||||
// if (prodreps->size() > 1) {
|
||||
// logger::warning("Multiple IfcProductDefinitionShapes for representation", representation);
|
||||
// ::logger::root().warning("Multiple IfcProductDefinitionShapes for representation", representation);
|
||||
// }
|
||||
//
|
||||
// if (maps->size() > 1) {
|
||||
// logger::warning("Multiple IfcRepresentationMaps for representation", representation);
|
||||
// ::logger::root().warning("Multiple IfcRepresentationMaps for representation", representation);
|
||||
// }
|
||||
//
|
||||
// if (maps->size() == 1) {
|
||||
@@ -720,7 +720,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// parent_id = parent_object->data().id();
|
||||
// }
|
||||
// } catch (const std::exception& e) {
|
||||
// logger::error(e);
|
||||
// ::logger::root().error(e);
|
||||
// }
|
||||
//
|
||||
// const std::string name = product->Name().value_or("");
|
||||
@@ -732,9 +732,9 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// convert(product->ObjectPlacement(), trsf);
|
||||
// }
|
||||
// } catch (const std::exception& e) {
|
||||
// logger::error(e);
|
||||
// ::logger::root().error(e);
|
||||
// } catch (...) {
|
||||
// logger::error("Failed to construct placement");
|
||||
// ::logger::root().error("Failed to construct placement");
|
||||
// }
|
||||
//
|
||||
// std::string context_string = "";
|
||||
@@ -936,7 +936,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// // range. It's only a safeguard though, so can probably be approximated.
|
||||
// const double axis_length = own_axis_start.Distance(own_axis_end);
|
||||
// if (length_required > axis_length) {
|
||||
// logger::warning("The wall axis is not long enough to accommodate the fold points");
|
||||
// ::logger::root().warning("The wall axis is not long enough to accommodate the fold points");
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
@@ -956,7 +956,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// gp_Trsf other;
|
||||
// if (other_wall->ObjectPlacement()) {
|
||||
// if (!convert(other_wall->ObjectPlacement(), other)) {
|
||||
// logger::error("Failed to convert placement", other_wall);
|
||||
// ::logger::root().error("Failed to convert placement", other_wall);
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
@@ -964,7 +964,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// IfcSchema::IfcRepresentation* axis_representation = find_representation(other_wall, "Axis");
|
||||
//
|
||||
// if (!axis_representation) {
|
||||
// logger::warning("Joined wall has no axis representation", other_wall);
|
||||
// ::logger::root().warning("Joined wall has no axis representation", other_wall);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
@@ -1058,7 +1058,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// Vs1.Cross(Vs2);
|
||||
//
|
||||
// if (Vs1.IsNormal(Vc, 1.e-5)) {
|
||||
// logger::warning("Connected walls are parallel");
|
||||
// ::logger::root().warning("Connected walls are parallel");
|
||||
// parallel = true;
|
||||
// } else if (w < axis_u1 || w > axis_u2) {
|
||||
// point_outside_param_range = p;
|
||||
@@ -1287,7 +1287,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
//
|
||||
// #define Kernel POSTFIX_SCHEMA(Kernel)
|
||||
//
|
||||
// std::shared_ptr<const IfcGeom::SurfaceStyle> IfcGeom::Kernel::internalize_surface_style(const std::pair<ifcopenshell::IfcBaseClass*, ifcopenshell::IfcBaseClass*>& shading_styles) {
|
||||
// std::shared_ptr<const IfcGeom::SurfaceStyle> IfcGeom::Kernel::internalize_surface_style(const std::pair<express::Base, express::Base>& shading_styles) {
|
||||
// if (shading_styles.second == 0) {
|
||||
// return 0;
|
||||
// }
|
||||
@@ -1393,7 +1393,7 @@ bool IfcGeom::OpenCascadeKernel::convert_impl(const taxonomy::revolve::ptr r, If
|
||||
// Handle_Geom_Circle axis_line = Handle_Geom_Circle::DownCast(axis_curve);
|
||||
// reference_surface = new Geom_CylindricalSurface(axis_li->Position(), axis_line->Radius());
|
||||
// } else {
|
||||
// logger::message(logger::LOG_ERROR, "Unsupported underlying curve of Axis representation:", product);
|
||||
// ::logger::root().message(::logger::LOG_ERROR, "Unsupported underlying curve of Axis representation:", product);
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
|
||||
@@ -110,13 +110,13 @@ private:
|
||||
|
||||
double precision_;
|
||||
public:
|
||||
OpenCascadeKernel(const ifcopenshell::geometry::Settings& settings, Logger& logger = Logger::Root())
|
||||
OpenCascadeKernel(const ifcopenshell::geometry::Settings& settings, ::logger& logger = ::logger::root())
|
||||
: AbstractKernel("opencascade", settings, logger)
|
||||
, faceset_helper_(nullptr)
|
||||
, precision_(settings.get<ifcopenshell::geometry::settings::Precision>().get())
|
||||
{}
|
||||
|
||||
virtual AbstractKernel* clone(Logger& logger) const {
|
||||
virtual AbstractKernel* clone(::logger& logger) const {
|
||||
return new OpenCascadeKernel(settings(), logger);
|
||||
}
|
||||
|
||||
|
||||
@@ -714,12 +714,12 @@ bool IfcGeom::util::create_solid_from_faces(const NCollection_List<TopoDS_Shape>
|
||||
valid_shell &= util::count(shape, TopAbs_SHELL) > 0;
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 106, e.GetMessageString());
|
||||
::logger::root().error("GEO", 106, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 107, "Unknown error sewing shell");
|
||||
::logger::root().error("GEO", 107, "Unknown error sewing shell");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 108, "Unknown error sewing shell");
|
||||
::logger::root().error("GEO", 108, "Unknown error sewing shell");
|
||||
}
|
||||
|
||||
if (valid_shell) {
|
||||
@@ -747,22 +747,22 @@ bool IfcGeom::util::create_solid_from_faces(const NCollection_List<TopoDS_Shape>
|
||||
}
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 109, e.GetMessageString());
|
||||
::logger::root().error("GEO", 109, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 110, "Unknown error classifying solid");
|
||||
::logger::root().error("GEO", 110, "Unknown error classifying solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 111, "Unknown error classifying solid");
|
||||
::logger::root().error("GEO", 111, "Unknown error classifying solid");
|
||||
}
|
||||
}
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 112, e.GetMessageString());
|
||||
::logger::root().error("GEO", 112, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 113, "Unknown error creating solid");
|
||||
::logger::root().error("GEO", 113, "Unknown error creating solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 114, "Unknown error creating solid");
|
||||
::logger::root().error("GEO", 114, "Unknown error creating solid");
|
||||
}
|
||||
|
||||
if (complete_shape.IsNull()) {
|
||||
@@ -774,7 +774,7 @@ bool IfcGeom::util::create_solid_from_faces(const NCollection_List<TopoDS_Shape>
|
||||
B.MakeCompound(C);
|
||||
B.Add(C, complete_shape);
|
||||
complete_shape = C;
|
||||
Logger::Root().Warning("GEO", 115, "Multiple components in IfcConnectedFaceSet");
|
||||
::logger::root().warning("GEO", 115, "Multiple components in IfcConnectedFaceSet");
|
||||
}
|
||||
B.Add(complete_shape, result_shape);
|
||||
}
|
||||
@@ -789,7 +789,7 @@ bool IfcGeom::util::create_solid_from_faces(const NCollection_List<TopoDS_Shape>
|
||||
B.MakeCompound(C);
|
||||
B.Add(C, complete_shape);
|
||||
complete_shape = C;
|
||||
Logger::Root().Warning("GEO", 116, "Loose faces in IfcConnectedFaceSet");
|
||||
::logger::root().warning("GEO", 116, "Loose faces in IfcConnectedFaceSet");
|
||||
}
|
||||
B.Add(complete_shape, loose_faces.Current());
|
||||
}
|
||||
@@ -797,7 +797,7 @@ bool IfcGeom::util::create_solid_from_faces(const NCollection_List<TopoDS_Shape>
|
||||
shape = complete_shape;
|
||||
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 117, "Failed to sew faceset");
|
||||
::logger::root().error("GEO", 117, "Failed to sew faceset");
|
||||
}
|
||||
|
||||
return valid_shell;
|
||||
@@ -901,7 +901,7 @@ bool IfcGeom::util::validate_shape(const TopoDS_Shape& s) {
|
||||
|
||||
dump(s);
|
||||
|
||||
Logger::Root().Warning("GEO", 118, str.str());
|
||||
::logger::root().warning("GEO", 118, str.str());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,14 +118,14 @@ bool OpenCascadeKernel::convert_impl(const taxonomy::boolean_result::ptr br, Con
|
||||
|
||||
const double first_operand_volume = util::shape_volume(a);
|
||||
if (first_operand_volume <= ALMOST_ZERO) {
|
||||
Logger::Root().Message(Logger::LOG_WARNING, "GEO", 119, "Empty solid for:", c->instance);
|
||||
::logger::root().message(::logger::LOG_WARNING, "GEO", 119, "Empty solid for:", c->instance);
|
||||
}
|
||||
} else {
|
||||
|
||||
for (auto& r : cr) {
|
||||
auto S = std::static_pointer_cast<OpenCascadeShape>(r.Shape())->shape();
|
||||
if (S.IsNull()) {
|
||||
Logger::Root().Error("GEO", 120, "Null operand");
|
||||
::logger::root().error("GEO", 120, "Null operand");
|
||||
continue;
|
||||
}
|
||||
gp_GTrsf trsf;
|
||||
@@ -140,7 +140,7 @@ bool OpenCascadeKernel::convert_impl(const taxonomy::boolean_result::ptr br, Con
|
||||
// #2665 we also set a precision-independent threshold, because in the boolean op routine
|
||||
// the working fuzziness might still be increased.
|
||||
if (d < tol * 20. || d < 0.00002) {
|
||||
Logger::Root().Message(Logger::LOG_WARNING, "GEO", 121, "Halfspace subtraction yields unchanged volume:", c->instance);
|
||||
::logger::root().message(::logger::LOG_WARNING, "GEO", 121, "Halfspace subtraction yields unchanged volume:", c->instance);
|
||||
continue;
|
||||
} else {
|
||||
S = result;
|
||||
|
||||
@@ -418,7 +418,7 @@ int IfcGeom::util::eliminate_narrow_operands(double prec, const NCollection_List
|
||||
|
||||
bool is_narrow = min_dimension < prec;
|
||||
|
||||
Logger::Root().Notice("GEO", 122, "Min OBB dimension of operand = " + std::to_string(min_dimension));
|
||||
::logger::root().notice("GEO", 122, "Min OBB dimension of operand = " + std::to_string(min_dimension));
|
||||
|
||||
if (!is_narrow) {
|
||||
c.Append(it.Value());
|
||||
@@ -703,7 +703,7 @@ bool IfcGeom::util::boolean_subtraction_2d_using_builder(const TopoDS_Shape & a_
|
||||
if (u11 < U1 && U1 < u12 && u21 < U2 && U2 < u22) {
|
||||
// Edge curves belonging to different operands intersect, don't process
|
||||
// using builder.
|
||||
Logger::Root().Notice("GEO", 123, "Intersecting boundaries");
|
||||
::logger::root().notice("GEO", 123, "Intersecting boundaries");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -750,7 +750,7 @@ bool IfcGeom::util::boolean_subtraction_2d_using_builder(const TopoDS_Shape & a_
|
||||
// any effect and marked as redundant. Feeding it to the builder algo
|
||||
// will likely cause problems.
|
||||
redundant[std::distance(wires.begin(), it)] = true;
|
||||
Logger::Root().Notice("GEO", 124, "Subtraction operand outside of outer bound");
|
||||
::logger::root().notice("GEO", 124, "Subtraction operand outside of outer bound");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,7 +790,7 @@ bool IfcGeom::util::boolean_subtraction_2d_using_builder(const TopoDS_Shape & a_
|
||||
if (wire_clss[wire_index]->Perform(p2d) == TopAbs_IN) {
|
||||
// A wire is contained within another operand
|
||||
redundant[other_index] = true;
|
||||
Logger::Root().Notice("GEO", 125, "Subtraction operand contained in other");
|
||||
::logger::root().notice("GEO", 125, "Subtraction operand contained in other");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -848,7 +848,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
std::stringstream ss;
|
||||
ss << "bool-" << std::this_thread::get_id() << "-" << (operation_counter_++);
|
||||
debug_identifier = ss.str();
|
||||
Logger::Root().Notice("GEO", 126, "Boolean debug identifier: " + debug_identifier);
|
||||
::logger::root().notice("GEO", 126, "Boolean debug identifier: " + debug_identifier);
|
||||
}
|
||||
|
||||
if (fuzziness < 0.) {
|
||||
@@ -884,8 +884,8 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
a = unify(a_input, fuzziness * 1000.);
|
||||
|
||||
Logger::Root().Message(
|
||||
Logger::LOG_DEBUG, "GEO", 127,
|
||||
::logger::root().message(
|
||||
::logger::LOG_DEBUG, "GEO", 127,
|
||||
"Simplified operand A from "s +
|
||||
std::to_string(count(a_input, TopAbs_FACE)) +
|
||||
" to "s +
|
||||
@@ -896,8 +896,8 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
NCollection_List<TopoDS_Shape>::Iterator it(b_input);
|
||||
for (; it.More(); it.Next()) {
|
||||
b.Append(unify(it.Value(), fuzziness));
|
||||
Logger::Root().Message(
|
||||
Logger::LOG_DEBUG, "GEO", 128,
|
||||
::logger::root().message(
|
||||
::logger::LOG_DEBUG, "GEO", 128,
|
||||
"Simplified operand B from "s +
|
||||
std::to_string(count(it.Value(), TopAbs_FACE)) +
|
||||
" to "s +
|
||||
@@ -924,7 +924,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
auto N = bounding_box_overlap(fuzziness, a, b, b_tmp);
|
||||
if (N) {
|
||||
Logger::Root().Notice("GEO", 129, "Eliminated " + std::to_string(N) + " disjoint operands");
|
||||
::logger::root().notice("GEO", 129, "Eliminated " + std::to_string(N) + " disjoint operands");
|
||||
std::swap(b, b_tmp);
|
||||
}
|
||||
}
|
||||
@@ -935,7 +935,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
b_tmp.Clear();
|
||||
auto N = eliminate_touching_operands(fuzziness, a, b, b_tmp);
|
||||
if (N) {
|
||||
Logger::Root().Notice("GEO", 130, "Eliminated " + std::to_string(N) + " touching operands");
|
||||
::logger::root().notice("GEO", 130, "Eliminated " + std::to_string(N) + " touching operands");
|
||||
std::swap(b, b_tmp);
|
||||
}
|
||||
}
|
||||
@@ -946,7 +946,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
b_tmp.Clear();
|
||||
auto N = eliminate_narrow_operands(fuzziness, b, b_tmp);
|
||||
if (N) {
|
||||
Logger::Root().Notice("GEO", 131, "Eliminated " + std::to_string(N) + " narrow operands");
|
||||
::logger::root().notice("GEO", 131, "Eliminated " + std::to_string(N) + " narrow operands");
|
||||
std::swap(b, b_tmp);
|
||||
}
|
||||
}
|
||||
@@ -960,21 +960,21 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (b.Extent() == 0) {
|
||||
Logger::Root().Warning("GEO", 132, "No other operands remaining, using first operand");
|
||||
::logger::root().warning("GEO", 132, "No other operands remaining, using first operand");
|
||||
result = a;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!is_2d && Logger::LOG_NOTICE >= Logger::Root().Verbosity()) {
|
||||
if (!is_2d && ::logger::LOG_NOTICE >= ::logger::root().verbosity()) {
|
||||
PERF("preliminary manifoldness check");
|
||||
|
||||
if (!a.IsNull()) {
|
||||
Logger::Root().Notice("GEO", 133, "Operand A is " + (is_manifold(a) ? ""s : "non-"s) + "manifold");
|
||||
::logger::root().notice("GEO", 133, "Operand A is " + (is_manifold(a) ? ""s : "non-"s) + "manifold");
|
||||
}
|
||||
|
||||
NCollection_List<TopoDS_Shape>::Iterator it(b);
|
||||
for (int i = 0; it.More(); it.Next(), ++i) {
|
||||
Logger::Root().Notice("GEO", 134, "Operand B " + std::to_string(i) + " is " + (is_manifold(it.Value()) ? ""s : "non-"s) + "manifold");
|
||||
::logger::root().notice("GEO", 134, "Operand B " + std::to_string(i) + " is " + (is_manifold(it.Value()) ? ""s : "non-"s) + "manifold");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,7 +1014,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
const double fuzz = (std::min)(min_length_orig / 3., fuzziness);
|
||||
|
||||
Logger::Root().Notice("GEO", 135, "Used fuzziness: " + std::to_string(fuzz));
|
||||
::logger::root().notice("GEO", 135, "Used fuzziness: " + std::to_string(fuzz));
|
||||
|
||||
const double new_fuzziness = fuzziness * 10.;
|
||||
const bool allow_retry = new_fuzziness - 1e-15 <= settings.precision * 10000. && new_fuzziness < min_length_orig;
|
||||
@@ -1048,7 +1048,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (is_extrusion_a) {
|
||||
Logger::Root().Notice("GEO", 136, "Operand A 1/1 is an extrusion");
|
||||
::logger::root().notice("GEO", 136, "Operand A 1/1 is an extrusion");
|
||||
|
||||
NCollection_List<TopoDS_Shape>::Iterator it(b);
|
||||
for (int nb = 1; it.More(); it.Next(), ++nb) {
|
||||
@@ -1064,10 +1064,10 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (is_extrusion_b) {
|
||||
Logger::Root().Notice("GEO", 137, "Operand B " + std::to_string(nb) + "/" + std::to_string(b.Extent()) + " is an extrusion");
|
||||
::logger::root().notice("GEO", 137, "Operand B " + std::to_string(nb) + "/" + std::to_string(b.Extent()) + " is an extrusion");
|
||||
|
||||
if (b_interval.first < a_interval.first + (fuzz * 100.) && b_interval.second > a_interval.second - (fuzz * 100.)) {
|
||||
Logger::Root().Notice("GEO", 138, "Operand B creates a through hole");
|
||||
::logger::root().notice("GEO", 138, "Operand B creates a through hole");
|
||||
|
||||
// Align b with a operand
|
||||
gp_Trsf trsf;
|
||||
@@ -1107,23 +1107,23 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
BRepPrimAPI_MakePrism mp(face_result, gp_Vec(gp::DY()) * (a_interval.second - a_interval.first));
|
||||
if (mp.IsDone()) {
|
||||
if (b_remainder_3d.Extent()) {
|
||||
Logger::Root().Notice("GEO", 139, std::to_string(b_remainder_3d.Extent()) + " operands remaining to process in 3D");
|
||||
::logger::root().notice("GEO", 139, std::to_string(b_remainder_3d.Extent()) + " operands remaining to process in 3D");
|
||||
b = b_remainder_3d;
|
||||
s1s.Clear();
|
||||
s1s.Append(mp.Shape());
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 140, "Processed fully in 2D");
|
||||
::logger::root().notice("GEO", 140, "Processed fully in 2D");
|
||||
result = mp.Shape();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 141, "Failed to extrude 2D boolean result. Retrying in 3D.");
|
||||
::logger::root().notice("GEO", 141, "Failed to extrude 2D boolean result. Retrying in 3D.");
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 142, "Failed to perform 2D boolean operation. Retrying in 3D.");
|
||||
::logger::root().notice("GEO", 142, "Failed to perform 2D boolean operation. Retrying in 3D.");
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 143, "No second operands can be processed as 2D inner bounds. Retrying in 3D.");
|
||||
::logger::root().notice("GEO", 143, "No second operands can be processed as 2D inner bounds. Retrying in 3D.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1145,7 +1145,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
if (builder->IsDone()) {
|
||||
if (false && builder->DSFiller()->HasWarning(STANDARD_TYPE(BOPAlgo_AlertAcquiredSelfIntersection))) {
|
||||
Logger::Root().Notice("GEO", 144, "Builder reports self-intersection in output");
|
||||
::logger::root().notice("GEO", 144, "Builder reports self-intersection in output");
|
||||
success = false;
|
||||
|
||||
/*
|
||||
@@ -1159,7 +1159,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
*/
|
||||
} else if(builder->DSFiller()->HasWarning(STANDARD_TYPE(BOPAlgo_AlertBadPositioning)) && !TopoDS_Iterator(*builder).More()) {
|
||||
Logger::Root().Notice("GEO", 145, "Builder reports bad positioning and result is empty");
|
||||
::logger::root().notice("GEO", 145, "Builder reports bad positioning and result is empty");
|
||||
success = false;
|
||||
} else {
|
||||
TopoDS_Shape r = *builder;
|
||||
@@ -1173,7 +1173,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
fix.Perform();
|
||||
r = fix.Shape();
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 146, "Shape healing failed on boolean result");
|
||||
::logger::root().error("GEO", 146, "Shape healing failed on boolean result");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1184,7 +1184,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
success = ana.IsValid() != 0;
|
||||
|
||||
if (!success) {
|
||||
Logger::Root().Notice("GEO", 147, "Boolean operation yields invalid result");
|
||||
::logger::root().notice("GEO", 147, "Boolean operation yields invalid result");
|
||||
|
||||
std::stringstream str;
|
||||
bool any_emitted = false;
|
||||
@@ -1214,7 +1214,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
dump(r);
|
||||
|
||||
Logger::Root().Notice("GEO", 148, str.str());
|
||||
::logger::root().notice("GEO", 148, str.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1334,7 +1334,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
if (op == BOPAlgo_CUT && has_open_shells && all_faces_included_in_result && result_n_faces > first_op_n_faces) {
|
||||
success = false;
|
||||
Logger::Root().Notice("GEO", 149, "Boolean result discarded because subtractions results in only the addition of faces");
|
||||
::logger::root().notice("GEO", 149, "Boolean result discarded because subtractions results in only the addition of faces");
|
||||
} else {
|
||||
// when there are edges or vertex-edge distances close to the used fuzziness, the
|
||||
// output is not trusted and the operation is attempted with a higher fuzziness.
|
||||
@@ -1380,7 +1380,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
static const char* const reason_strings[] = { "edge length", "vertex-edge", "face-face" };
|
||||
std::stringstream str;
|
||||
str << "Boolean operation result failing " << reason_strings[reason] << " interference check, with fuzziness " << fuzziness << " with length " << v;
|
||||
Logger::Root().Notice("GEO", 150, str.str());
|
||||
::logger::root().notice("GEO", 150, str.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1389,7 +1389,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 151, "Boolean operation yields non-manifold result");
|
||||
::logger::root().notice("GEO", 151, "Boolean operation yields non-manifold result");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1399,7 +1399,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
#if OCC_VERSION_HEX >= 0x70200
|
||||
|
||||
if (builder->HasError(STANDARD_TYPE(BOPAlgo_AlertBOPNotAllowed))) {
|
||||
Logger::Root().Error("GEO", 152, "Invalid operands. Using first operand");
|
||||
::logger::root().error("GEO", 152, "Invalid operands. Using first operand");
|
||||
result = a;
|
||||
success = true;
|
||||
}
|
||||
@@ -1412,14 +1412,14 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
#endif
|
||||
std::string str_str = str.str();
|
||||
if (str_str.size()) {
|
||||
Logger::Root().Notice("GEO", 153, str_str);
|
||||
::logger::root().notice("GEO", 153, str_str);
|
||||
}
|
||||
}
|
||||
if (!success) {
|
||||
if (allow_retry) {
|
||||
return boolean_operation(settings, a, b, op, result, new_fuzziness);
|
||||
} else {
|
||||
Logger::Root().Notice("GEO", 154, "No longer attempting boolean operation with higher fuzziness");
|
||||
::logger::root().notice("GEO", 154, "No longer attempting boolean operation with higher fuzziness");
|
||||
}
|
||||
}
|
||||
return success && !result.IsNull();
|
||||
|
||||
@@ -10,7 +10,7 @@ bool OpenCascadeKernel::convert(const taxonomy::extrusion::ptr extrusion, TopoDS
|
||||
const double& height = extrusion->depth;
|
||||
|
||||
if (height < settings_.get<settings::Precision>().get()) {
|
||||
Logger::Root().Error("GEO", 89, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
::logger::root().error("GEO", 89, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ bool OpenCascadeKernel::convert(const taxonomy::extrusion::ptr extrusion, TopoDS
|
||||
// move the TopoDS_Shape, but obviously not both.
|
||||
gp_GTrsf gtrsf;
|
||||
if (!convert(&extrusion->matrix, gtrsf)) {
|
||||
logger::error("Unable to move extrusion");
|
||||
::logger::root().error("Unable to move extrusion");
|
||||
}
|
||||
auto trsf = gtrsf.Trsf();
|
||||
*/
|
||||
|
||||
@@ -174,8 +174,8 @@ namespace {
|
||||
} else if (crv_or_wire.index() == 2) {
|
||||
// @todo
|
||||
const double precision_ = 1.e-5;
|
||||
Logger::Root().Warning("GEO", 156, "Approximating BasisCurve due to possible discontinuities", i->instance);
|
||||
const auto& w = boost::get<TopoDS_Wire>(crv_or_wire);
|
||||
::logger::root().warning("GEO", 156, "Approximating BasisCurve due to possible discontinuities", i->instance);
|
||||
const auto& w = std::get<TopoDS_Wire>(crv_or_wire);
|
||||
#if OCC_VERSION_HEX < 0x70600
|
||||
BRepAdaptor_CompCurve cc(w, true);
|
||||
Handle(Adaptor3d_HCurve) hcc = Handle(Adaptor3d_HCurve)(new BRepAdaptor_HCompCurve(cc));
|
||||
@@ -294,12 +294,12 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
// the face will still be processed as long as there are no holes. A compound of faces
|
||||
// is returned in that case.
|
||||
if (num_bounds > 1 && num_outer_bounds > 1 && num_bounds != num_outer_bounds) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 157, "Invalid configuration of boundaries for:", face->instance);
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 157, "Invalid configuration of boundaries for:", face->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (num_outer_bounds > 1) {
|
||||
Logger::Root().Message(Logger::LOG_WARNING, "GEO", 158, "Multiple outer boundaries for:", face->instance);
|
||||
::logger::root().message(::logger::LOG_WARNING, "GEO", 158, "Multiple outer boundaries for:", face->instance);
|
||||
fd.all_outer() = true;
|
||||
}
|
||||
|
||||
@@ -320,11 +320,11 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
TopoDS_Wire wire;
|
||||
if (faceset_helper_ && bound->is_polyhedron()) {
|
||||
if (!faceset_helper_->wire(bound, wire)) {
|
||||
Logger::Root().Message(Logger::LOG_WARNING, "GEO", 159, "Face boundary loop not included", bound->instance);
|
||||
::logger::root().message(::logger::LOG_WARNING, "GEO", 159, "Face boundary loop not included", bound->instance);
|
||||
continue;
|
||||
}
|
||||
} else if (!convert(bound, wire)) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 160, "Failed to process face boundary loop", bound->instance);
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 160, "Failed to process face boundary loop", bound->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
};
|
||||
NCollection_List<TopoDS_Shape> results;
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) {
|
||||
Logger::Root().Warning("GEO", 161, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
::logger::root().warning("GEO", 161, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
util::select_largest(results, wire);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
}
|
||||
|
||||
if (fd.wires().empty()) {
|
||||
Logger::Root().Warning("GEO", 162, "Face with no boundaries", face->instance);
|
||||
::logger::root().warning("GEO", 162, "Face with no boundaries", face->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
|
||||
if (fd.surface().IsNull()) {
|
||||
// The set of wires is triangulated in case no surface can be found
|
||||
Logger::Root().Message(Logger::LOG_WARNING, "GEO", 163, "Triangulating face boundaries for face", face->instance);
|
||||
::logger::root().message(::logger::LOG_WARNING, "GEO", 163, "Triangulating face boundaries for face", face->instance);
|
||||
|
||||
if (fd.all_outer()) {
|
||||
for (const auto& w : fd.wires()) {
|
||||
@@ -462,7 +462,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
kt.Value().Original().ToUTF8CString(c);
|
||||
std::string message = c;
|
||||
delete[] c;
|
||||
Logger::Root().Warning("GEO", 164, message, face->instance);
|
||||
::logger::root().warning("GEO", 164, message, face->instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,17 +474,17 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
if (it.Value().ShapeType() == TopAbs_FACE) {
|
||||
face_list.Append(it.Value());
|
||||
} else {
|
||||
Logger::Root().Error("UNS", 7, "Unsupported output from face healing");
|
||||
::logger::root().error("UNS", 7, "Unsupported output from face healing");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Error("UNS", 8, "Unsupported output from face healing");
|
||||
::logger::root().error("UNS", 8, "Unsupported output from face healing");
|
||||
}
|
||||
} else {
|
||||
face_list.Append(f);
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 165, "Internal error in face creation");
|
||||
::logger::root().error("GEO", 165, "Internal error in face creation");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@@ -525,14 +525,14 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
delete[] c;
|
||||
#if OCC_VERSION_MAJOR==7 && OCC_VERSION_MINOR >= 7
|
||||
if (!reversed_surface && !fd.surface().IsNull() && fd.surface()->IsUPeriodic() && message == "Unknown message invoked with the keyword FixAdvFace.FixOrientation.MSG0") {
|
||||
Logger::Root().Notice("GEO", 166, "Detected reversed wire, reattempting with reversed basis surface");
|
||||
::logger::root().notice("GEO", 166, "Detected reversed wire, reattempting with reversed basis surface");
|
||||
TopoDS_Face reversed_result;
|
||||
convert(face, reversed_result, true);
|
||||
result = reversed_result;
|
||||
return true;
|
||||
} else
|
||||
#endif
|
||||
Logger::Root().Warning("GEO", 167, message, face->instance);
|
||||
::logger::root().warning("GEO", 167, message, face->instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper(
|
||||
auto num_retained = std::count(retained.begin(), retained.end(), true);
|
||||
|
||||
if (unique.size() != num_retained) {
|
||||
Logger::Root().Notice("GEO", 168, "Collapsed vertices from " + std::to_string(pnts.size()) + " (" + std::to_string(unique.size()) + " unique) to " + std::to_string(num_retained));
|
||||
::logger::root().notice("GEO", 168, "Collapsed vertices from " + std::to_string(pnts.size()) + " (" + std::to_string(unique.size()) + " unique) to " + std::to_string(num_retained));
|
||||
}
|
||||
|
||||
typedef std::array<int, 2> edge_t;
|
||||
@@ -171,12 +171,13 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper(
|
||||
segments.push_back(std::make_pair(C, D));
|
||||
});
|
||||
|
||||
if (edge_sets.find({loop->external.get_value_or(false), segment_set}) != edge_sets.end()) {
|
||||
const auto edge_set_key = std::make_pair(loop->external.value_or(false), segment_set);
|
||||
if (edge_sets.find(edge_set_key) != edge_sets.end()) {
|
||||
duplicate_faces++;
|
||||
duplicates_.insert(loop->identity());
|
||||
continue;
|
||||
}
|
||||
edge_sets.insert({loop->external.get_value_or(false), segment_set});
|
||||
edge_sets.insert(edge_set_key);
|
||||
|
||||
if (segments.size() >= 3) {
|
||||
for (auto& p : segments) {
|
||||
@@ -204,8 +205,8 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper(
|
||||
}
|
||||
}
|
||||
|
||||
if (duplicates_.size() || loops_removed || (non_manifold && shell->closed.get_value_or(false))) {
|
||||
Logger::Root().Warning("GEO", 169, boost::lexical_cast<std::string>(duplicate_faces) + " duplicate faces removed, " + boost::lexical_cast<std::string>(loops_removed) + " degenerate loops eliminated and " + boost::lexical_cast<std::string>(non_manifold) + " non-manifold edges");
|
||||
if (duplicates_.size() || loops_removed || (non_manifold && shell->closed.value_or(false))) {
|
||||
::logger::root().warning("GEO", 169, boost::lexical_cast<std::string>(duplicate_faces) + " duplicate faces removed, " + boost::lexical_cast<std::string>(loops_removed) + " degenerate loops eliminated and " + boost::lexical_cast<std::string>(non_manifold) + " non-manifold edges");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +277,7 @@ bool IfcGeom::OpenCascadeKernel::faceset_helper::wires(const ifcopenshell::geome
|
||||
!kernel_->settings().get<ifcopenshell::geometry::settings::NoWireIntersectionTolerance>().get(), 0.,
|
||||
kernel_->settings().get<ifcopenshell::geometry::settings::Precision>().get()}))
|
||||
{
|
||||
Logger::Root().Warning("GEO", 170, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
::logger::root().warning("GEO", 170, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
non_manifold_ = true;
|
||||
wires = results;
|
||||
} else {
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
Logger::Root().Error("GEO", 171, "Unable to map layer geometry to material index");
|
||||
::logger::root().error("GEO", 171, "Unable to map layer geometry to material index");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ bool IfcGeom::util::apply_folded_layerset(const ConversionResults& items, const
|
||||
if (s.ShapeType() == TopAbs_SHELL) {
|
||||
shells.Append(TopoDS::Shell(s));
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 172, "Expected shell type in layerset processing");
|
||||
::logger::root().error("GEO", 172, "Expected shell type in layerset processing");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -436,12 +436,12 @@ bool IfcGeom::util::split_solid_by_shell(const TopoDS_Shape& input, const TopoDS
|
||||
}
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 173, e.GetMessageString());
|
||||
::logger::root().error("GEO", 173, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 174, "Unknown error performing fixes");
|
||||
::logger::root().error("GEO", 174, "Unknown error performing fixes");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 175, "Unknown error performing fixes");
|
||||
::logger::root().error("GEO", 175, "Unknown error performing fixes");
|
||||
}
|
||||
BRepCheck_Analyzer analyser(shape);
|
||||
bool is_valid = analyser.IsValid() != 0;
|
||||
@@ -451,7 +451,7 @@ bool IfcGeom::util::split_solid_by_shell(const TopoDS_Shape& input, const TopoDS
|
||||
}
|
||||
|
||||
if (is_null[0] || is_null[1]) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 176, "Null result obtained from layerset slicing");
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 176, "Null result obtained from layerset slicing");
|
||||
if (is_null[0] && is_null[1]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,12 +83,13 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
|
||||
if (non_polygonal) {
|
||||
if (loft->children.size() < 2) {
|
||||
Logger::Root().Error("GEO", 177, "Not enough sections to loft");
|
||||
::logger::root().error("GEO", 177, "Not enough sections to loft");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
TopoDS_Shape f0, f1;
|
||||
std::vector<std::vector<TopoDS_Wire>> sections;
|
||||
|
||||
// Convert all children to vectors of wires
|
||||
for (const auto& child : loft->children) {
|
||||
@@ -122,13 +123,19 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
auto first_wire_count = sections.front().size();
|
||||
for (auto& section : sections) {
|
||||
if (section.size() != first_wire_count) {
|
||||
Logger::Root().Error("GEO", 178, "Inconsistent number of wires in sections");
|
||||
return false;
|
||||
}
|
||||
if (f0.ShapeType() != TopAbs_FACE || f1.ShapeType() != TopAbs_FACE) {
|
||||
::logger::root().error("GEO", 178, "Inconsistent number of wires in sections");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (f0.ShapeType() != TopAbs_FACE || f1.ShapeType() != TopAbs_FACE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sections.size() == 2) {
|
||||
TopoDS_Shell comp;
|
||||
BRep_Builder BB;
|
||||
BB.MakeShell(comp);
|
||||
TopExp_Explorer exp1(f0, TopAbs_WIRE);
|
||||
TopExp_Explorer exp2(f1, TopAbs_WIRE);
|
||||
for (; exp1.More() && exp2.More(); exp1.Next(), exp2.Next()) {
|
||||
@@ -153,7 +160,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
|
||||
return true;
|
||||
} else {
|
||||
logger::error("Lofting more than two sections is not supported");
|
||||
::logger::root().error("Lofting more than two sections is not supported");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -269,7 +276,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
*/
|
||||
|
||||
if (shps.size() < 2) {
|
||||
Logger::Root().Error("GEO", 179, "Not enough sections to loft");
|
||||
::logger::root().error("GEO", 179, "Not enough sections to loft");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -309,11 +316,11 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
// When processing a sectioned *surface* there are no
|
||||
// begin and end caps that need to be added.
|
||||
if (it == shps.begin()) {
|
||||
// faces.Append(shps[0]);
|
||||
// faces.append(shps[0]);
|
||||
BB.Add(comp, shps[0]);
|
||||
}
|
||||
if (jt == shps.end() - 1) {
|
||||
// faces.Append(shps[1]);
|
||||
// faces.append(shps[1]);
|
||||
BB.Add(comp, shps[1]);
|
||||
}
|
||||
}
|
||||
@@ -428,7 +435,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
fill.Add(e3, GeomAbs_C0);
|
||||
fill.Add(e4, GeomAbs_C0);
|
||||
fill.Build();
|
||||
// faces.Append(fill.Face());
|
||||
// faces.append(fill.Face());
|
||||
BB.Add(comp, fill.Face());
|
||||
*/
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ namespace {
|
||||
} else {
|
||||
// @todo
|
||||
const double precision_ = 1.e-5;
|
||||
Logger::Root().Warning("GEO", 180, "Approximating BasisCurve due to possible discontinuities", e->instance);
|
||||
const auto& w = boost::get<TopoDS_Wire>(crv_or_wire);
|
||||
::logger::root().warning("GEO", 180, "Approximating BasisCurve due to possible discontinuities", e->instance);
|
||||
const auto& w = std::get<TopoDS_Wire>(crv_or_wire);
|
||||
#if OCC_VERSION_HEX < 0x70600
|
||||
BRepAdaptor_CompCurve cc(w, true);
|
||||
Handle(Adaptor3d_HCurve) hcc = Handle(Adaptor3d_HCurve)(new BRepAdaptor_HCompCurve(cc));
|
||||
@@ -284,7 +284,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
|
||||
}
|
||||
|
||||
if (converted_segments.Extent() == 0) {
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 181, "No segment successfully converted:", loop->instance);
|
||||
::logger::root().message(::logger::LOG_ERROR, "GEO", 181, "No segment successfully converted:", loop->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
|
||||
|
||||
if (ang < 0.0314) {
|
||||
edges_to_tesselate.Add(crv1->DynamicType() == STANDARD_TYPE(Geom_Circle) ? edges.First() : edges.Last());
|
||||
Logger::Root().Notice("GEO", 182, "Sharp circular corner detecting, substituting with linear approximation");
|
||||
::logger::root().notice("GEO", 182, "Sharp circular corner detecting, substituting with linear approximation");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,19 +46,19 @@ bool OpenCascadeKernel::convert(const taxonomy::shell::ptr l, TopoDS_Shape& shap
|
||||
try {
|
||||
success = convert(face, occ_face);
|
||||
} catch (const std::exception& e) {
|
||||
logger_.Error("GEO", 194, e);
|
||||
logger_.error("GEO", 194, e);
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
logger_.Error("GEO", 195, e.GetMessageString());
|
||||
logger_.error("GEO", 195, e.GetMessageString());
|
||||
} else {
|
||||
logger_.Error("GEO", 196, "Unknown error creating face");
|
||||
logger_.error("GEO", 196, "Unknown error creating face");
|
||||
}
|
||||
} catch (...) {
|
||||
logger_.Error("GEO", 197, "Unknown error creating face");
|
||||
logger_.error("GEO", 197, "Unknown error creating face");
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 198, "Failed to convert face:", face->instance);
|
||||
logger_.message(::logger::LOG_WARNING, "GEO", 198, "Failed to convert face:", face->instance);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ bool OpenCascadeKernel::convert(const taxonomy::shell::ptr l, TopoDS_Shape& shap
|
||||
if (face_area(triangle) > min_face_area) {
|
||||
face_list.Append(triangle);
|
||||
} else {
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 199, "Degenerate face:", face->instance);
|
||||
logger_.message(::logger::LOG_WARNING, "GEO", 199, "Degenerate face:", face->instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ bool OpenCascadeKernel::convert(const taxonomy::shell::ptr l, TopoDS_Shape& shap
|
||||
if (face_area(occ_face) > min_face_area) {
|
||||
face_list.Append(occ_face);
|
||||
} else {
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 200, "Degenerate face:", face->instance);
|
||||
logger_.message(::logger::LOG_WARNING, "GEO", 200, "Degenerate face:", face->instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ bool OpenCascadeKernel::convert(const taxonomy::solid::ptr solid, TopoDS_Shape&
|
||||
throw std::runtime_error("Unexpected configuration of subshapes");
|
||||
}
|
||||
} else {
|
||||
logger_.Warning("GEO", 201, "Ignored shell", s->instance);
|
||||
logger_.warning("GEO", 201, "Ignored shell", s->instance);
|
||||
}
|
||||
}
|
||||
if (!S.IsNull()) {
|
||||
|
||||
@@ -129,8 +129,8 @@ bool OpenCascadeKernel::convert(const taxonomy::sweep_along_curve::ptr scs, Topo
|
||||
}
|
||||
|
||||
auto w = convert_curve(scs->curve);
|
||||
if (w.which() != 2) {
|
||||
logger_.Error("UNS", 9, "Unsupported directrix");
|
||||
if (w.index() != 2) {
|
||||
logger_.error("UNS", 9, "Unsupported directrix");
|
||||
return false;
|
||||
}
|
||||
TopoDS_Shape face_;
|
||||
@@ -178,7 +178,7 @@ bool OpenCascadeKernel::convert(const taxonomy::sweep_along_curve::ptr scs, Topo
|
||||
for (TopExp_Explorer exp(wire, TopAbs_VERTEX); exp.More(); exp.Next()) {
|
||||
if (pln.Distance(BRep_Tool::Pnt(TopoDS::Vertex(exp.Current()))) > ALMOST_ZERO) {
|
||||
directrix_on_plane = false;
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 202, "The Directrix does not lie on the ReferenceSurface", scs->instance);
|
||||
logger_.message(::logger::LOG_WARNING, "GEO", 202, "The Directrix does not lie on the ReferenceSurface", scs->instance);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ bool IfcGeom::util::wire_to_ax(const TopoDS_Wire & wire, gp_Ax2 & directrix) {
|
||||
Handle(Geom_Curve) crv = BRep_Tool::Curve(edge, u0, u1);
|
||||
crv->D1(u0, directrix_origin, directrix_tangent);
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 203, "Unable to locate first edge");
|
||||
::logger::root().error("GEO", 203, "Unable to locate first edge");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void IfcGeom::util::sort_edges(const TopoDS_Wire & wire, std::vector<TopoDS_Edge
|
||||
|
||||
for (int i = 1; i <= map.Extent(); ++i) {
|
||||
if (map.FindFromIndex(i).Extent() > 2) {
|
||||
Logger::Root().Warning("GEO", 204, "Self-intersecting Directrix");
|
||||
::logger::root().warning("GEO", 204, "Self-intersecting Directrix");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,12 +117,12 @@ bool IfcGeom::util::create_edge_over_curve_with_log_messages(const opencascade::
|
||||
}
|
||||
}
|
||||
if (dmin == std::numeric_limits<double>::infinity()) {
|
||||
Logger::Root().Error("GEO", 205, "No extrema for point");
|
||||
::logger::root().error("GEO", 205, "No extrema for point");
|
||||
} else if (dmin > eps2) {
|
||||
Logger::Root().Error("GEO", 206, "Distance of " + boost::lexical_cast<std::string>(std::sqrt(dmin)) + " exceeds tolerance");
|
||||
::logger::root().error("GEO", 206, "Distance of " + boost::lexical_cast<std::string>(std::sqrt(dmin)) + " exceeds tolerance");
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 207, "Failed to calculate extrema for point");
|
||||
::logger::root().error("GEO", 207, "Failed to calculate extrema for point");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ void IfcGeom::util::wire_builder::operator()(const TopoDS_Shape& a, const TopoDS
|
||||
if (dist > 1000. * p_) {
|
||||
mw_.Add(w1);
|
||||
mw_.Add(BRepBuilderAPI_MakeEdge(p1, p2));
|
||||
Logger::Root().Warning("GEO", 208, "Added additional segment to close gap with length " + boost::lexical_cast<std::string>(dist) + " to:", inst_);
|
||||
::logger::root().warning("GEO", 208, "Added additional segment to close gap with length " + boost::lexical_cast<std::string>(dist) + " to:", inst_);
|
||||
goto check;
|
||||
}
|
||||
|
||||
@@ -200,28 +200,28 @@ void IfcGeom::util::wire_builder::operator()(const TopoDS_Shape& a, const TopoDS
|
||||
// Preferably adjust the segment that is linear
|
||||
if (is_line1 || (is_circle1 && !is_line2)) {
|
||||
mw_.Add(adjust(w1, w12, p2));
|
||||
Logger::Root().Notice("GEO", 209, "Adjusted edge end-point with distance " + boost::lexical_cast<std::string>(dist) + " on:", inst_);
|
||||
::logger::root().notice("GEO", 209, "Adjusted edge end-point with distance " + boost::lexical_cast<std::string>(dist) + " on:", inst_);
|
||||
} else if ((is_line2 || is_circle2) && !last) {
|
||||
mw_.Add(w1);
|
||||
override_next_ = true;
|
||||
next_override_ = p1;
|
||||
Logger::Root().Notice("GEO", 210, "Adjusted edge end-point with distance " + boost::lexical_cast<std::string>(dist) + " on:", inst_);
|
||||
::logger::root().notice("GEO", 210, "Adjusted edge end-point with distance " + boost::lexical_cast<std::string>(dist) + " on:", inst_);
|
||||
} else {
|
||||
// In all other cases an edge is added
|
||||
mw_.Add(w1);
|
||||
mw_.Add(BRepBuilderAPI_MakeEdge(p1, p2));
|
||||
Logger::Root().Warning("GEO", 211, "Added additional segment to close gap with length " + boost::lexical_cast<std::string>(dist) + " to:", inst_);
|
||||
::logger::root().warning("GEO", 211, "Added additional segment to close gap with length " + boost::lexical_cast<std::string>(dist) + " to:", inst_);
|
||||
}
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 212, "Internal error, inconsistent wire segments", inst_);
|
||||
::logger::root().error("GEO", 212, "Internal error, inconsistent wire segments", inst_);
|
||||
mw_.Add(w1);
|
||||
}
|
||||
}
|
||||
|
||||
check:
|
||||
if (mw_.Error() == BRepBuilderAPI_NonManifoldWire) {
|
||||
Logger::Root().Error("GEO", 213, "Non-manifold curve segments:", inst_);
|
||||
::logger::root().error("GEO", 213, "Non-manifold curve segments:", inst_);
|
||||
} else if (mw_.Error() == BRepBuilderAPI_DisconnectedWire) {
|
||||
Logger::Root().Error("GEO", 214, "Failed to join curve segments:", inst_);
|
||||
::logger::root().error("GEO", 214, "Failed to join curve segments:", inst_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ bool IfcGeom::util::approximate_plane_through_wire(const TopoDS_Wire& wire, gp_P
|
||||
// obtaining a 2d points for the Delaunay, infinity is passed here, so this
|
||||
// can't for assessing degenerativeness.
|
||||
if (v.Magnitude() < 1.e-7) {
|
||||
Logger::Root().Warning("GEO", 215, "Degenerate face boundary in normal estimation");
|
||||
::logger::root().warning("GEO", 215, "Degenerate face boundary in normal estimation");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
|
||||
auto it = mapping.find(uvnodes[k]);
|
||||
if (it == mapping.end()) {
|
||||
Logger::Root().Error("GEO", 216, "Internal error: unable to unproject uv-mesh");
|
||||
::logger::root().error("GEO", 216, "Internal error: unable to unproject uv-mesh");
|
||||
return TRIANGULATE_WIRE_FAIL;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
}
|
||||
faces.Append(triangle_face);
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 217, "Internal error: missing face");
|
||||
::logger::root().error("GEO", 217, "Internal error: missing face");
|
||||
return TRIANGULATE_WIRE_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
if (!contains) {
|
||||
#endif
|
||||
// All existing edges need to exist in the new faces
|
||||
Logger::Root().Error("GEO", 218, "Internal error, missing edge from triangulation");
|
||||
::logger::root().error("GEO", 218, "Internal error, missing edge from triangulation");
|
||||
non_manifold = true;
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
// Existing edges are boundaries with use 1
|
||||
// New edges are internal with use 2
|
||||
if (n != (mape.Contains(v) ? 1 : 2)) {
|
||||
Logger::Root().Error("GEO", 219, "Internal error, non-manifold result from triangulation");
|
||||
::logger::root().error("GEO", 219, "Internal error, non-manifold result from triangulation");
|
||||
non_manifold = true;
|
||||
}
|
||||
}
|
||||
@@ -794,12 +794,12 @@ bool IfcGeom::util::fill_nonmanifold_wires_with_planar_faces(TopoDS_Shape& shape
|
||||
shape = solid.SolidFromShell(TopoDS::Shell(shape));
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 220, e.GetMessageString());
|
||||
::logger::root().error("GEO", 220, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 221, "Unknown error creating solid");
|
||||
::logger::root().error("GEO", 221, "Unknown error creating solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 222, "Unknown error creating solid");
|
||||
::logger::root().error("GEO", 222, "Unknown error creating solid");
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -812,12 +812,12 @@ bool IfcGeom::util::convert_curve_to_wire(const opencascade::handle<Geom_Curve>&
|
||||
return true;
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Root().Error("GEO", 223, e.GetMessageString());
|
||||
::logger::root().error("GEO", 223, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Root().Error("GEO", 224, "Unknown error converting curve to wire");
|
||||
::logger::root().error("GEO", 224, "Unknown error converting curve to wire");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Root().Error("GEO", 225, "Unknown error converting curve to wire");
|
||||
::logger::root().error("GEO", 225, "Unknown error converting curve to wire");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -838,7 +838,7 @@ void IfcGeom::util::assert_closed_wire(TopoDS_Wire& wire, double tol) {
|
||||
wire = mw.Wire();
|
||||
}
|
||||
|
||||
Logger::Root().Warning("GEO", 226, "Wire not closed");
|
||||
::logger::root().warning("GEO", 226, "Wire not closed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ bool IfcGeom::util::convert_wire_to_face(const TopoDS_Wire& w, TopoDS_Face& face
|
||||
NCollection_List<TopoDS_Shape> results;
|
||||
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) {
|
||||
Logger::Root().Warning("GEO", 227, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
::logger::root().warning("GEO", 227, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
util::select_largest(results, wire);
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ bool IfcGeom::util::convert_wire_to_face(const TopoDS_Wire& w, TopoDS_Face& face
|
||||
BRepBuilderAPI_FaceError er = mf.Error();
|
||||
|
||||
if (er != BRepBuilderAPI_FaceDone) {
|
||||
Logger::Root().Error("GEO", 228, "Failed to create face.");
|
||||
::logger::root().error("GEO", 228, "Failed to create face.");
|
||||
return false;
|
||||
}
|
||||
face = mf.Face();
|
||||
@@ -906,7 +906,7 @@ bool IfcGeom::util::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compound&
|
||||
|
||||
NCollection_List<TopoDS_Shape> results;
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(w, results, settings)) {
|
||||
Logger::Root().Warning("GEO", 229, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
::logger::root().warning("GEO", 229, "Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
} else {
|
||||
results.Clear();
|
||||
results.Append(w);
|
||||
@@ -932,7 +932,7 @@ bool IfcGeom::util::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compound&
|
||||
BRepBuilderAPI_FaceError er = mf.Error();
|
||||
|
||||
if (er != BRepBuilderAPI_FaceDone) {
|
||||
Logger::Root().Error("GEO", 230, "Failed to create face.");
|
||||
::logger::root().error("GEO", 230, "Failed to create face.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ bool IfcGeom::util::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compound&
|
||||
if (p.first >= max_area / 10.) {
|
||||
B.Add(faces, p.second);
|
||||
} else {
|
||||
Logger::Root().Warning("GEO", 231, "Ignoring self-intersection loop with area " + boost::lexical_cast<std::string>(p.first));
|
||||
::logger::root().warning("GEO", 231, "Ignoring self-intersection loop with area " + boost::lexical_cast<std::string>(p.first));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user