mcneel / rhino3dm

Libraries based on OpenNURBS with a RhinoCommon style
MIT License
608 stars 139 forks source link

mesh=face.GetMesh(rhino3dm.MeshType.Any) return None #319

Closed yehongyu1234 closed 4 years ago

yehongyu1234 commented 4 years ago

hi I try to program the file image python/samples/getmeshes.py then return None image why ? thanku

mcneel-build commented 4 years ago

Linked with RH3DM-118

jesterKing commented 4 years ago

You need to have render (or other) meshes saved with your file: Set your viewport to Rendered mode, save. rhino3dm does not contain a tesselator.

Further, have you tried getting meshes for the entire object in one go? Or do you really want to extract the meshes face by face?

yehongyu1234 commented 4 years ago

You need to have render (or other) meshes saved with your file: Set your viewport to Rendered mode, save. rhino3dm does not contain a tesselator.

Further, have you tried getting meshes for the entire object in one go? Or do you really want to extract the meshes face by face? @jesterKing

thanku for replay, python seems not support directly convert brep to mesh,so I have no method to try getting mesh except through compute_rhino3d. yes,I want to extract the meshes face by face; I have tried the sample code file docs/python/samples/gemeshes.py for testing.

import rhino3dm model = rhino3dm.File3dm.Read('sample2.3dm') brep = model.Objects[0].Geometry face = brep.Faces[0] mesh = face.GetMesh(rhino3dm.MeshType.Any) print (len(mesh.Faces))

also get "None",that means brep faces can't convert to Mesh Faces with method "GetMesh()" . or "GetMesh()" is wip?

yehongyu1234 commented 4 years ago

@jesterKing

Version problem,I try to saving rhino6 as rhino5.It works. but I think the problem also need to solving

mcneel-build commented 4 years ago

Closed via RH3DM-118

jesterKing commented 4 years ago

@yehongyu1234 as I mentioned the rhino3dm library does not contain a tesselator. If a file does not contain render meshes for an object then you can't retrieve them either. Using Rhino Compute or Rhino Inside is your only option in getting surfaces meshed.