Added '--no-wire-intersection-check'

This commit is contained in:
Jesse Vander Does
2021-02-05 14:00:23 -06:00
committed by Thomas Krijnen
parent 2829a0764b
commit c9c6529978
6 changed files with 29 additions and 4 deletions
+4 -1
View File
@@ -339,7 +339,8 @@ int main(int argc, char** argv) {
("default-material-file", new po::typed_value<path_t, char_t>(&default_material_filename),
"Specifies a material file that describes the material object types will have"
"if an object does not have any specified material in the IFC file.")
("validate", "Checks whether geometrical output conforms to the included explicit quantities.");
("validate", "Checks whether geometrical output conforms to the included explicit quantities.")
("no-wire-intersection-check", "Skip wire intersection check");
std::string bounds;
#ifdef HAVE_ICU
@@ -481,6 +482,7 @@ int main(int argc, char** argv) {
const bool generate_uvs = vmap.count("generate-uvs") != 0;
const bool validate = vmap.count("validate") != 0;
const bool edge_arrows = vmap.count("edge-arrows") != 0;
const bool no_wire_intersection_check = vmap.count("no-wire-intersection-check") != 0;
if (!quiet || vmap.count("version")) {
print_version();
@@ -741,6 +743,7 @@ int main(int argc, char** argv) {
settings.set(IfcGeom::IteratorSettings::SITE_LOCAL_PLACEMENT, site_local_placement);
settings.set(IfcGeom::IteratorSettings::BUILDING_LOCAL_PLACEMENT, building_local_placement);
settings.set(IfcGeom::IteratorSettings::VALIDATE_QUANTITIES, validate);
settings.set(IfcGeom::IteratorSettings::NO_WIRE_INTERSECTION_CHECK, no_wire_intersection_check);
settings.set(SerializerSettings::USE_ELEMENT_NAMES, use_element_names);
settings.set(SerializerSettings::USE_ELEMENT_GUIDS, use_element_guids);
+2
View File
@@ -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)
+11 -1
View File
@@ -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
+4 -1
View File
@@ -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;
+2 -1
View File
@@ -54,7 +54,8 @@ namespace IfcGeom {
// Whether to process shapes of type Face or higher (1) Wire or lower (-1) or all (0)
GV_DIMENSIONALITY,
GV_LAYERSET_FIRST,
GV_DISABLE_BOOLEAN_RESULT
GV_DISABLE_BOOLEAN_RESULT,
GV_NO_WIRE_INTERSECTION_CHECK
};
Kernel(IfcParse::IfcFile* file_ = 0);