ThruSections along closed path: continuity broken
Hello,
Currently I am trying to build some surfaces by sweeping some circles along closed paths. When using ThruSections, there is a discontinuity when closing the loop as can be seen on the png file attached. The short and commented .geo file which I used to draw this picture is attached as well. Is there a parameter to tune to avoid this kind of beading ?
Thanks a lot for any clue.
Gilles
// -----------------------------------------------------------------------------
//
// Gmsh GEO : Crêpe curve (https://mathcurve.com/courbes3d/crepe/crepe.shtml)
// Parametric equations:
// x = a cos(theta)
// y = a sin(theta)
// z = b sin(2 theta)
//
// -----------------------------------------------------------------------------
// The OpenCASCADE geometry kernel supports several useful features for solid
// modelling.
SetFactory("OpenCASCADE");
Geometry.SurfaceType = 2;
Geometry.OCCAutoEmbed = 1;
a = 3; // cylinder radius
b = 2; // other radius for crêpe curve of type 1
radius = 0.5; // pipe radius for surface
npts = 50; // number of points along curve
dtheta = 2*Pi/(npts);
c = newl; ll = newll;
For i In {0 : npts-1}
thetam = i * dtheta; // Segment i start angle
thetap = (i + 1) * dtheta; // Segment i end angle
// Computes unit vector along segment i
nx = a * ( Cos(thetap) - Cos(thetam) );
ny = a * ( Sin(thetap) - Sin(thetam) );
nz = b * ( Sin(2*thetap) - Sin(2*thetam) );
norm = Sqrt( nx * nx + ny * ny + nz * nz);
nx = nx / norm;
ny = ny / norm;
nz = nz / norm;
// Computes unit vector spherical angles
ph = Atan2(ny, nx);
th = Acos(nz);
// Creates a circle, rotates and translates it such that it becomes
// orthogonal to segment i at its starting point.
Circle(c+i) = {0,0,0, 0.5};
Translate {a * Cos(thetam), a * Sin(thetam), b * Sin(2 * thetam)} { Rotate{{0,0,1}, {0,0,0}, ph}{Rotate {{0,1,0}, {0,0,0}, th}{ Curve{c+i}; } } }
Curve Loop(ll+i) = c+i;
EndFor
// Attributes the first cirle at the last segment end point in order to close the crêpe curve
Curve Loop(ll+npts) = c;
// Builds the surface joining all circles
Ruled ThruSections{ll:ll+npts}
// We increase the number of sub-edges for a nicer display of the geometry:
Geometry.NumSubEdges = 1000;
// We can activate the calculation of mesh element sizes based on curvature
// (here with a target of 20 elements per 2*Pi radians):
Mesh.MeshSizeFromCurvature = 20;
// We can constraint the min and max element sizes to stay within reasonnable
// values (see `t10.geo' for more details):
Mesh.MeshSizeMin = 0.001;
Mesh.MeshSizeMax = 0.3;
Edited by Christophe Geuzaine