# solid geometry

5 years 6 months ago #1306 by Anija
solid geometry was created by Anija
Hii,
When we create geometries with Netgen, they are hollow structures. Like for example I made a cylinder like:

algebraic3d
solid cyl = cylinder (0,0,0; 30,0,0;10);
tlo cyl;

So, I got a hollow cylinder. So, how can I get a solid cylinder? (Like one which is filled inside)
5 years 6 months ago #1308
Replied by christopher on topic solid geometry
Hi,
you have to cut the (infinite cylinder), for example with planes.
Have a look at the documenation:
ngsolve.org/docu/latest/netgen_tutorials...e_3d_geometries.html
and
ngsolve.org/docu/latest/i-tutorials/unit-4.2-csg/csg.html

I would consider using the python interface if you are just starting using Netgen, since it is the actively developed interface (and it has the nicer Syntax - and programmability).

Best
Christopher
5 years 6 months ago #1309 by cwinters
Replied by cwinters on topic solid geometry
Hi,

the points of the cylinder call just define the axis. You have to cut it to the desired length using planes.

Using the python interface, it would look like this:
Code:
from netgen.csg import * cyl = Cylinder(Pnt(0,0,0),Pnt(30,0,0),10) p1 = Plane(Pnt(0,0,0),Vec(-1,0,0)) # point and normal vector p2 = Plane(Pnt(30,0,0),Vec(1,0,0)) solidcyl = cyl*p1*p2 geo = CSGeometry() geo.Add(solidcyl)

You can still use the geo-file. There you have to add two planes as solid and make the union using "and" between the solids.

Best regards,
Christoph
5 years 6 months ago #1311 by Anija
Replied by Anija on topic solid geometry
5 years 6 months ago #1314 by Anija
Replied by Anija on topic solid geometry
Hii,
So, if I create a structure like an ellipse and cut out a sphere and make it in a hemi-structure by cutting by a plane, I will be getting a solid structure. For example,

algebraic3d
solid s1=sphere(0,0,0;50);
solid p1= plane(0,0,0;0,-1,0);
solid e= ellipse(0,0,0;51,0,0;0,55,0;0,0,51);
solid geo= e and p1 and not s1;
tlo geo;

Would the structure be filled within???