Pipe Cutting

Hello

I am a student busy with a project.

I need to use OCC to bring pipes together in a 3D viewer forming a join typically used for construction.
So what needs to happen is that the 3D models will intersect, then all overlapping bits of the pipes need to be discarded leaving an area where the pipes meet where they will perfectly fit together for soldering and so on.

I have checked out the BRepAlgoAPI_BooleanOperation classes to see what effects they have on the pipes which intersect, but so far the functionality they provide aren't what I need. Will I be needing a combination of boolean operations to achieve success?

Could someone please assist me by giving me a nudge in the right direction. Also please ask if I have not described the problem well enough, I will then try to provide more information.

Thanks for the assistance in advance.

Regards
Jacques Coetzee

Jacques Coetzee's picture

Here is a picture to provide some clarity on the matter.

Attachments: 
Jacques Coetzee's picture

Ok, so I have further analysed the problem and I have formulated a less ambiguous and more direct question.

After having a look at the picture example I uploaded, one will see that a cut needs to be made from that outer-wall to the inner-wall of each pipe all along where the two or more pipes intersect and the rest needs to be discarded for each pipe.

Is there a library which can do this sort of thing
or will I have to build my own algorithm from the
binary operations provided?

AP's picture

Hi Jacques,

guessing from your image.

I would advise to do the following:

1-generate two solid pipes
2-do a Boolean common operation between the two solid pipes.
3-do a shell operator on the Boolean result, removing the start and end caps of the solid pipes.

solid pipe: look into sweeps (BRepOffsetAPI_MakePipeShell use the makesolid() to generate solid)
use a circle as crossection.

boolean common,do something like :

BOPAlgo_BOP aBOP;
aBOP.AddArgument(Stock);
aBOP.AddTool(Tool);
aBOP.SetOperation(BOPAlgo_COMMON);
aBOP.Perform();
Result = aBOP.Shape();

Shell: myBody = BRepOffsetAPI_MakeThickSolid(myBody , facesToRemove , thickness , 1.e-3);

make sure facestoremove is a TopTools_ListOfShape of the start and end cap surfaces of the solid pipes.

an easy way to get the caps would be to explore the solids and get the first two faces with the least surface area, as long as the pipes are longer than the radius it should work.

good luck on your busy project.

Cheers