#1227 layer slicing

This commit is contained in:
Thomas Krijnen
2021-09-20 09:27:56 +02:00
parent 132ec473ec
commit 94c009d179
+10 -1
View File
@@ -2984,7 +2984,9 @@ namespace {
auto result_shape = split.Shape();
std::list<TopoDS_Shape> subs;
subshapes(result_shape, subs);
if (subs.size() == 1 && operands.Size() - 2 > (int)subs.size() && (subs.front().ShapeType() == TopAbs_COMPSOLID || subs.front().ShapeType() == TopAbs_COMPOUND)) {
// Sometimes there is more nesting of compounds, so when we find a single compound we again try to explode it into a list.
if (subs.size() == 1 && (subs.front().ShapeType() == TopAbs_COMPSOLID || subs.front().ShapeType() == TopAbs_COMPOUND)) {
auto s = subs.front();
subs.clear();
subshapes(s, subs);
@@ -3256,6 +3258,13 @@ bool IfcGeom::Kernel::apply_layerset(const IfcRepresentationShapeItems& items, c
operands.Append(face);
}
/*
// enable this is you want to see how IfcOpenShell has placed the layer surfaces
for (auto& x : operands) {
result.push_back(IfcRepresentationShapeItem(it->ItemId(), it->Placement(), x, nullptr));
}
*/
std::vector<TopoDS_Shape> slices;
if (split(*this, it->Shape(), operands, getValue(GV_PRECISION), slices) && slices.size() == styles.size()) {
for (size_t i = 0; i < slices.size(); ++i) {