Hi,
On 20.02.13 05:04, A Read wrote:
> Im trying to use the ply file importer (its the only one i can find for
> python) just to access the vertices for further processing with other
> modules.
>
> i do this...
>
> from cgkit.all import *
> importer = cgkit.plyimport.PLYImporter()
> importer.importFile("test.1.ply")
> b = cgkit.worldobject.WorldObject(name="test.1")
>
> and b exists but b.geom is None
With your last line you are creating a *new* WorldObject instance. Try
running listWorld() after your command and you should see two objects.
By default, WorldObjects have no geometry which is why b.geom is None.
To get a reference to an existing object, you have to use the
worldObject() function. Two more notes, instead of using importer
plugins directly, the preferred method would be to use the load()
function and as you imported everything into your namespace you don't
need the module prefixes. So an updated version of the above would be this:
from cgkit.all import *
load("test.1.ply")
b = worldObject("test.1")
# b.geom should now be a PolyhedronGeom object containing your model
Cheers,
- Matthias -

Hi,
Im new to CGkit so this could be a very simple question.
Im trying to use the ply file importer (its the only one i can find for
python) just to access the vertices for further processing with other
modules.
i do this...
from cgkit.all import *
importer = cgkit.plyimport.PLYImporter()
importer.importFile("test.1.ply")
b = cgkit.worldobject.WorldObject(name="test.1")
and b exists but b.geom is None
ive modified importFile to return the Polyhedron which gives me the
geometry i expected.
It would be nice to know how to use this properly.
Thanks
A