compsolid from two solids ?

Hi !
My question has already been posted 3 years ago by someone else, but not been answered
So I just paste it here again, in case somebody could help now:
Hi: I am trying to create a compsolid out of 2
boxes sharing a face, typically:
box b1 0 0 0 1 1 1 box b2 1 0 0 1 1 1
I don't see anything in the test harness manual
that would tell me how to make a compsolid from
those 2 boxes. How do you do it ? I really want
the common surface to be shared.
Everything I tried creates a compound, and I
don't think the compound shape considers the
surface to be shared unless I am very mistaken.
Please, help ! Thanks, hugues -

Jeanmi B's picture

Hello Thomas,

One way to create a compsolid is using BRepFill_Pipe.
Here is an example using test harness to achieve the result you want :

1/ create the profile as a shell composed of two parallel faces

box b 0 0 0 1 1 1
explode b f
rename b_1 first
rename b_2 last
shape prof Sh
add first prof
add last prof
donly prof

2/ create the spine of the pipe
vertex v1 0 0 0
vertex v2 1 0 0
edge e v1 v2
wire spine e

3/ now create the pipe shape
pipe mycomp spine prof

In result you should get a compsolid composed of two box solid sharing a face.
You can verify by issuing the command "nbshapes mycomp" which answer only 10 faces (instead of 12 if you make a compound)

Regards. Jean Michel.