Hello Madam or Sir,
I am the user of OpenMesh, and I want ask some questions about the parallel code with OpenMesh, exactly, the parallel code is based on OpenMP on the VS2013.
The first question: When I use the OpenMP on the VS2013 to speed up the program which write with OpenMesh, for example, I add the code: #pragma omp parallel for num_threads(7) , just like the following:
and the errors follow, and I do not know why.
and the second question: Could the code with iterator of OpenMesh be paralleled by OpenMP just like " for (TriMesh::FaceIter f_it = mesh.faces_begin(); f_it != mesh.faces_end(); f_it++) " in the above picture? or How can I parallel the code with iterator of OpenMesh?
Thank you for your time! And I am looking forward to your reply.
Sincerely
LuWang
Hi to all.
Before asking my question I would like to state two important things:
1) My goal is to work with 2d triangular/polygonal meshes, from which i don't see any examples in the documentation. As a starting point I want to create and export (to a .vtk file) a simple 2d polygonal mesh, i.e. just a square.
2) I'm new to the library so this might be a rather broad/general question.
Now, here's what i have tried.
1) I've started with the tutorial "Building a cube". There i have managed to export the mesh to a .vtk file doing the following (variable names follow from the tutorial):
//
typedef OpenMesh::IO::ExporterT<MyMesh> BaseExporter;
BaseExporter be = BaseExporter(mesh);
OpenMesh::IO::Options opt = OpenMesh::IO::Options::Default;
OpenMesh::IO::_VTKWriter_ mywriter;
mywriter.write("output.vtk",be,opt,sizeof(double));
//
2) Now i want to modify this tutorial example to have a single square. To be clear, I want a 2d geometry, not a 3d geometry whose vertices have constant z=0 coordinate. This is how i define the mesh:
//
MyMesh::VertexHandle vhandle[4];
vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, -1));
vhandle[1] = mesh.add_vertex(MyMesh::Point( 1, -1));
vhandle[2] = mesh.add_vertex(MyMesh::Point( 1, 1));
vhandle[3] = mesh.add_vertex(MyMesh::Point(-1, 1));
std::vector<MyMesh::VertexHandle> face_vhandles;
face_vhandles.clear();
face_vhandles.push_back(vhandle[0]);
face_vhandles.push_back(vhandle[1]);
face_vhandles.push_back(vhandle[2]);
face_vhandles.push_back(vhandle[3]);
mesh.add_face(face_vhandles)
//
When i try to compile the code last code i get the following error, amongst many others:
no matching function for call to ‘OpenMesh::VectorT<float, 3>::VectorT(int, int)’ vhandle[0] = mesh.add_vertex(MyMesh::Point(-1, -1));
Now, these are my questions:
1) How can i create a 2d polygonal mesh? I guess i have to give the proper template parameter to type definition on
typedef OpenMesh::PolyMesh_ArrayKernelT<> MyMesh;
but i don't know what to put in there exactly.
2) How is that going to affect the BaseExporter that i use to create the .vtk file? I am asking this because i already manage to create a 2d mesh following what i found in one of the unit tests, namely unittests_polymesh_vec2i.cc, but then i cannot export the mesh following the approach i had used for the cube. So, just in case anyone would suggest that piece of code as an answer to my question.
Any thoughts or suggestions will be greatly appreciated :)
Kind regards,
Hi,
OpenMesh has implemented the functionalities to s/r custom property of
vector<T> in
OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl.
However it seems to expect the size to be known in advance when restoring.
Is there a way to restore the size dynamically?
I think maybe it's better to store the size as well?
Kind regards
Hello,
I really like that your cmake file now supports exported targets. I
wanted to require OpenMesh 8.1 so I can be sure that I am able to use
them using
find_package(OpenMesh 8.1 REQUIRED)
But this requires a package version file, like described here, which is
not generated by your cmake files:
https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#c…
It would be great, if you can add this.
with kind regards,
Alexander Schier