I am using the version 2020 of eyeshot.
There is a function called CutBy which cuts a mesh by a surface and it works fine.
The problem is getting the surface. For exemple, from a solid or a mesh, how to create a surface.
For exemple, I have a solid which intersects another solid. I need the difference but the Solid.Difference method gives only one part of the cut solid. Unfortunately I need the other part.
I can get the intersection via the Solid.Intersection method. I can cut the solid by the intersection's surface but I couldn't find how to get a surface of a solid.
Briefly, the question is how to get a surface or a region object from a solid to call the Solid.Cutby(surface.Plane) method.
Here is what I did :
var template = sceneLeft.Entities[0] as Mesh;
var piece = sceneLeft.Entities[1] as Mesh;
var solidT = template.ConvertToSolid();
var solidP = piece.ConvertToSolid();
var diff1 = Solid.Difference(solidT, solidP);
var diff2 = Solid.Difference(solidP, solidT);
var intersection = Solid.Intersection(solidT, solidP);
diff1[0].Color = System.Drawing.Color.LightGray;
diff2[0].Color = System.Drawing.Color.LightGray;
diff1[0].ColorMethod = colorMethodType.byEntity;
diff2[0].ColorMethod = colorMethodType.byEntity;
diff1[0].EntityData = "base";
diff2[0].EntityData = "piece";
sceneLeft.Entities.Clear();
//sceneLeft.Entities.Add(diff1[0]);
//sceneLeft.Entities.Add(piece);
sceneLeft.Entities.Add(diff2[0]); //diff2 is returns only one solid and not the part that I need.
//sceneLeft.Entities.Add(intersection[0]);
//diff2[0].Scale(1.02, 1.02, 1.02);
//var diff3 = Solid.Difference(intersection[0], solidT);
//sceneLeft.Entities.Add(diff3[0]);
sceneLeft.Entities.Regen();
sceneLeft.Invalidate();
Thanks in advance.