I'm an undergraduate studying in ZJU, China.
Apologize for my awful English.
I am working on an academic project which refers to OpenMesh, it's given by my instructor.
The project was originally built on VS2010(x86)-addin-Qt4, referring OpenMesh2.3.
But I got a compile error after setting the path and other configures, the error as follows:it's an error in specialization: cannot convert from overload function to iterator template
Here are some tries that I made to solve this problem problem but failed:
add _USE_MATH_DEFINES and _SCL_SECURE_NO_WARNINGS to preprocessor (still error)
change the reference of OpenMesh to V6.3(2015 x64) (unresolved external symbols)
For the entire project is based on 32-bit, using other libraries such as opencv and eigen etc, i may not try to convert the project into 64-bit, so is there any way to solve( or ignore) this specializaion error? I'm almost stressed myself out.
Hoping and thanks for any reply!
Best wishes!
--
周洋 Zhou Yang
Zhejiang University | 浙江大学
Chu Kochen Honor College | 竺可桢学院
Computer Science and Technology | 计算机科学与技术
Tel: +86 18867153005
Email:
3150104024(a)zju.edu.cn
Hello everybody,
First, thanks a lot for your neat work on openmesh! I am creating meshes
for 3D modelling as a part of my masters thesis and I am glad to use a well
written library.
I am able to build many things and play with it thanks to openmesh,
however I encounter some troubles from time to time. I asked some
communities (stackoverflow for instance) but the subject does not seem to
be hot right now, and experts are hard to find, so I am asking you.
I use openmesh with Python 3.6. Openmesh was installed with a 'pip install
openmesh' :
*1/ First*, I wanted to add custom propetries to vertices of the mesh, it
does work but does not write in the file, or it is not read when the file
is re-opened, here is my code :
import openmesh as OM import numpy as np
mesh = OM.TriMesh()
#Add some vertices
vh0 = mesh.add_vertex(np.array([0,0,0]));
vh1 = mesh.add_vertex(np.array([1,0,0]));
vh2 = mesh.add_vertex(np.array([1,1,0]));
vh3 = mesh.add_vertex(np.array([0,1,0]));
#Create some data
data = np.arange(mesh.n_vertices)
#Add custom property for vh in mesh.vertices():
mesh.set_vertex_property('prop1', vh, data[vh.idx()])
#Check properties have been added correctly
print(mesh.vertex_property('prop1'))
#prints data matrix
OM.write_mesh('mesh.om',mesh)
#Re-load mesh in another instance :
mesh1 = OM.TriMesh()
mesh1 = OM.read_trimesh('mesh.om')
#Check property is still there print(mesh1.vertex_property('prop1'))
#Prints a matrix of 'None'...
So, I cannot save then read a custom property. (So far, I save custom
properties into a csv file, which is okay but not convienient.)
*2/ Another issue* I encounter is when I want to save a mesh into a vtk
file. The writter writes nothing . Here is my code :
import openmesh as OM
mesh = OM.TriMesh()
#Add some vertices
vh0 = mesh.add_vertex([0,0,0])
vh1 = mesh.add_vertex([0,1,1])
vh2 = mesh.add_vertex([1,0,1])
vh3 = mesh.add_vertex([1,1,0])
#Add some faces (we are building a tetrahedron here)
mesh.add_face(vh0,vh1,vh2)
mesh.add_face(vh0,vh2,vh3)
mesh.add_face(vh0,vh3,vh1)
mesh.add_face(vh1,vh3,vh2)
OM.write_mesh('TEST_MESH.vtk',mesh)
Nothing is written. (When I put .ply or .om ... instead of .vtk, it
works just fine)
According to the documentation, it should work, so I don't know what I am
doing wrong. If you have any tips or advices, it would be very appreciated,
Thank you for your time, thank you for your help,
Charles Duvert.