- Thank you received: 0
Saving geometry bug
2 years 11 months ago #4090
by VienC
Saving geometry bug was created by VienC
I'm creating a geometry using the following code:
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,
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,
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
2 years 11 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
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
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
2 years 11 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:
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
Time to create page: 0.096 seconds