Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

solid geometry

More
5 years 5 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)
More
5 years 4 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
More
5 years 4 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
More
5 years 4 months ago #1311 by Anija
Replied by Anija on topic solid geometry
Thank you!!That was indeed helpful.
More
5 years 4 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.
More
5 years 4 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(...).
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.109 seconds