diff --git a/src/ifcgeom/mapping/IfcCompositeCurve.cpp b/src/ifcgeom/mapping/IfcCompositeCurve.cpp index dba438e6d6..72b099954c 100644 --- a/src/ifcgeom/mapping/IfcCompositeCurve.cpp +++ b/src/ifcgeom/mapping/IfcCompositeCurve.cpp @@ -106,90 +106,3 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve& inst) { return pwf; } } - -/* - -#include -#include -#include -#include -#include -#include "mapping.h" -#include "../ifcgeom_schema_agnostic/wire_builder.h" - -#define _USE_MATH_DEFINES -#define mapping POSTFIX_SCHEMA(mapping) - -taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve* l, TopoDS_Wire& wire) { - - - TopTools_ListOfShape converted_segments; - - for (auto it = segments->begin(); it != segments->end(); ++it) { - - if (!(*it)->declaration().is(IfcSchema::IfcCompositeCurveSegment::Class())) { - ifcopenshell::logger::root().error("Not implemented", *it); - return false; - } - - IfcSchema::IfcCurve* curve = ((IfcSchema::IfcCompositeCurveSegment*)(*it))->ParentCurve(); - - // The type of ParentCurve is IfcCurve, but the documentation says: - // ParentCurve: The *bounded curve* which defines the geometry of the segment. - // At least let's exclude IfcLine as an infinite linear segment - // definitely does not make any sense. - TopoDS_Wire segment; - - if (curve->as()) { - ifcopenshell::logger::root().notice("Infinite IfcLine used as ParentCurve of segment, treating as a segment", *it); - Handle_Geom_Curve handle; - convert_curve(curve, handle); - double u0 = 0.0; - double u1 = curve->as()->Dir()->Magnitude() * length_unit_; - if (u1 < getValue(GV_PRECISION)) { - ifcopenshell::logger::root().warning("Segment length below tolerance", *it); - } - BRepBuilderAPI_MakeEdge me(handle, u0, u1); - if (me.IsDone()) { - BRep_Builder B; - B.MakeWire(segment); - B.Add(segment, me.Edge()); - } - } else if (!convert_wire(curve, segment)) { - const bool failed_on_purpose = curve->as() && !segment.IsNull(); - ifcopenshell::logger::root().message(failed_on_purpose ? ifcopenshell::logger::LOG_WARNING : ifcopenshell::logger::LOG_ERROR, "Failed to convert curve:", curve); - continue; - } - - if (!((IfcSchema::IfcCompositeCurveSegment*)(*it))->SameSense()) { - segment.Reverse(); - } - - ShapeFix_ShapeTolerance FTol; - FTol.SetTolerance(segment, getValue(GV_PRECISION), TopAbs_WIRE); - - converted_segments.append(segment); - - } - - if (converted_segments.Extent() == 0) { - ifcopenshell::logger::root().message(ifcopenshell::logger::LOG_ERROR, "No segment successfully converted:", l); - return false; - } - - BRepBuilderAPI_MakeWire w; - TopoDS_Vertex wire_first_vertex, wire_last_vertex, edge_first_vertex, edge_last_vertex; - - TopTools_ListIteratorOfListOfShape it(converted_segments); - - std::vector profile = inst.data().get_inverse(&IfcSchema::IfcProfileDef::Class(), -1); - const bool force_close = profile && profile->size() > 0; - - util::wire_builder bld(getValue(GV_PRECISION), l); - util::shape_pair_enumerate(it, bld, force_close); - wire = bld.wire(); - - return true; -} - -*/