mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Added '--no-wire-intersection-check'
This commit is contained in:
committed by
Thomas Krijnen
parent
2829a0764b
commit
c9c6529978
@@ -224,6 +224,7 @@ private:
|
||||
double modelling_precision;
|
||||
double dimensionality;
|
||||
double layerset_first;
|
||||
double no_wire_intersection_check;
|
||||
|
||||
// For stopping PlacementRelTo recursion in convert(const IfcSchema::IfcObjectPlacement* l, gp_Trsf& trsf)
|
||||
const IfcParse::declaration* placement_rel_to;
|
||||
@@ -256,6 +257,7 @@ public:
|
||||
, faceset_helper_(nullptr)
|
||||
, layerset_first(-1.)
|
||||
, disable_boolean_result(-1.)
|
||||
, no_wire_intersection_check(-1)
|
||||
{}
|
||||
|
||||
MAKE_TYPE_NAME(Kernel)(const MAKE_TYPE_NAME(Kernel)& other)
|
||||
|
||||
@@ -1157,7 +1157,12 @@ bool IfcGeom::Kernel::convert_wire_to_faces(const TopoDS_Wire& w, TopoDS_Compoun
|
||||
}
|
||||
|
||||
TopTools_ListOfShape results;
|
||||
results.Append(w);
|
||||
if (getValue(GV_NO_WIRE_INTERSECTION_CHECK) < 0. && wire_intersections(w, results)) {
|
||||
Logger::Warning("Self-intersections with " + boost::lexical_cast<std::string>(results.Extent()) + " cycles detected");
|
||||
} else {
|
||||
results.Clear();
|
||||
results.Append(w);
|
||||
}
|
||||
|
||||
TopoDS_Compound C;
|
||||
BRep_Builder B;
|
||||
@@ -1410,6 +1415,9 @@ void IfcGeom::Kernel::setValue(GeomValue var, double value) {
|
||||
case GV_DISABLE_BOOLEAN_RESULT:
|
||||
disable_boolean_result = value;
|
||||
break;
|
||||
case GV_NO_WIRE_INTERSECTION_CHECK:
|
||||
no_wire_intersection_check = value;
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Invalid setting");
|
||||
}
|
||||
@@ -1439,6 +1447,8 @@ double IfcGeom::Kernel::getValue(GeomValue var) const {
|
||||
return layerset_first;
|
||||
case GV_DISABLE_BOOLEAN_RESULT:
|
||||
return disable_boolean_result;
|
||||
case GV_NO_WIRE_INTERSECTION_CHECK:
|
||||
return no_wire_intersection_check;
|
||||
}
|
||||
throw std::runtime_error("Invalid setting");
|
||||
}
|
||||
|
||||
@@ -1003,6 +1003,12 @@ namespace IfcGeom {
|
||||
? +1.0
|
||||
: -1.0
|
||||
);
|
||||
kernel.setValue(IfcGeom::Kernel::GV_NO_WIRE_INTERSECTION_CHECK,
|
||||
settings.get(IteratorSettings::NO_WIRE_INTERSECTION_CHECK)
|
||||
? +1.0
|
||||
: -1.0
|
||||
);
|
||||
|
||||
kernel.setValue(IfcGeom::Kernel::GV_DISABLE_BOOLEAN_RESULT,
|
||||
settings.get(IteratorSettings::DISABLE_BOOLEAN_RESULT)
|
||||
? +1.0
|
||||
|
||||
@@ -94,8 +94,11 @@ namespace IfcGeom
|
||||
EDGE_ARROWS = 1 << 19,
|
||||
/// Disables the evaluation of IfcBooleanResult and simply returns FirstOperand
|
||||
DISABLE_BOOLEAN_RESULT = 1 << 20,
|
||||
// Disables wire intersection checks
|
||||
NO_WIRE_INTERSECTION_CHECK = 1 << 21,
|
||||
|
||||
/// Number of different setting flags.
|
||||
NUM_SETTINGS = 20
|
||||
NUM_SETTINGS = 21,
|
||||
};
|
||||
/// Used to store logical OR combination of setting flags.
|
||||
typedef unsigned SettingField;
|
||||
|
||||
Reference in New Issue
Block a user