Surfaces seems to contain a BrepSurfaceList in your case. So you will first have to get a surface out of that list.
For example
geometry.Surfaces[0].NormalAt(0, 0)
Surfaces seems to contain a BrepSurfaceList in your case. So you will first have to get a surface out of that list.
For example
geometry.Surfaces[0].NormalAt(0, 0)
Hi @sunny.ying,
If you were in Rhino, you could do something like this:
import Rhino
def test(filename):
model = Rhino.FileIO.File3dm.Read(filename)
if not model:
return
for obj in model.Objects:
name = obj.Attributes.Name
if not ('z' in name):
continue
if not isinstance(obj.Geometry, Rhino.Geometry.Brep):
continue
brep = obj.Geometry
srf = brep.Surfaces[0]
du = srf.Domain(0)
dv = srf.Domain(1)
print(srf.NormalAt(du.Min, dv.Min))
test("c:\\users\\dale\\desktop\\test.3dm")
I have not tried this with CPython.
– Dale
@efestwin It did work out! I love this simple but effective suggestion!
Also thanks everyone for your suggestions! All helped a lot!