Part: Create CompSolid/Compound/Shell if null before adding a sub-shape

Creating a shape with Part.CompSolid(), Part.Compound() or Part.Shell() is a null shape. In order to allow to append sub-shapes with the add()
method a valid shape must be created beforehand.

This fixes #13208
This commit is contained in:
wmayer
2024-04-27 08:20:29 +02:00
committed by Yorik van Havre
parent 5ba93dd9f0
commit 1febe5cde8
3 changed files with 11 additions and 0 deletions

View File

@@ -140,6 +140,9 @@ PyObject* TopoShapeShellPy::add(PyObject *args)
BRep_Builder builder;
TopoDS_Shape shell = getTopoShapePtr()->getShape();
if (shell.IsNull()) {
builder.MakeShell(TopoDS::Shell(shell));
}
try {
const TopoShape& shape = *static_cast<TopoShapeFacePy*>(obj)->getTopoShapePtr();