- Thank you received: 24
hemisphere with hollow bottom
2 years 8 months ago #4249
by hvwahl
Replied by hvwahl on topic hemisphere with hollow bottom
This depends a bit on what you're after.
Put the above code into a my_script.py file, and add a last line `Draw(geo)`. By running a terminal in the location where you saved the script, you can run this with the gui by calling `netgen my_script.py`, and then continue in the gui.
Alternatively, you can do everything in the python script (see docu.ngsolve.org/latest/i-tutorials/inde...-and-mesh-generation ) and then run `python3 my_script.py`.
Put the above code into a my_script.py file, and add a last line `Draw(geo)`. By running a terminal in the location where you saved the script, you can run this with the gui by calling `netgen my_script.py`, and then continue in the gui.
Alternatively, you can do everything in the python script (see docu.ngsolve.org/latest/i-tutorials/inde...-and-mesh-generation ) and then run `python3 my_script.py`.
- suzarina3
- Topic Author
- New Member
Less
More
2 years 8 months ago #4252
by suzarina3
Replied by suzarina3 on topic hemisphere with hollow bottom
Dear sir.
Thanks a million for your reply.
I seriously appreciated it.
Thanks a million for your reply.
I seriously appreciated it.
- suzarina3
- Topic Author
- New Member
Less
More
2 years 8 months ago #4253
by suzarina3
Replied by suzarina3 on topic hemisphere with hollow bottom
Dear sir,
When i load the python file, i get the error as this:
AttributeError: 'netgen.libngpy._csg.Solid' object has no attribute 'faces'
Finished executing C:/Users/suzarina sukri/Downloads/hemisphere.py
what does it means? sorry to bother you again sir
When i load the python file, i get the error as this:
AttributeError: 'netgen.libngpy._csg.Solid' object has no attribute 'faces'
Finished executing C:/Users/suzarina sukri/Downloads/hemisphere.py
what does it means? sorry to bother you again sir
2 years 8 months ago #4254
by hvwahl
Replied by hvwahl on topic hemisphere with hollow bottom
Hi,
it appears that there is some mix-up between the occ wrapper code and the i-tutorial code, which use the netgen.csg Shpere object. Could you please post you example file?
it appears that there is some mix-up between the occ wrapper code and the i-tutorial code, which use the netgen.csg Shpere object. Could you please post you example file?
- suzarina3
- Topic Author
- New Member
Less
More
2 years 8 months ago - 2 years 8 months ago #4255
by suzarina3
Replied by suzarina3 on topic hemisphere with hollow bottom
Do you mean this code?
from netgen.occ import *
face = Sphere((0,0,0),1).faces[0]
face *= HalfSpace((0,0,0),(0,0,1))
geo = OCCGeometry(face)
Draw(geo)
Thank you so much sir
from netgen.occ import *
face = Sphere((0,0,0),1).faces[0]
face *= HalfSpace((0,0,0),(0,0,1))
geo = OCCGeometry(face)
Draw(geo)
Thank you so much sir
Last edit: 2 years 8 months ago by suzarina3.
- suzarina3
- Topic Author
- New Member
Less
More
2 years 8 months ago #4256
by suzarina3
Replied by suzarina3 on topic hemisphere with hollow bottom
sorry sir, this is the code
from netgen.occ import *
from netgen.csg import *
from ngsolve.webgui import Draw
face = Sphere((0,0,0),1).faces[0]
face *= HalfSpace((0,0,0),(0,0,1))
geo = OCCGeometry(face)
Draw(geo)
from netgen.occ import *
from netgen.csg import *
from ngsolve.webgui import Draw
face = Sphere((0,0,0),1).faces[0]
face *= HalfSpace((0,0,0),(0,0,1))
geo = OCCGeometry(face)
Draw(geo)
Time to create page: 0.107 seconds