mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 04:04:00 +00:00
Pass around non-static logger instances and programmatic access to messages in-memory
This commit is contained in:
@@ -99,7 +99,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
ifcopenshell::geometry::CgalShape::CgalShape(const cgal_shape_t& shape, bool convex) {
|
||||
ifcopenshell::geometry::CgalShape::CgalShape(const cgal_shape_t& shape, bool convex, Logger& logger) {
|
||||
shape_ = shape;
|
||||
convex_tag_ = convex;
|
||||
|
||||
@@ -112,7 +112,7 @@ ifcopenshell::geometry::CgalShape::CgalShape(const cgal_shape_t& shape, bool con
|
||||
auto b2 = plane.base2();
|
||||
|
||||
if (V.squared_length() == 0) {
|
||||
Logger::Warning("GEO", 62, "Removed face due to self-intersections");
|
||||
logger.Warning("GEO", 62, "Removed face due to self-intersections");
|
||||
faces_to_remove.insert(face);
|
||||
continue;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ ifcopenshell::geometry::CgalShape::CgalShape(const cgal_shape_t& shape, bool con
|
||||
}
|
||||
|
||||
if (!CGAL::Polygon_2<Kernel_>(ps.begin(), ps.end()).is_simple()) {
|
||||
Logger::Warning("GEO", 63, "Removed face due to self-intersections");
|
||||
logger.Warning("GEO", 63, "Removed face due to self-intersections");
|
||||
faces_to_remove.insert(face);
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ void ifcopenshell::geometry::CgalShape::to_nef() const {
|
||||
}
|
||||
#endif
|
||||
|
||||
void ifcopenshell::geometry::CgalShape::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const {
|
||||
void ifcopenshell::geometry::CgalShape::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 {
|
||||
const bool all_triangles = std::all_of(shape_->facets_begin(), shape_->facets_end(), [](auto f) { return f.is_triangle(); });
|
||||
const bool has_iden_transform = place.is_identity();
|
||||
|
||||
@@ -233,7 +233,7 @@ void ifcopenshell::geometry::CgalShape::Triangulate(ifcopenshell::geometry::Sett
|
||||
|
||||
if (!all_triangles) {
|
||||
if (!shape_to_use->is_valid()) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 64, "Invalid Polyhedron_3 in object (before triangulation)");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 64, "Invalid Polyhedron_3 in object (before triangulation)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -241,19 +241,19 @@ void ifcopenshell::geometry::CgalShape::Triangulate(ifcopenshell::geometry::Sett
|
||||
try {
|
||||
success = CGAL::Polygon_mesh_processing::triangulate_faces(*shape_to_use);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 65, "Triangulation crashed");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 65, "Triangulation crashed");
|
||||
return;
|
||||
}
|
||||
|
||||
CGAL::Polygon_mesh_processing::remove_degenerate_faces(*shape_to_use);
|
||||
|
||||
if (!success) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 66, "Triangulation failed");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 66, "Triangulation failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!shape_to_use->is_valid()) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 67, "Invalid Polyhedron_3 in object (after triangulation)");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 67, "Invalid Polyhedron_3 in object (after triangulation)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void ifcopenshell::geometry::CgalShape::Triangulate(ifcopenshell::geometry::Sett
|
||||
try {
|
||||
CGAL::Polygon_mesh_processing::compute_face_normals(*shape_to_use, face_normals_map);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 68, "Face normal calculation failed");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 68, "Face normal calculation failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ bool ifcopenshell::geometry::CgalShape::surface_area_along_direction(double tol,
|
||||
|
||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||
|
||||
void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_id) const {
|
||||
void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::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 {
|
||||
throw std::runtime_error("Not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace ifcopenshell { namespace geometry {
|
||||
mutable boost::optional<CGAL::Nef_polyhedron_3<Kernel_>> nef_;
|
||||
#endif
|
||||
public:
|
||||
CgalShape(const cgal_shape_t& shape, bool convex = false);
|
||||
CgalShape(const cgal_shape_t& shape, bool convex = false, Logger& logger = Logger::Root());
|
||||
|
||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||
CgalShape(const CGAL::Nef_polyhedron_3<Kernel_>& shape, bool convex = false) {
|
||||
@@ -209,7 +209,7 @@ namespace ifcopenshell { namespace geometry {
|
||||
operator const cgal_shape_t& () const { to_poly(); return *shape_; }
|
||||
const cgal_shape_t& poly() const { to_poly(); return *shape_; }
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_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 Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual IfcGeom::ConversionResultShape* clone() const {
|
||||
@@ -285,7 +285,7 @@ namespace ifcopenshell { namespace geometry {
|
||||
planes_.push_back(shape);
|
||||
}
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_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 Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual int surface_genus() const;
|
||||
|
||||
@@ -46,18 +46,19 @@ namespace {
|
||||
struct PolyhedronBuilder : public CGAL::Modifier_base<CGAL::Polyhedron_3<Kernel_>::HalfedgeDS> {
|
||||
private:
|
||||
std::list<cgal_face_t> *face_list;
|
||||
Logger& logger_;
|
||||
public:
|
||||
boost::optional<cgal_shape_t> from_soup;
|
||||
PolyhedronBuilder(std::list<cgal_face_t> *face_list);
|
||||
PolyhedronBuilder(std::list<cgal_face_t> *face_list, Logger& logger = Logger::Root());
|
||||
void operator()(CGAL::Polyhedron_3<Kernel_>::HalfedgeDS &hds);
|
||||
};
|
||||
}
|
||||
|
||||
CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(std::list<cgal_face_t> &face_list, bool stitch_borders) {
|
||||
CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(std::list<cgal_face_t> &face_list, bool stitch_borders, Logger& logger) {
|
||||
|
||||
// Naive creation
|
||||
CGAL::Polyhedron_3<Kernel_> polyhedron;
|
||||
PolyhedronBuilder builder(&face_list);
|
||||
PolyhedronBuilder builder(&face_list, logger);
|
||||
polyhedron.delegate(builder);
|
||||
if (builder.from_soup) {
|
||||
polyhedron = *builder.from_soup;
|
||||
@@ -76,7 +77,7 @@ CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(std
|
||||
|
||||
polyhedron.normalize_border();
|
||||
if (!polyhedron.is_valid(false, 1)) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 69, "create_polyhedron: Polyhedron not valid!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 69, "create_polyhedron: Polyhedron not valid!");
|
||||
// std::ofstream fresult;
|
||||
// fresult.open("/Users/ken/Desktop/invalid.off");
|
||||
// fresult << polyhedron << std::endl;
|
||||
@@ -90,31 +91,31 @@ CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(std
|
||||
}
|
||||
|
||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||
CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(const CGAL::Nef_polyhedron_3<Kernel_>& nef_polyhedron) {
|
||||
CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_polyhedron(const CGAL::Nef_polyhedron_3<Kernel_>& nef_polyhedron, Logger& logger) {
|
||||
if (nef_polyhedron.is_simple()) {
|
||||
try {
|
||||
CGAL::Polyhedron_3<Kernel_> polyhedron;
|
||||
nef_polyhedron.convert_to_polyhedron(polyhedron);
|
||||
return polyhedron;
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 70, "Conversion from Nef to polyhedron failed!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 70, "Conversion from Nef to polyhedron failed!");
|
||||
return CGAL::Polyhedron_3<Kernel_>();
|
||||
}
|
||||
} else {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 71, "Nef polyhedron not simple: cannot create polyhedron!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 71, "Nef polyhedron not simple: cannot create polyhedron!");
|
||||
return CGAL::Polyhedron_3<Kernel_>();
|
||||
}
|
||||
}
|
||||
|
||||
CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhedron(std::list<cgal_face_t> &face_list) {
|
||||
CGAL::Polyhedron_3<Kernel_> polyhedron = create_polyhedron(face_list);
|
||||
CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhedron(std::list<cgal_face_t> &face_list, Logger& logger) {
|
||||
CGAL::Polyhedron_3<Kernel_> polyhedron = create_polyhedron(face_list, true, logger);
|
||||
if (polyhedron.is_closed()) {
|
||||
try {
|
||||
if (!CGAL::Polygon_mesh_processing::is_outward_oriented(polyhedron)) {
|
||||
CGAL::Polygon_mesh_processing::reverse_face_orientations(polyhedron);
|
||||
}
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 72, e);
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 72, e);
|
||||
}
|
||||
}
|
||||
CGAL::Polygon_mesh_processing::triangulate_faces(polyhedron);
|
||||
@@ -122,12 +123,12 @@ CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhe
|
||||
try {
|
||||
nef_polyhedron = CGAL::Nef_polyhedron_3<Kernel_>(polyhedron);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 73, "Conversion to Nef polyhedron failed!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 73, "Conversion to Nef polyhedron failed!");
|
||||
}
|
||||
return nef_polyhedron;
|
||||
}
|
||||
|
||||
CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhedron(CGAL::Polyhedron_3<Kernel_> &polyhedron) {
|
||||
CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhedron(CGAL::Polyhedron_3<Kernel_> &polyhedron, Logger& logger) {
|
||||
// @todo needed?
|
||||
polyhedron.normalize_border();
|
||||
|
||||
@@ -137,7 +138,7 @@ CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhe
|
||||
CGAL::Polygon_mesh_processing::reverse_face_orientations(polyhedron);
|
||||
}
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 74, e);
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 74, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,11 +149,11 @@ CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhe
|
||||
try {
|
||||
nef_polyhedron = CGAL::Nef_polyhedron_3<Kernel_>(polyhedron);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 75, "Conversion to Nef polyhedron failed!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 75, "Conversion to Nef polyhedron failed!");
|
||||
}
|
||||
return nef_polyhedron;
|
||||
} else {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 76, "Polyhedron not valid: cannot create Nef polyhedron!");
|
||||
logger.Message(Logger::LOG_ERROR, "GEO", 76, "Polyhedron not valid: cannot create Nef polyhedron!");
|
||||
return CGAL::Nef_polyhedron_3<Kernel_>();
|
||||
}
|
||||
}
|
||||
@@ -161,13 +162,13 @@ CGAL::Nef_polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_nef_polyhe
|
||||
bool CgalKernel::convert(const taxonomy::shell::ptr l, cgal_shape_t& shape) {
|
||||
for (auto& f : l->children) {
|
||||
if (f->basis && f->basis->kind() != taxonomy::PLANE) {
|
||||
Logger::Error("UNS", 3, "CGAL Kernel: Non-planar faces not supported at the moment");
|
||||
logger_.Error("UNS", 3, "CGAL Kernel: Non-planar faces not supported at the moment");
|
||||
throw not_supported_error();
|
||||
}
|
||||
for (auto& w : f->children) {
|
||||
for (auto& e : w->children) {
|
||||
if (e->basis && e->basis->kind() == taxonomy::BSPLINE_CURVE) {
|
||||
Logger::Error("UNS", 4, "CGAL Kernel: B-spline edge curves not supported at the moment");
|
||||
logger_.Error("UNS", 4, "CGAL Kernel: B-spline edge curves not supported at the moment");
|
||||
throw not_supported_error();
|
||||
}
|
||||
}
|
||||
@@ -196,9 +197,9 @@ bool CgalKernel::convert(const taxonomy::shell::ptr l, cgal_shape_t& shape) {
|
||||
double volume = diag(0) * diag(1) * diag(2);
|
||||
// @todo volume van be zero also..
|
||||
double density = num_points / volume;
|
||||
Logger::Notice("GEO", 77, "Density " + boost::lexical_cast<std::string>(density), l->instance);
|
||||
logger_.Notice("GEO", 77, "Density " + boost::lexical_cast<std::string>(density), l->instance);
|
||||
if (density > 5000) {
|
||||
Logger::Notice("GEO", 78, "Substituted element with " + boost::lexical_cast<std::string>(density) + " vertices / m3 with a bounding box");
|
||||
logger_.Notice("GEO", 78, "Substituted element with " + boost::lexical_cast<std::string>(density) + " vertices / m3 with a bounding box");
|
||||
CGAL::Point_3<Kernel_> lower(minmax.first(0), minmax.first(1), minmax.first(2));
|
||||
CGAL::Point_3<Kernel_> upper(minmax.second(0), minmax.second(1), minmax.second(2));
|
||||
shape = utils::create_cube(lower, upper);
|
||||
@@ -214,7 +215,7 @@ bool CgalKernel::convert(const taxonomy::shell::ptr l, cgal_shape_t& shape) {
|
||||
} catch (...) {}
|
||||
|
||||
if (!success) {
|
||||
Logger::Message(Logger::LOG_WARNING, "GEO", 79, "Failed to convert face:", f->instance);
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 79, "Failed to convert face:", f->instance);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -236,7 +237,7 @@ bool CgalKernel::convert(const taxonomy::face::ptr face, std::list<cgal_face_t>&
|
||||
}
|
||||
|
||||
if (face->children.size() > 1 && num_outer_bounds > 1 && face->children.size() != num_outer_bounds) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 80, "Invalid configuration of boundaries for:", face->instance);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 80, "Invalid configuration of boundaries for:", face->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -249,7 +250,7 @@ bool CgalKernel::convert(const taxonomy::face::ptr face, std::list<cgal_face_t>&
|
||||
|
||||
cgal_wire_t wire;
|
||||
if (!convert(bound, wire)) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 81, "Failed to process face boundary loop", bound->instance);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 81, "Failed to process face boundary loop", bound->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -703,7 +704,7 @@ bool CgalKernel::convert(const taxonomy::loop::ptr loop, cgal_wire_t& result) {
|
||||
if (d < 1.e-5) {
|
||||
points.erase(points.end() - 1);
|
||||
} else {
|
||||
Logger::Warning("GEO", 82, "Loop not closed", loop->instance);
|
||||
logger_.Warning("GEO", 82, "Loop not closed", loop->instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +718,7 @@ bool CgalKernel::convert(const taxonomy::loop::ptr loop, cgal_wire_t& result) {
|
||||
// A loop should consist of at least three vertices
|
||||
std::size_t original_count = polygon.size();
|
||||
if (original_count < 3) {
|
||||
Logger::Warning("GEO", 83, "Not enough edges for:", loop->instance);
|
||||
logger_.Warning("GEO", 83, "Not enough edges for:", loop->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -728,14 +729,14 @@ bool CgalKernel::convert(const taxonomy::loop::ptr loop, cgal_wire_t& result) {
|
||||
std::size_t count = polygon.size();
|
||||
if (original_count - count != 0) {
|
||||
std::stringstream ss; ss << (original_count - count) << " edges removed for:";
|
||||
Logger::Warning("GEO", 84, ss.str(), loop->instance);
|
||||
logger_.Warning("GEO", 84, ss.str(), loop->instance);
|
||||
}
|
||||
|
||||
{
|
||||
std::set<cgal_point_t> visited_points;
|
||||
for (auto& p : polygon) {
|
||||
if (visited_points.find(p) != visited_points.end()) {
|
||||
Logger::Error("GEO", 85, "Skipping self-intersecting loop", loop->instance);
|
||||
logger_.Error("GEO", 85, "Skipping self-intersecting loop", loop->instance);
|
||||
// @todo signal somehow that occt kernel might be able to solve this
|
||||
// @todo implement cycle detection using Arrangement_2, but that only works in exact kernel
|
||||
return false;
|
||||
@@ -757,7 +758,7 @@ bool CgalKernel::convert(const taxonomy::loop::ptr loop, cgal_wire_t& result) {
|
||||
}
|
||||
|
||||
if (do_segments_intersect(segments)) {
|
||||
Logger::Message(Logger::LOG_WARNING, "GEO", 86, "Skipping self-intersecting loop", loop->instance);
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 86, "Skipping self-intersecting loop", loop->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -785,7 +786,7 @@ bool CgalKernel::convert(const taxonomy::loop::ptr loop, cgal_wire_t& result) {
|
||||
*/
|
||||
|
||||
if (count < 3) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 87, "Not enough edges for:", loop->instance);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 87, "Not enough edges for:", loop->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -819,7 +820,7 @@ bool CgalKernel::convert_impl(const taxonomy::shell::ptr shell, ConversionResult
|
||||
|
||||
bool CgalKernel::convert_impl(const taxonomy::solid::ptr solid, ConversionResults& results) {
|
||||
if (solid->children.size() > 1) {
|
||||
Logger::Error("UNS", 5, "Multiple shells in solid not supported at the moment");
|
||||
logger_.Error("UNS", 5, "Multiple shells in solid not supported at the moment");
|
||||
return false;
|
||||
}
|
||||
cgal_shape_t shape;
|
||||
@@ -964,7 +965,7 @@ bool ifcopenshell::geometry::kernels::CgalKernel::convert_openings(const IfcUtil
|
||||
try {
|
||||
a.convert_to_polyhedron(a_poly);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 88, "Could not convert from Nef:", entity);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 88, "Could not convert from Nef:", entity);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1189,7 +1190,7 @@ bool CgalKernel::process_extrusion(const cgal_face_t& bottom_face, taxonomy::dir
|
||||
bool CgalKernel::convert(const taxonomy::extrusion::ptr extrusion, cgal_shape_t &shape) {
|
||||
const double& height = extrusion->depth;
|
||||
if (height < settings_.get<settings::Precision>().get()) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 89, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 89, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1325,13 +1326,13 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
cgal_shape_t shape = shape_const;
|
||||
|
||||
if (!shape.is_valid()) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 90, "Conversion to Nef will fail. Invalid geometry:", log_reference);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 90, "Conversion to Nef will fail. Invalid geometry:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!shape.is_closed()) {
|
||||
// TODO: There can be substractions to remove parts of non-volumetric objects. Maybe iterate over all faces of an entity and put them in a Nef_polyhedron_3 through Boolean union? Highly inefficient but maybe desirable...
|
||||
Logger::Message(Logger::LOG_ERROR, "UNS", 6, "Subtraction of openings not supported for non-closed geometry:", log_reference);
|
||||
logger_.Message(Logger::LOG_ERROR, "UNS", 6, "Subtraction of openings not supported for non-closed geometry:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1340,18 +1341,18 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
try {
|
||||
success = CGAL::Polygon_mesh_processing::triangulate_faces(shape);
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Notice("GEO", 91, e);
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 92, "Triangulation of geometry crashed:", log_reference);
|
||||
logger_.Notice("GEO", 91, e);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 92, "Triangulation of geometry crashed:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 93, "Triangulation of geometry failed:", log_reference);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 93, "Triangulation of geometry failed:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (CGAL::Polygon_mesh_processing::does_self_intersect(shape)) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 94, "Conversion to Nef will fail. Self-intersecting geometry:", log_reference);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 94, "Conversion to Nef will fail. Self-intersecting geometry:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1423,8 +1424,8 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
try {
|
||||
result = CGAL::Nef_polyhedron_3<Kernel_>(shape);
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Notice("GEO", 95, e);
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 96, "Could not convert geometry to Nef:", log_reference);
|
||||
logger_.Notice("GEO", 95, e);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 96, "Could not convert geometry to Nef:", log_reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1496,8 +1497,8 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
// @todo don't dilate in 3 dimensions but only in the XY plane, orthogonal to wall axis.
|
||||
result = CGAL::minkowski_sum_3(result, precision_cube_);
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Notice("GEO", 97, e);
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 98, "Could not dilate boolean operand", log_reference);
|
||||
logger_.Notice("GEO", 97, e);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 98, "Could not dilate boolean operand", log_reference);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1522,8 +1523,8 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
cgal_shape_t convert_back;
|
||||
result.convert_to_polyhedron(convert_back);
|
||||
} catch (CGAL::Failure_exception& e) {
|
||||
Logger::Notice("GEO", 99, e);
|
||||
Logger::Message(Logger::LOG_WARNING, "GEO", 100, "Final conversion will likely fail. Could not convert geometry from Nef:", log_reference);
|
||||
logger_.Notice("GEO", 99, e);
|
||||
logger_.Message(Logger::LOG_WARNING, "GEO", 100, "Final conversion will likely fail. Could not convert geometry from Nef:", log_reference);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1845,7 +1846,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion
|
||||
// even-odd fill rule will result in incorrect results.
|
||||
// See for example the Duplex model roof.
|
||||
|
||||
Logger::Notice("GEO", 101, "Holes are not disjoint");
|
||||
logger_.Notice("GEO", 101, "Holes are not disjoint");
|
||||
|
||||
CGAL::Polygon_set_2<Kernel_> result;
|
||||
auto it = loops.begin();
|
||||
@@ -1898,7 +1899,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion
|
||||
);
|
||||
});
|
||||
|
||||
Logger::Notice("GEO", 102, "Processed boolean operation as 2d arrangement");
|
||||
logger_.Notice("GEO", 102, "Processed boolean operation as 2d arrangement");
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1984,7 +1985,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion
|
||||
ps.push_back({ p.x(), p.y() });
|
||||
}
|
||||
if (!ps.is_simple()) {
|
||||
Logger::Warning("GEO", 103, "Polygonal boundary not simple", face->children[0]->instance);
|
||||
logger_.Warning("GEO", 103, "Polygonal boundary not simple", face->children[0]->instance);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2130,7 +2131,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion
|
||||
try {
|
||||
a.convert_to_polyhedron(a_poly);
|
||||
} catch (...) {
|
||||
Logger::Message(Logger::LOG_ERROR, "GEO", 104, "Could not convert geometry with openings from Nef:", br->instance);
|
||||
logger_.Message(Logger::LOG_ERROR, "GEO", 104, "Could not convert geometry with openings from Nef:", br->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2145,8 +2146,7 @@ bool CgalKernel::convert_impl(const taxonomy::boolean_result::ptr br, Conversion
|
||||
#endif
|
||||
}
|
||||
|
||||
PolyhedronBuilder::PolyhedronBuilder(std::list<cgal_face_t>* face_list) {
|
||||
this->face_list = face_list;
|
||||
PolyhedronBuilder::PolyhedronBuilder(std::list<cgal_face_t>* face_list, Logger& logger) : face_list(face_list), logger_(logger) {
|
||||
}
|
||||
|
||||
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
|
||||
@@ -2222,7 +2222,7 @@ void PolyhedronBuilder::operator()(CGAL::Polyhedron_3<Kernel_>::HalfedgeDS &hds)
|
||||
// For now let's just skip over the triangle. We can also use
|
||||
// the Aff_transformation_3 stored in place to convert the 2d
|
||||
// coords back to 3d.
|
||||
Logger::Warning("GEO", 105, "Ignoring triangulated facet with novel point likely due to self-intersections");
|
||||
logger_.Warning("GEO", 105, "Ignoring triangulated facet with novel point likely due to self-intersections");
|
||||
facet_vertices.erase(facet_vertices.end() - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef CGAL_KERNEL_H
|
||||
#define CGAL_KERNEL_H
|
||||
|
||||
#include "../../../ifcparse/IfcLogger.h"
|
||||
|
||||
/*
|
||||
#ifdef NO_CACHE
|
||||
|
||||
@@ -58,12 +60,12 @@ namespace ifcopenshell {
|
||||
namespace utils {
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_cube(double d);
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_cube(const Kernel_::Point_3& lower, const Kernel_::Point_3& upper);
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_polyhedron(std::list<cgal_face_t> &face_list, bool stitch_borders = false);
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_polyhedron(std::list<cgal_face_t> &face_list, bool stitch_borders = false, Logger& logger = Logger::Root());
|
||||
|
||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_polyhedron(const CGAL::Nef_polyhedron_3<Kernel_> &nef_polyhedron);
|
||||
IFC_GEOMLIBRARY_API CGAL::Nef_polyhedron_3<Kernel_> create_nef_polyhedron(std::list<cgal_face_t> &face_list);
|
||||
IFC_GEOMLIBRARY_API CGAL::Nef_polyhedron_3<Kernel_> create_nef_polyhedron(CGAL::Polyhedron_3<Kernel_> &polyhedron);
|
||||
IFC_GEOMLIBRARY_API CGAL::Polyhedron_3<Kernel_> create_polyhedron(const CGAL::Nef_polyhedron_3<Kernel_> &nef_polyhedron, Logger& logger = Logger::Root());
|
||||
IFC_GEOMLIBRARY_API CGAL::Nef_polyhedron_3<Kernel_> create_nef_polyhedron(std::list<cgal_face_t> &face_list, Logger& logger = Logger::Root());
|
||||
IFC_GEOMLIBRARY_API CGAL::Nef_polyhedron_3<Kernel_> create_nef_polyhedron(CGAL::Polyhedron_3<Kernel_> &polyhedron, Logger& logger = Logger::Root());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -91,12 +93,12 @@ namespace ifcopenshell {
|
||||
#endif
|
||||
public:
|
||||
|
||||
CgalKernel(const Settings& settings)
|
||||
: AbstractKernel("cgal", settings)
|
||||
CgalKernel(const Settings& settings, Logger& logger = Logger::Root())
|
||||
: AbstractKernel("cgal", settings, logger)
|
||||
{}
|
||||
|
||||
virtual AbstractKernel* clone() const {
|
||||
return new CgalKernel(settings());
|
||||
return new CgalKernel(settings(), logger());
|
||||
}
|
||||
|
||||
virtual bool supports_boolean_operations() const {
|
||||
@@ -133,4 +135,4 @@ namespace ifcopenshell {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
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) 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?
|
||||
@@ -87,7 +87,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::Message(Logger::LOG_ERROR, "GEO", 183, "Failed to triangulate shape");
|
||||
Logger::Root().Message(Logger::LOG_ERROR, "GEO", 183, "Failed to triangulate shape");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ void ifcopenshell::geometry::OpenCascadeShape::Triangulate(ifcopenshell::geometr
|
||||
Handle_Poly_Triangulation tri = BRep_Tool::Triangulation(face, loc);
|
||||
|
||||
if (tri.IsNull()) {
|
||||
Logger::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
|
||||
@@ -174,7 +174,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;
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ namespace {
|
||||
try {
|
||||
BRepMesh_IncrementalMesh(s, tol);
|
||||
} catch (...) {
|
||||
Logger::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;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ifcopenshell {
|
||||
const TopoDS_Shape& shape() const { return shape_; }
|
||||
operator const TopoDS_Shape& () { return shape_; }
|
||||
|
||||
virtual void Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int item_id, int surface_style_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 Serialize(const ifcopenshell::geometry::taxonomy::matrix4& place, std::string&) const;
|
||||
|
||||
virtual IfcGeom::ConversionResultShape* clone() const {
|
||||
|
||||
@@ -118,7 +118,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
||||
|
||||
auto it3_shape = std::static_pointer_cast<OpenCascadeShape>(it3->Shape())->shape();
|
||||
if (it3_shape.IsNull()) {
|
||||
Logger::Error("GEO", 187, "Null operand");
|
||||
Logger::Root().Error("GEO", 187, "Null operand");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
||||
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::Root().Warning("GEO", 188, "Successfully sewed non-manifold first operand");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,17 +161,17 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
||||
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::Root().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::Root().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::Root().Warning("GEO", 191, "Non-manifold first operand, use --make-volume to try and make manifold");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
||||
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::Root().Message(Logger::LOG_ERROR, "GEO", 192, "Opening subtraction failed for " + boost::lexical_cast<std::string>(std::distance(jt, it)) + " openings", entity);
|
||||
}
|
||||
|
||||
jt = it;
|
||||
@@ -235,7 +235,7 @@ bool IfcGeom::OpenCascadeKernel::convert_openings(const IfcUtil::IfcBaseEntity*
|
||||
// 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::Root().Warning("GEO", 193, "Retrying boolean operation on individual faces");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -112,14 +112,14 @@ private:
|
||||
|
||||
double precision_;
|
||||
public:
|
||||
OpenCascadeKernel(const ifcopenshell::geometry::Settings& settings)
|
||||
: AbstractKernel("opencascade", settings)
|
||||
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() const {
|
||||
return new OpenCascadeKernel(settings());
|
||||
return new OpenCascadeKernel(settings(), logger());
|
||||
}
|
||||
|
||||
virtual bool supports_boolean_operations() const { return true; }
|
||||
|
||||
@@ -711,12 +711,12 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
|
||||
valid_shell &= util::count(shape, TopAbs_SHELL) > 0;
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Error("GEO", 106, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 106, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 107, "Unknown error sewing shell");
|
||||
Logger::Root().Error("GEO", 107, "Unknown error sewing shell");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 108, "Unknown error sewing shell");
|
||||
Logger::Root().Error("GEO", 108, "Unknown error sewing shell");
|
||||
}
|
||||
|
||||
if (valid_shell) {
|
||||
@@ -744,22 +744,22 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
|
||||
}
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Error("GEO", 109, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 109, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 110, "Unknown error classifying solid");
|
||||
Logger::Root().Error("GEO", 110, "Unknown error classifying solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::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::Error("GEO", 112, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 112, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 113, "Unknown error creating solid");
|
||||
Logger::Root().Error("GEO", 113, "Unknown error creating solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 114, "Unknown error creating solid");
|
||||
Logger::Root().Error("GEO", 114, "Unknown error creating solid");
|
||||
}
|
||||
|
||||
if (complete_shape.IsNull()) {
|
||||
@@ -771,7 +771,7 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
|
||||
B.MakeCompound(C);
|
||||
B.Add(C, complete_shape);
|
||||
complete_shape = C;
|
||||
Logger::Warning("GEO", 115, "Multiple components in IfcConnectedFaceSet");
|
||||
Logger::Root().Warning("GEO", 115, "Multiple components in IfcConnectedFaceSet");
|
||||
}
|
||||
B.Add(complete_shape, result_shape);
|
||||
}
|
||||
@@ -786,7 +786,7 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
|
||||
B.MakeCompound(C);
|
||||
B.Add(C, complete_shape);
|
||||
complete_shape = C;
|
||||
Logger::Warning("GEO", 116, "Loose faces in IfcConnectedFaceSet");
|
||||
Logger::Root().Warning("GEO", 116, "Loose faces in IfcConnectedFaceSet");
|
||||
}
|
||||
B.Add(complete_shape, loose_faces.Current());
|
||||
}
|
||||
@@ -794,7 +794,7 @@ bool IfcGeom::util::create_solid_from_faces(const TopTools_ListOfShape& face_lis
|
||||
shape = complete_shape;
|
||||
|
||||
} else {
|
||||
Logger::Error("GEO", 117, "Failed to sew faceset");
|
||||
Logger::Root().Error("GEO", 117, "Failed to sew faceset");
|
||||
}
|
||||
|
||||
return valid_shell;
|
||||
@@ -898,7 +898,7 @@ bool IfcGeom::util::validate_shape(const TopoDS_Shape& s) {
|
||||
|
||||
dump(s);
|
||||
|
||||
Logger::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::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::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::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;
|
||||
|
||||
@@ -419,7 +419,7 @@ int IfcGeom::util::eliminate_narrow_operands(double prec, const TopTools_ListOfS
|
||||
|
||||
bool is_narrow = min_dimension < prec;
|
||||
|
||||
Logger::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());
|
||||
@@ -704,7 +704,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::Notice("GEO", 123, "Intersecting boundaries");
|
||||
Logger::Root().Notice("GEO", 123, "Intersecting boundaries");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -751,7 +751,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::Notice("GEO", 124, "Subtraction operand outside of outer bound");
|
||||
Logger::Root().Notice("GEO", 124, "Subtraction operand outside of outer bound");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,7 +791,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::Notice("GEO", 125, "Subtraction operand contained in other");
|
||||
Logger::Root().Notice("GEO", 125, "Subtraction operand contained in other");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -849,7 +849,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::Notice("GEO", 126, "Boolean debug identifier: " + debug_identifier);
|
||||
Logger::Root().Notice("GEO", 126, "Boolean debug identifier: " + debug_identifier);
|
||||
}
|
||||
|
||||
if (fuzziness < 0.) {
|
||||
@@ -885,7 +885,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
a = unify(a_input, fuzziness * 1000.);
|
||||
|
||||
Logger::Message(
|
||||
Logger::Root().Message(
|
||||
Logger::LOG_DEBUG, "GEO", 127,
|
||||
"Simplified operand A from "s +
|
||||
std::to_string(count(a_input, TopAbs_FACE)) +
|
||||
@@ -897,7 +897,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
TopTools_ListIteratorOfListOfShape it(b_input);
|
||||
for (; it.More(); it.Next()) {
|
||||
b.Append(unify(it.Value(), fuzziness));
|
||||
Logger::Message(
|
||||
Logger::Root().Message(
|
||||
Logger::LOG_DEBUG, "GEO", 128,
|
||||
"Simplified operand B from "s +
|
||||
std::to_string(count(it.Value(), TopAbs_FACE)) +
|
||||
@@ -925,7 +925,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::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);
|
||||
}
|
||||
}
|
||||
@@ -936,7 +936,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::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);
|
||||
}
|
||||
}
|
||||
@@ -947,7 +947,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::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);
|
||||
}
|
||||
}
|
||||
@@ -961,21 +961,21 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (b.Extent() == 0) {
|
||||
Logger::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::Verbosity()) {
|
||||
if (!is_2d && Logger::LOG_NOTICE >= Logger::Root().Verbosity()) {
|
||||
PERF("preliminary manifoldness check");
|
||||
|
||||
if (!a.IsNull()) {
|
||||
Logger::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");
|
||||
}
|
||||
|
||||
TopTools_ListIteratorOfListOfShape it(b);
|
||||
for (int i = 0; it.More(); it.Next(), ++i) {
|
||||
Logger::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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
const double fuzz = (std::min)(min_length_orig / 3., fuzziness);
|
||||
|
||||
Logger::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;
|
||||
@@ -1049,7 +1049,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (is_extrusion_a) {
|
||||
Logger::Notice("GEO", 136, "Operand A 1/1 is an extrusion");
|
||||
Logger::Root().Notice("GEO", 136, "Operand A 1/1 is an extrusion");
|
||||
|
||||
TopTools_ListIteratorOfListOfShape it(b);
|
||||
for (int nb = 1; it.More(); it.Next(), ++nb) {
|
||||
@@ -1065,10 +1065,10 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
if (is_extrusion_b) {
|
||||
Logger::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::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;
|
||||
@@ -1108,23 +1108,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::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::Notice("GEO", 140, "Processed fully in 2D");
|
||||
Logger::Root().Notice("GEO", 140, "Processed fully in 2D");
|
||||
result = mp.Shape();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
Logger::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::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::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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1146,7 +1146,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::Notice("GEO", 144, "Builder reports self-intersection in output");
|
||||
Logger::Root().Notice("GEO", 144, "Builder reports self-intersection in output");
|
||||
success = false;
|
||||
|
||||
/*
|
||||
@@ -1160,7 +1160,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::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;
|
||||
@@ -1174,7 +1174,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
fix.Perform();
|
||||
r = fix.Shape();
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 146, "Shape healing failed on boolean result");
|
||||
Logger::Root().Error("GEO", 146, "Shape healing failed on boolean result");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1185,7 +1185,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
success = ana.IsValid() != 0;
|
||||
|
||||
if (!success) {
|
||||
Logger::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;
|
||||
@@ -1215,7 +1215,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
|
||||
dump(r);
|
||||
|
||||
Logger::Notice("GEO", 148, str.str());
|
||||
Logger::Root().Notice("GEO", 148, str.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1335,7 +1335,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::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.
|
||||
@@ -1381,7 +1381,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::Notice("GEO", 150, str.str());
|
||||
Logger::Root().Notice("GEO", 150, str.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1390,7 +1390,7 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
}
|
||||
|
||||
} else {
|
||||
Logger::Notice("GEO", 151, "Boolean operation yields non-manifold result");
|
||||
Logger::Root().Notice("GEO", 151, "Boolean operation yields non-manifold result");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1400,7 +1400,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::Error("GEO", 152, "Invalid operands. Using first operand");
|
||||
Logger::Root().Error("GEO", 152, "Invalid operands. Using first operand");
|
||||
result = a;
|
||||
success = true;
|
||||
}
|
||||
@@ -1413,14 +1413,14 @@ bool IfcGeom::util::boolean_operation(const boolean_settings& settings, const To
|
||||
#endif
|
||||
std::string str_str = str.str();
|
||||
if (str_str.size()) {
|
||||
Logger::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::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::Error("GEO", 155, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
Logger::Root().Error("GEO", 89, "Non-positive extrusion height encountered for:", extrusion->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace {
|
||||
} else if (crv_or_wire.which() == 2) {
|
||||
// @todo
|
||||
const double precision_ = 1.e-5;
|
||||
Logger::Warning("GEO", 156, "Approximating BasisCurve due to possible discontinuities", i->instance);
|
||||
Logger::Root().Warning("GEO", 156, "Approximating BasisCurve due to possible discontinuities", i->instance);
|
||||
const auto& w = boost::get<TopoDS_Wire>(crv_or_wire);
|
||||
#if OCC_VERSION_HEX < 0x70600
|
||||
BRepAdaptor_CompCurve cc(w, true);
|
||||
@@ -289,12 +289,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::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::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;
|
||||
}
|
||||
|
||||
@@ -315,11 +315,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::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::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;
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
};
|
||||
TopTools_ListOfShape results;
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) {
|
||||
Logger::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);
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
}
|
||||
|
||||
if (fd.wires().empty()) {
|
||||
Logger::Warning("GEO", 162, "Face with no boundaries", face->instance);
|
||||
Logger::Root().Warning("GEO", 162, "Face with no boundaries", face->instance);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -404,7 +404,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::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()) {
|
||||
@@ -457,7 +457,7 @@ bool OpenCascadeKernel::convert(const taxonomy::face::ptr face, TopoDS_Shape& re
|
||||
kt.Value().Original().ToUTF8CString(c);
|
||||
std::string message = c;
|
||||
delete[] c;
|
||||
Logger::Warning("GEO", 164, message, face->instance);
|
||||
Logger::Root().Warning("GEO", 164, message, face->instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,17 +469,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::Error("UNS", 7, "Unsupported output from face healing");
|
||||
Logger::Root().Error("UNS", 7, "Unsupported output from face healing");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger::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::Error("GEO", 165, "Internal error in face creation");
|
||||
Logger::Root().Error("GEO", 165, "Internal error in face creation");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@@ -520,14 +520,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::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::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::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;
|
||||
@@ -205,7 +205,7 @@ IfcGeom::OpenCascadeKernel::faceset_helper::faceset_helper(
|
||||
}
|
||||
|
||||
if (duplicates_.size() || loops_removed || (non_manifold && shell->closed.get_value_or(false))) {
|
||||
Logger::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");
|
||||
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 +276,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::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 {
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
Logger::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;
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ bool IfcGeom::util::apply_folded_layerset(const ConversionResults& items, const
|
||||
if (s.ShapeType() == TopAbs_SHELL) {
|
||||
shells.Append(TopoDS::Shell(s));
|
||||
} else {
|
||||
Logger::Error("GEO", 172, "Expected shell type in layerset processing");
|
||||
Logger::Root().Error("GEO", 172, "Expected shell type in layerset processing");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -433,12 +433,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::Error("GEO", 173, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 173, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 174, "Unknown error performing fixes");
|
||||
Logger::Root().Error("GEO", 174, "Unknown error performing fixes");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::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;
|
||||
@@ -448,7 +448,7 @@ bool IfcGeom::util::split_solid_by_shell(const TopoDS_Shape& input, const TopoDS
|
||||
}
|
||||
|
||||
if (is_null[0] || is_null[1]) {
|
||||
Logger::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,7 +83,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
|
||||
if (non_polygonal) {
|
||||
if (loft->children.size() < 2) {
|
||||
Logger::Error("GEO", 177, "Not enough sections to loft");
|
||||
Logger::Root().Error("GEO", 177, "Not enough sections to loft");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ 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::Error("GEO", 178, "Inconsistent number of wires in sections");
|
||||
Logger::Root().Error("GEO", 178, "Inconsistent number of wires in sections");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loft::ptr loft, TopoDS_Shape& re
|
||||
*/
|
||||
|
||||
if (shps.size() < 2) {
|
||||
Logger::Error("GEO", 179, "Not enough sections to loft");
|
||||
Logger::Root().Error("GEO", 179, "Not enough sections to loft");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace {
|
||||
} else {
|
||||
// @todo
|
||||
const double precision_ = 1.e-5;
|
||||
Logger::Warning("GEO", 180, "Approximating BasisCurve due to possible discontinuities", e->instance);
|
||||
Logger::Root().Warning("GEO", 180, "Approximating BasisCurve due to possible discontinuities", e->instance);
|
||||
const auto& w = boost::get<TopoDS_Wire>(crv_or_wire);
|
||||
#if OCC_VERSION_HEX < 0x70600
|
||||
BRepAdaptor_CompCurve cc(w, true);
|
||||
@@ -266,7 +266,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
|
||||
}
|
||||
|
||||
if (converted_segments.Extent() == 0) {
|
||||
Logger::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;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,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::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::Root().Error("GEO", 194, e);
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Error("GEO", 195, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 195, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 196, "Unknown error creating face");
|
||||
Logger::Root().Error("GEO", 196, "Unknown error creating face");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 197, "Unknown error creating face");
|
||||
Logger::Root().Error("GEO", 197, "Unknown error creating face");
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
Logger::Message(Logger::LOG_WARNING, "GEO", 198, "Failed to convert face:", face->instance);
|
||||
Logger::Root().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::Root().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::Root().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::Root().Warning("GEO", 201, "Ignored shell", s->instance);
|
||||
}
|
||||
}
|
||||
if (!S.IsNull()) {
|
||||
|
||||
@@ -130,7 +130,7 @@ 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");
|
||||
Logger::Root().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::Root().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::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::Warning("GEO", 204, "Self-intersecting Directrix");
|
||||
Logger::Root().Warning("GEO", 204, "Self-intersecting Directrix");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,12 +116,12 @@ bool IfcGeom::util::create_edge_over_curve_with_log_messages(const Handle_Geom_C
|
||||
}
|
||||
}
|
||||
if (dmin == std::numeric_limits<double>::infinity()) {
|
||||
Logger::Error("GEO", 205, "No extrema for point");
|
||||
Logger::Root().Error("GEO", 205, "No extrema for point");
|
||||
} else if (dmin > eps2) {
|
||||
Logger::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::Error("GEO", 207, "Failed to calculate extrema for point");
|
||||
Logger::Root().Error("GEO", 207, "Failed to calculate extrema for point");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,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::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;
|
||||
}
|
||||
|
||||
@@ -199,28 +199,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::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::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::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::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::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::Error("GEO", 214, "Failed to join curve segments:", inst_);
|
||||
Logger::Root().Error("GEO", 214, "Failed to join curve segments:", inst_);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,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::Warning("GEO", 215, "Degenerate face boundary in normal estimation");
|
||||
Logger::Root().Warning("GEO", 215, "Degenerate face boundary in normal estimation");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
|
||||
auto it = mapping.find(uvnodes[k]);
|
||||
if (it == mapping.end()) {
|
||||
Logger::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;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ IfcGeom::util::triangulate_wire_result IfcGeom::util::triangulate_wire(const std
|
||||
}
|
||||
faces.Append(triangle_face);
|
||||
} else {
|
||||
Logger::Error("GEO", 217, "Internal error: missing face");
|
||||
Logger::Root().Error("GEO", 217, "Internal error: missing face");
|
||||
return TRIANGULATE_WIRE_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,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::Error("GEO", 218, "Internal error, missing edge from triangulation");
|
||||
Logger::Root().Error("GEO", 218, "Internal error, missing edge from triangulation");
|
||||
non_manifold = true;
|
||||
}
|
||||
}
|
||||
@@ -319,7 +319,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::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;
|
||||
}
|
||||
}
|
||||
@@ -790,12 +790,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::Error("GEO", 220, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 220, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 221, "Unknown error creating solid");
|
||||
Logger::Root().Error("GEO", 221, "Unknown error creating solid");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 222, "Unknown error creating solid");
|
||||
Logger::Root().Error("GEO", 222, "Unknown error creating solid");
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -808,12 +808,12 @@ bool IfcGeom::util::convert_curve_to_wire(const Handle(Geom_Curve)& curve, TopoD
|
||||
return true;
|
||||
} catch (const Standard_Failure& e) {
|
||||
if (e.GetMessageString() && strlen(e.GetMessageString())) {
|
||||
Logger::Error("GEO", 223, e.GetMessageString());
|
||||
Logger::Root().Error("GEO", 223, e.GetMessageString());
|
||||
} else {
|
||||
Logger::Error("GEO", 224, "Unknown error converting curve to wire");
|
||||
Logger::Root().Error("GEO", 224, "Unknown error converting curve to wire");
|
||||
}
|
||||
} catch (...) {
|
||||
Logger::Error("GEO", 225, "Unknown error converting curve to wire");
|
||||
Logger::Root().Error("GEO", 225, "Unknown error converting curve to wire");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -834,7 +834,7 @@ void IfcGeom::util::assert_closed_wire(TopoDS_Wire& wire, double tol) {
|
||||
wire = mw.Wire();
|
||||
}
|
||||
|
||||
Logger::Warning("GEO", 226, "Wire not closed");
|
||||
Logger::Root().Warning("GEO", 226, "Wire not closed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ bool IfcGeom::util::convert_wire_to_face(const TopoDS_Wire& w, TopoDS_Face& face
|
||||
TopTools_ListOfShape results;
|
||||
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(wire, results, settings)) {
|
||||
Logger::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);
|
||||
}
|
||||
|
||||
@@ -875,7 +875,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::Error("GEO", 228, "Failed to create face.");
|
||||
Logger::Root().Error("GEO", 228, "Failed to create face.");
|
||||
return false;
|
||||
}
|
||||
face = mf.Face();
|
||||
@@ -902,7 +902,7 @@ bool IfcGeom::util::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compound&
|
||||
|
||||
TopTools_ListOfShape results;
|
||||
if (settings.use_wire_intersection_check && util::wire_intersections(w, results, settings)) {
|
||||
Logger::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);
|
||||
@@ -928,7 +928,7 @@ bool IfcGeom::util::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compound&
|
||||
BRepBuilderAPI_FaceError er = mf.Error();
|
||||
|
||||
if (er != BRepBuilderAPI_FaceDone) {
|
||||
Logger::Error("GEO", 230, "Failed to create face.");
|
||||
Logger::Root().Error("GEO", 230, "Failed to create face.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -945,7 +945,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::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