I am working on a research project where I need to create meshes of fiber models to test some stuff later. For that, I'm trying to make an extrusion along a spline in gmsh python module and I don't what is the syntax for that to write the code. Is it even possible to do that in the gmsh python module or only just in the open cascade kernel in gmsh?
I was successfully able to generate an extrusion along a random spline in the open cascade kernel in gmsh but I want to replicate that in python to create fibers meshes of the real data. It would be greatly appreciated if anyone can help with that. I think all I'm having trouble with is what the syntax for that would be if it's even possible to do that in the gmsh python module.
But here is the code for extruding along a wire directly on gmsh:
SetFactory("OpenCASCADE");
//adding points
Point(1) = {-0, -0.1, 0, 1.0};
Point(2) = {0.4, -0.1, 0, 1.0};
Point(3) = {0.8, -0.1, 0, 1.0};
Point(4) = {1.3, -0.1, 0, 1.0};
Point(5) = {2.2, -0.5, 0, 1.0};
Point(6) = {2.8, -0, 0, 1.0};
Point(7) = {4.2, -0.9, 0, 1.0};
Point(8) = {6.5, 0.6, 0, 1.0};
//creating a spline
Spline(1) = {1, 2, 3, 4, 5, 6, 7, 8};
arc= newl; Spline(arc)={1,2,3,4,5,6,7,8};
//rotating the spline 90 degrees
Rotate {{0, 1, 0}, {0, 0, 0}, Pi/2} {Curve{arc};}
//creating a disk at the 1st point
Disk(1) = {0, -0.1, 0, 0.1};
//making the arc a wire
Wire(10) = arc;
//extruding surface{1} aka Disk(1) along wire
Try1() = Extrude { Surface{1}; } Using Wire {10};
//deleting initial points and spline
Recursive Delete {Curve{1};}
Recursive Delete {Point{2}; Point{3}; Point{4}; Point{5}; Point{6}; Point{7};}