I want to union two objects: non-manifold polysurface and solid
the result is that only solid is left
If explode non-manifold polysurface to surfaces and join surfaces to new polysurface which is not non-manifold, and then union these two objects, the result will be correct or expected.
It is not necessary to union objects with code, it can be replaced by using builtin command “BooleanUnion”
- 3dm file
non-manifold.3dm (109.4 KB) - code
GetObject go = new GetObject();
GetResult gr = go.GetMultiple(2, 2);
Brep brep1 = go.Objects()[0].Brep();
Brep brep2 = go.Objects()[1].Brep();
List<Brep> breps = new List<Brep>();
breps.Add(brep1);
breps.Add(brep2);
Brep[] unionedBreps = Brep.CreateBooleanUnion(breps, 0.0001);
foreach(Brep unionedBrep in unionedBreps)
{
doc.Objects.Add(unionedBrep);
}
doc.Objects.Delete(go.Objects()[0].Object());
doc.Objects.Delete(go.Objects()[1].Object());