# [Gmsh] Meshing of a cone with Gmsh didn't quite work

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 26, 2018, 09:53 Meshing of a cone with Gmsh didn't quite work #1 New Member   Eric Join Date: Apr 2018 Posts: 3 Rep Power: 7 Hi there everyone, I tried meshing a cone with more or less random dimensions to be meshed by Gmsh and couldn't quite figure out how I could get it right. I tried to have a nice cone, but one of the sides in my Gmsh looks like it is more cut up and a bit unshaped. The code I came up with looks like this: cl__1 = 1; boxdim = 1; gridsize = boxdim/10; Point(1) = {0, 0, 3, 1}; Point(2) = {0, 0, 0, 1}; Point(3) = {0, 3, 0, 1}; Point(4) = {3, 0, 0, 1}; Point(5) = {0, -3, 0, 1}; Point(6) = {-3, 0, 0, 1}; Circle(1) = {4, 2, 3}; Circle(2) = {3, 2, 6}; Circle(3) = {6, 2, 5}; Circle(4) = {5, 2, 4}; Line(6) = {1, 4}; Line(7) = {1, 3}; Line(8) = {1, 6}; Line(9) = {1, 5}; Line Loop(10) = {4, 1, 2, 3}; Plane Surface(11) = {10}; Line Loop(12) = {-9, 6, -4}; Ruled Surface(13) = {12}; Line Loop(14) = {-9, 8, 3}; Ruled Surface(15) = {14}; Line Loop(16) = {-6, 7, -1}; Ruled Surface(17) = {16}; Line Loop(18) = {8, 2, -7}; Ruled Surface(19) = {18}; If anyone has an idea what went wrong I'd very much appreciate it. I tried looking at the other ones which worked and the base arc line is always at the end, I tried rewritting it in such a way, but didn't lead to the desired outcome either... As said, help is much apprecaited. Thanks, Eric

 April 30, 2018, 05:24 #2 New Member   Eric Join Date: Apr 2018 Posts: 3 Rep Power: 7 I realised I should have probably specified it a bit more. Below is an image of the cone I am trying to model. somehow it doesn't work to embed the picture on this page so please follow the link... just realised that I wouldn't click that link either... damn! How can I upload it properly? https://ibb.co/dcrA8c

 April 30, 2018, 09:15 #3 Senior Member   Mikko Join Date: Jul 2014 Location: The Hague, The Netherlands Posts: 243 Rep Power: 11 Hi Eric, I would create a line and revolve it to create a cone. Here is an example script: Code: ```Point(1) = {0, 0, 1, 0.01}; Point(2) = {0.2, 0, 0, 0.1}; Line(1) = {1, 2}; Extrude {{0, 0, 1}, {0, 0, 0}, Pi} {Line{1};} // Axis direction, coordinate of an axis point, angle in radians``` Regards, Mikko

 May 1, 2018, 21:42 #4 New Member   Eric Join Date: Apr 2018 Posts: 3 Rep Power: 7 Thanks Mikko for your response, I tried using your approach yesterday, but couldn't quite figure out how to revolve the cone and generate the surface. I'll look into it again tonight. Do you have any idea why my approach didn't work by any chance? Regards, Eric

 May 2, 2018, 16:45 #5 Senior Member   Mikko Join Date: Jul 2014 Location: The Hague, The Netherlands Posts: 243 Rep Power: 11 The script should be complete. The extrude command is revolving the line and creates a segment of cone's lateral surface.

 Tags cone, gmsh