Botond
Botond

Reputation: 2802

How to get a MeshHandle from a mesh instance in OpenMesh?

I am trying to use this function to compute the center of mass of a mesh structure. This is the signature:

Point   calc_centroid (MeshHandle _mh) const

So it takes a MeshHandle object as a parameter. My question is, how to get such a MeshHandle from a mesh instance? I have a mesh instance defined as

typedef OpenMesh::TriMesh_ArrayKernelT<>  MyMesh;
MyMesh mesh;

however, I seem to be unable to get a MeshHandle to it.

Upvotes: 1

Views: 131

Answers (1)

jsb
jsb

Reputation: 973

A MeshHandle holds no reference to a mesh instance. You can just create one with a default constructor:

MyMesh mesh;
mesh.calc_centroid(OpenMesh::MeshHandle());

Upvotes: 3

Related Questions