Making pipe along curve from segments

Hello Everyone,

I have some simple example - profile is small rectangle, spine is big rectangle.

I want to build pipe along big rectangle. I use BRepOffsetAPI_MakePipe. I know it requires existence C1 on every point of spine. Nevertheless I try to build with spine as rectangle. I get good result on left and right sides of rectangle, but on top and botom it is not a pipe, it is plane. Looks like profile was not rotated to spine direction after the corner.

Is it result of abscence C1 at corners ?
What is best way to build pipes along spine with segments ?

Thanks in advance.
With respects, Eugene.

Mikhail Sazonov's picture

In order to pipe worked well each edge in the spine must be built on a G1-continuous curve. It is a quote from description of the class:
//! The MakePipe class implements pipe constructions
//! with G1 continuous spines only.

From your description I understood that your spine consists of one edge built on a C0 curve. You need to split your curve to obtain 4 edges, build a wire from them and pass it as a spine.

Eugene Zaliznyak's picture

Thank you MSV (sorry, I do not know your name).
As I understand from help - full spine must have G1, not only edges separately must have G1.
"... Warning Spine must be G1 continuous; that is, on the connection vertex of two edges of the wire, the tangent vectors on the left and on the right must have the same direction, though not necessarily the same magnitude. ..."

That means polyline doesn't meet this requirement. And as a result of abscence G1 in connection points of spine OCC algorithim doesn't correct of normal of profile to spine direction.

I wanted to understand is there any way in OCC to provide some flag or enum to connect pipe segments. For now I implemented it on my side by custom code.

Eugene Zaliznyak's picture

I have to add short message. Of course I build wire from edges and every edge is G1 continuos. My wire from polyline consists of N edges.

Mikhail Sazonov's picture

Please take a look at the neighboring class BRepOffsetAPI_MakePipeShell. It is more powerful in construction of pipes and provides many options.

Mikhail

Mikhail Sazonov's picture

The following draw script does the work:

polyline sp 0 0 0 1 0 0 1 2 0 0 2 0 0 0 0
polyline p 0.5 0 0 0.5 0.1 0.1 0.5 0 0.1 0.5 0 0
polyline p 0.5 0.1 0.1 0.5 -0.1 0.1 0.5 -0.1 -0.1 0.5 0.1 -0.1 0.5 0.1 0.1
mksweep sp
addsweep p
buildsweep r -C

Eugene Zaliznyak's picture

Thank you, Mikhail, you solved my issue!

With respects, Eugene.