Projection of geometric pattern onto a curved surface
Hello everyone,
I would like to project a sensor pattern (to keep it simple let's just take a circle) onto the surface of a cylinder, see figure below. I'm trying to find out how to do this using the Gmsh Python API. As soon as I change the position of the points along the z axis (as shown in the following code), I can't no longer create a circleArc. How can I get round this problem? Should I use splines? The final purpose is to add the sensor to the cylinder surface, not just to project point.
Thanks in advance,
Axel
gmsh.model.occ.synchronize()
points = gmsh.model.getEntities(0)
coords = []
[coords.append(gmsh.model.getValue(dim, tag, parametricCoord=[])) for dim, tag in points]
coords = np.array(coords)
phi = abs(sensor_position[0] - coords[:, 0]) / cylinder_radius
z = cylinder_radius * np.cos(phi)
[self._set_coordinates(dim, tag, (coords[idx, 0], coords[idx, 1], z[idx])) for idx, (dim, tag) in enumerate(points)]
gmsh.model.occ.synchronize()
def _set_coordinates(self, dim, tag, new_coords):
gmsh.model.occ.remove(dimTags=[(dim, tag)])
gmsh.model.occ.addPoint(x=new_coords[0], y=new_coords[1], z=new_coords[2], tag=tag)
Edited by Axel Thomas