Sinusoidal pipe

I tried searching for this on the forum. Can someone suggest how to create a sinusoidal pipe in 3D (not a helix which I found in the magnetism example). The center line of the pipe should be something like (here a is a fixed parameter)

(cos(ax), sin(ax),0)

for say 0<=x<=2 pi/a and the cross section should be a simple ellipse or disk.

Perhaps also could you suggest the right place to look for the occ commands available in NGSpy?

Thanks in advance.
Peter

I think the OpenCascade command I need is GeomFill_Pipe, but I don’t think this is in netgen.occ . In OCC, AI suggested the code below to create a pipe with constant cross section of a circle. Any suggestions how to accomplish this in netgen.occ? The use of Wire seems to produce a pipe with variable cross section.

// Create a circle representing the pipe cross-section
Handle(Geom_Circle) pipeSection = new Geom_Circle(10.0); // Radius of 10
// Create a BSpline curve defining the pipe bend path
Handle(Geom_BSplineCurve) pipePath = new Geom_BSplineCurve(…);
// Create the pipe surface
Handle(Geom_Surface) pipeSurface = new GeomFill_Pipe(pipeSection, pipePath);

Thanks
Peter

One more question: is it possible to setup periodic boundary conditions on domains defined in OCC?

Thanks
Peter

yes, it’s available also in OCC, see (a rather new section in the documentation):

https://docu.ngsolve.org/latest/i-tutorials/unit-2.12-periodicity/periodicity.html

Hi Peter,
regarding the pipe, something like this?

from netgen.occ import *
from ngsolve import *

a = 1
r = 0.2
N = 4
wp = WorkPlane()
for i in range(N):
    wp = wp.Arc(a, 90).Arc(a, -90).Arc(a, -90).Arc(a, 90)
spine = wp.Finish().Wire()
circle = WorkPlane(Axes((0,0,0), (1,0,0), (0,1,0))).Circle(r).Face()

pipe = Pipe(spine, circle)
geo = OCCGeometry(pipe)
Draw(geo)

Thanks Cristopher and Joachim. Happy holidays!