Intersecting two cylinders

More
6 years 4 months ago #590 by chou
Hello,

I am trying to intersect two cylinders and I have found some issues with the result, as NetGen is not able to mesh it. Could you provide any help with this? I

I am attaching the simple .geo file to generate the geometry.

Kind Regards,

Marcos.

File Attachment:

File Name: new.geo
File Size:0 KB
Attachments:
More
6 years 4 months ago #591 by ddrake
Replied by ddrake on topic Intersecting two cylinders
Hi Marcos,

Here is a Python script that I think does what you want. I don't know much about the .geo file format. Maybe someone else can help with that. I think it is not necessary to intersect the cylinders with planes first since the intersection of the two cylinders will be finite.
Code:
from netgen.csg import * cyl1 = Cylinder(Pnt(0, 0, -10), Pnt(0,0,10), 4) cyl2 = Cylinder(Pnt(-10, 0, 0), Pnt(10,0,0), 5) cutcone2 = cyl1 * cyl2 geo = CSGeometry() geo.Add(cutcone2) mesh = geo.GenerateMesh(maxh=.5)

Best,
Dow
More
6 years 4 months ago #596 by chou
Replied by chou on topic Intersecting two cylinders
Hi Dow,

thank you for your answer. I have never used Python to generate Netgen geometries or meshes. Is there any documentation available that I can use as a reference for this?

Also, does someone else what is the problem with the .geo file?

Kind Regards,

Marcos.
More
6 years 4 months ago #597 by ddrake
Replied by ddrake on topic Intersecting two cylinders
Hi Marcos,

There is some information here: In Documentation > Tutorials:

ngsolve.org/docu/latest/netgen_tutorials...e_3d_geometries.html

There are also some very good interactive "iTutorials" in the Documentation menu. These used to be individually hosted, but now the link has changed to a direct download link. They require jupyter notebook, which can be installed via pip.

Hope that helps!

Best,
Dow
More
6 years 4 months ago #598 by christopher
Hi, for the Usermeeting we changed the link of the i-tutorials to download the new updated version. I changed the link back to the old one, we will upload the new version in the coming days.
Have a look at section 4 there.

Best
Christopher
The following user(s) said Thank You: ddrake
More
6 years 4 months ago #601 by bernd
Replied by bernd on topic Intersecting two cylinders
Hi Marcos,

The problem with your .geo file is, that the cutting planes for 'fincylz' coincide with the radius of the second cylinder 'fincylx'.
I think Netgen has a problem with two geometric objects having the identical normal vectors at a point.

So one solution is, as Dow suggested, to completely remove the cutting planes. See

File Attachment:

File Name: new_no_planes.geo
File Size:0 KB
.
If you need the cutting planes for something else, you can slightly adjust their position or also slightly adjust the radius of 'fincylx'. See

File Attachment:

File Name: new_adj_radius.geo
File Size:0 KB
.

Best,
Bernd
The following user(s) said Thank You: ddrake
Time to create page: 0.116 seconds