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.

Saving geometry bug

More
2 years 5 months ago #4090 by VienC
Saving geometry bug was created by VienC
I'm creating a geometry using the following code:
Code:
sph1 = occ.Sphere(occ.Pnt(0.5,0.5,0.5), r=0.5) cyl0 .Cylinder(occ.Pnt(0.5,0.5,0.5), occ.X, r=0.1, h=0.1) cyl2 = occ.Cylinder(occ.Pnt(0.7,0.5,0.5), occ.X, r=0.1, h=0.1) cyl3 = occ.C= occ.Cylinder(occ.Pnt(0.5,0.5,0.5), occ.X, r=0.1, h=1) cyl1 = occylinder(occ.Pnt(0.9,0.5,0.5), occ.X, r=0.1, h=0.1) sph = occ.Sphere(occ.Pnt(0.5,0.5,0.5), r=0.1) cyl= cyl0+cyl1+cyl2+cyl3+sph geo = sph1 - cyl geo.WriteStep("Geometry.step")

It is basically a sphere with a hole, but when I reloaded the geometry in Ngsolve using a step file, the geometry was a cylinder that is cyl in the code.
Note: when I change the sphere by the box. The saved geometry is correct. So I thought that it's a bug when saving with a sphere,
More
2 years 4 months ago #4095 by christopher
Replied by christopher on topic Saving geometry bug
Hi,
reported as a bug to the opencascade devs here:

tracker.dev.opencascade.org/view.php?id=32695

Best
Christopher
The following user(s) said Thank You: VienC
More
2 years 4 months ago #4096 by christopher
Replied by christopher on topic Saving geometry bug
Update: It seems to be a bug in occ that happens if the cylinder is exactly this way with the (for paramametrization needed) sphere edge.
As a workaround you can rotate the sphere:
Code:
import netgen.occ as occ from netgen.webgui import Draw as DrawGeo sph = occ.Sphere(occ.Pnt(0,0,0), r=0.5).Rotate(occ.Axis((0,0,0), (0,1,0)), 90) cyl = occ.Cylinder(occ.Pnt(0,0,0), occ.X, r=0.1, h=1) geo = sph - cyl geo.WriteStep("Geometry.step")
The following user(s) said Thank You: VienC
More
2 years 4 months ago #4097 by VienC
Replied by VienC on topic Saving geometry bug
Hi Christopher,

Thank you so much for your reply. It’s helpful

Cheers
Vien
Time to create page: 0.129 seconds