VolMesh.cell_edges

The following code raises error:

import compas
from compas.datastructures import VolMesh
filepath = …
volmesh=VolMesh.from_obj(filepath)
print volmesh.cell_edges(0)

Message: ‘VolMesh’ object has no attribute ‘edge’

Traceback:
line 2189, in cell_edges, “C:\Users…\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas\datastructures\volmesh\volmesh.py”

Just ran the volmesh.cell_edges() and seems to be working fine. Maybe check the obj file, and make sure that the objects have sealed faces as cells? It may be that a volmesh wasn’t properly created from it.

Maybe I am constructing my volumetric mesh in a wrong way. As a simple example: I just made a mesh object from lines that form a pyramid in rhino and exported as an obj file, still gives the same error!
It is strange that the volmesh.edges(), volmesh.cells(), and volmesh.faces() all function properly.

It could be possible that some of the faces are not getting created properly (because you converted them to mesh, possibly?). Why are you converting the object into a obj in the first place? All the examples uses Rhino polysurfaces (closed) directly, so that may be the most stable workflow I would recommend…

I want to use the data structure for algebraic formulations using some packages that won’t function with IronPython. That’s why I am exporting the info to an obj file.

How do you make a VolMesh data structure from a poly surface (cell) or poly surfaces (cells)?

current examples of compas_3gs is based on COMPAS version 0.7.1 (ancient! almost a year ago), and the function is here:
compas_rhino.helpers > volmesh_from_polysurfaces

In current version of COMPAS (0.15.4) it seems to have moved here:
/src/compas_rhino/geometry/_constructors/volmesh.py

tried this:

from compas_rhino.geometry._constructors import volmesh
import rhinoscriptsyntax as rs

guids = rs.GetObject(“select a closed polysurface”, filter=rs.filter.polysurface)
volmesh = volmesh.volmesh_from_polysurfaces(VolMesh, guids)

returns:

Message: iteration over non-sequence of type Guid

Traceback:
line 48, in volmesh_from_polysurfaces, “C:\Users\msalma\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\compas_rhino\geometry_constructors\volmesh.py”

the function volmesh_from_polysurfaces takes a list of guids…

would you mind filing an issue about this?