hemisphere with hollow bottom

More
2 years 8 months ago #4249 by hvwahl
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`.
More
2 years 8 months ago #4252 by suzarina3
Dear sir.

Thanks a million for your reply. :)
I seriously appreciated it.
More
2 years 8 months ago #4253 by suzarina3
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
More
2 years 8 months ago #4254 by hvwahl
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?
More
2 years 8 months ago - 2 years 8 months ago #4255 by suzarina3
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
Last edit: 2 years 8 months ago by suzarina3.
More
2 years 8 months ago #4256 by suzarina3
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)
Time to create page: 0.107 seconds