I have this gmsh script to create a spiral and a cross-sectional profile:
SetFactory("OpenCASCADE");
// Profile Dimensions
l = 0.005;
angle = 5;
dx = Atan(angle*Pi/180)*l;
// Mesh
Point(1) = {-l/2, -l/2, 0, 1.0};
Point(2) = {l/2, -l/2, 0, 1.0};
Point(3) = {-l/2 -dx, l/2, 0, 1.0};
Point(4) = {l/2 +dx, l/2, 0, 1.0};
Point(5) = {0, 0, 0, 1.0};
Line(1) = {3, 4}; Line(2) = {4, 2};
Line(3) = {2, 1}; Line(4) = {1, 3};
// Spiral information
initial_radius = 0.015;
n_turns = 4;
final_radius = 0.1;
b = (final_radius - initial_radius)/(2*Pi*n_turns);
start_theta = Pi/2 ;
end_theta = 2*Pi*n_turns;
N = 100;
x_first = 0;
z_first = 0;
For i In {0:N}
s = start_theta + i*(end_theta-start_theta)/N;
x = (initial_radius + b*s)*Cos(s);
y = 0;
z = (initial_radius + b*s)*Sin(s);
pi = newp;
Point(pi) = {x, y, z, 1.0};
If (i == 0)
x_first = x;
z_first = z;
EndIf
EndFor
Rotate {{0, 1, 0}, {0, 0, 0}, Pi/2} {
Line{1:4}; Point{5};
}
Translate {0, 0, z_first} {
Line{1:4}; Point{5};
}
Curve Loop(1) = {4, 1, 2, 3};
Plane Surface(1) = {1};
Transfinite Curve {1, 4, 3, 2} = 10 Using Progression 1;
Transfinite Surface {1};
Recombine Surface {1};
li = newc;
Spline(li) = {6:N+6};
wi = newreg;
Wire(wi) = {li};
Extrude { Surface{1}; } Using Wire {wi}
I would like to extrude the cross-sectional profile along the path, [sweep the 2D mesh] but I am not able to do it. If I try to put Layers{200}
in the extrude command I get an error saying: Boundary Layer extrusion not available with OpenCASCADE geometry Kernel
.
I did not find any example online doing this, so I would appreciate some help.
Best Regards