- Thank you received: 0
solid geometry
5 years 11 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)
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)
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
5 years 11 months ago #1308
by christopher
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
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 11 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:
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
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 11 months ago #1311
by Anija
Replied by Anija on topic solid geometry
Thank you!!That was indeed helpful.
5 years 11 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???
Thankyou in advance.
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???
Thankyou in advance.
5 years 11 months ago #1316
by cwinters
Replied by cwinters on topic solid geometry
Hi,
since it is an 3d object, you want to use an ellipsoid(...).
When you run this code and mesh it, you get a mesh which consists of surface elements and volume elements (between sphere and ellipsoid). At the bottom of the GUI you should see the numbers for "Elements" (volume) and "Surf Elements".
Christoph
since it is an 3d object, you want to use an ellipsoid(...).
Code:
algebraic3d
solid s1=sphere(0,0,0;50);
solid p1= plane(0,0,0;0,-1,0);
solid e= ellipsoid(0,0,0;51,0,0;0,55,0;0,0,51);
solid geo= e and p1 and not s1;
tlo geo -maxh=10;
When you run this code and mesh it, you get a mesh which consists of surface elements and volume elements (between sphere and ellipsoid). At the bottom of the GUI you should see the numbers for "Elements" (volume) and "Surf Elements".
Christoph
Time to create page: 0.105 seconds