This commit is contained in:
Thomas Krijnen
2018-08-20 11:46:26 +02:00
parent 683cadeb76
commit b13c912c47
3 changed files with 192 additions and 6 deletions
+15
View File
@@ -479,6 +479,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBooleanResult* l, TopoDS_Shape
IfcSchema::IfcBooleanOperand* operand1 = l->FirstOperand();
IfcSchema::IfcBooleanOperand* operand2 = l->SecondOperand();
bool is_halfspace = operand2->is(IfcSchema::Type::IfcHalfSpaceSolid);
bool is_unbounded_halfspace = is_halfspace && !operand2->is(IfcSchema::Type::IfcPolygonalBoundedHalfSpace);
if ( shape_type(operand1) == ST_SHAPELIST ) {
if (!(convert_shapes(operand1, items1) && flatten_shape_list(items1, s1, true))) {
@@ -524,6 +525,20 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcBooleanResult* l, TopoDS_Shape
Logger::Message(Logger::LOG_WARNING,"Empty solid for:",operand2->entity);
}
if (is_unbounded_halfspace) {
TopoDS_Shape temp;
double d;
if (fit_halfspace(s1, s2, temp, d)) {
if (d < getValue(GV_PRECISION)) {
Logger::Message(Logger::LOG_WARNING, "Subtraction yields unchanged volume:", l->entity);
shape = s1;
return true;
} else {
s2 = temp;
}
}
}
const IfcSchema::IfcBooleanOperator::IfcBooleanOperator op = l->Operator();
/*