Combine two models with some strange problems

I creat a model A in SegmentEditor,

then I import a stl file B into slicer and export A to model ,

then I combine them with vtkAppendPolyData.

I get the model C

However when I import C into another software, magics, it tell me there are two shells.

Why?

vtkAppendPolyData just adds the list of points and surfaces together without resolving the geometry, so what you describe makes sense. Probably you need to cut and combine the surfaces. Exactly how you do that depends on what features you need to preserve in the data, but one option would be to convert both models to labelmap representation, combine them with logical operations in the segment editor, and then re-mesh to a single polydata.

The other option (staying on the surface domain) it’s to use the Combine Models module from the sandbox extension

Hope it helps

In fact ,Combine Models is based on the vtkAppendPolyData. Model A is designed by SegmentEditor , Model B is designed by Blender.

Thank you for your answer,Mr Pieper,

as you see, it is a standard rectangle model ,

if I import it into SegmentEditor, add them by Logical tool ,then export Model C ,the shape will be changed, especially the rectangle part

To preserve the original shape you need to do a mesh-based boolean operation. I don’t do that myself much, but if you search for vtkbool and Slicer you will find a lot of discussion about when it works well and when it may have trouble with meshes. Maybe someone else can chime in with their experiences.

1 Like

Combine Models module in Sandbox extension does not use vtkAppendPolyData, but it performs proper Boolean operations using vtkbool package. Advantage of this method is that all details of the input meshes are preserved. Disadvantage is that even though vtkbool is a quite robust package, in some special cases it may still fail.

You can set arbitrarily small spacing as segmentation geometry and then there will be no perceivable shape change. Disadvantage of this method is that memory need and computation time can increase very steeply as you reduce the spacing. The advantage of this method is that it works correctly every time - there are no problematic special cases.