Regarding removal of subshapes

Hi, so I tried removing a few faces from TopoDS_Shape( say a closed cube in this case ) using ShapeBuild_ReShape and it removed the faces leaving the cube to be open. Now how do I join the faces to make it a closed solid? Thanks.

Gianluca Antoniacci's picture

Hello Sravan,

as far as I know, in order to build a solid you should have a closed shell, i. e. a set of adjacent faces enclosing a certain volume of space. Apart HalfSpace primitive solid, I don't think a solid can be obtained out of an open shell. Or are you perhaps asking whether it is possible to build a proper set of faces in order to re-close this partial cube of yours?

Gianluca

Sravan Chennuri's picture

Hello Gianluca, thanks for the reply. So I've added the attachments, I'm actually trying to remove the edge which is marked in the image "solid.png" so that it should look like the picture in the "Target Solid.png" image. To acheive this remove-edge functionality, I've tried removing the adjacent faces of the edge using "ShapeBuild_ReShape" and the result is looking like the solid in "Solid after remove Edge.png" image. How can I remove an edge properly and reconstruct the solid so that it is closed again? Please provide any pseudo code if you can. I'm completely new to OpenCascade. Thank you so much. 

Gianluca Antoniacci's picture

Hello Sravan,

I don't think that you'll get the Targetsolid by removing the specified edge. This, actually, will invalidate those two adjacent faces, leaving your solid open.

I don't know if your approach is good for this purpose: maybe you could think also of removing also the upper and lower faces before reshaping. Otherwise you could build a plane passing through your box corners and, by creaating a HalfSpace solid, you could remove it with a boolean operation from the whole box. This will leave a new solid that should look like the target one.

I hope this can help.

Gianluca

Sravan Chennuri's picture

Hi Gianluca, thanks for the reply. I had actually tried out a similar approach of building a plane passing through the box corners and it isn't working as expected. Is there an option atleast to just merge the adjacent faces into one face so that it looks like the target solid? Also kindly elaborate on the boolean approach that you suggested( with some code if possible ). Thank you.