Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
openmesh-python
Commits
1b785cea
Commit
1b785cea
authored
Jan 23, 2018
by
Alexander Dielen
Browse files
fixed file paths
parent
5a00eeab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Unittests/test_read_write_obj.py
View file @
1b785cea
...
...
@@ -7,7 +7,7 @@ class ReadWriteOBJ(unittest.TestCase):
self
.
mesh
=
openmesh
.
TriMesh
()
def
test_load_simple_obj
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal.obj"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal.obj"
)
self
.
assertTrue
(
ok
)
...
...
@@ -22,7 +22,7 @@ class ReadWriteOBJ(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexNormal
file_name
=
"cube-minimal.obj"
file_name
=
"
TestFiles/
cube-minimal.obj"
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
file_name
,
options
)
...
...
@@ -87,7 +87,7 @@ class ReadWriteOBJ(unittest.TestCase):
def
test_load_simple_obj_force_vertex_colors_although_not_available
(
self
):
self
.
mesh
.
request_vertex_colors
()
file_name
=
"cube-minimal.obj"
file_name
=
"
TestFiles/
cube-minimal.obj"
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
...
...
@@ -107,7 +107,7 @@ class ReadWriteOBJ(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
FaceTexCoord
file_name
=
"cube-minimal-texCoords.obj"
file_name
=
"
TestFiles/
cube-minimal-texCoords.obj"
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
file_name
,
options
)
...
...
@@ -139,7 +139,7 @@ class ReadWriteOBJ(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
FaceColor
file_name
=
"square_material.obj"
file_name
=
"
TestFiles/
square_material.obj"
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
file_name
,
options
)
...
...
@@ -161,7 +161,7 @@ class ReadWriteOBJ(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
file_name
=
"cube-minimal-vertex-colors-after-vertex-definition.obj"
file_name
=
"
TestFiles/
cube-minimal-vertex-colors-after-vertex-definition.obj"
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
file_name
,
options
)
...
...
@@ -195,7 +195,7 @@ class ReadWriteOBJ(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
file_name
=
"cube-minimal-vertex-colors-as-vc-lines.obj"
file_name
=
"
TestFiles/
cube-minimal-vertex-colors-as-vc-lines.obj"
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
file_name
,
options
)
...
...
Unittests/test_read_write_off.py
View file @
1b785cea
...
...
@@ -7,7 +7,7 @@ class ReadWriteOFF(unittest.TestCase):
self
.
mesh
=
openmesh
.
TriMesh
()
def
test_load_simple_off_file
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube1.off"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube1.off"
)
self
.
assertTrue
(
ok
)
...
...
@@ -43,8 +43,8 @@ class ReadWriteOFF(unittest.TestCase):
options
+=
openmesh
.
Options
.
VertexColor
options
+=
openmesh
.
Options
.
ColorFloat
openmesh
.
write_mesh
(
self
.
mesh
,
"temp.off"
,
options
)
openmesh
.
read_mesh
(
self
.
mesh
,
"temp.off"
,
options
)
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
temp.off"
,
options
)
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
temp.off"
,
options
)
# Check if vertices still have the same color
count
=
0
...
...
@@ -62,7 +62,7 @@ class ReadWriteOFF(unittest.TestCase):
options
=
openmesh
.
Options
(
openmesh
.
Options
.
VertexColor
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -71,9 +71,9 @@ class ReadWriteOFF(unittest.TestCase):
options
+=
openmesh
.
Options
.
ColorFloat
# Write the mesh
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"cube_floating.off"
,
options
)
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
cube_floating.off"
,
options
)
self
.
assertTrue
(
ok
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube_floating.off"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube_floating.off"
,
options
)
self
.
assertTrue
(
ok
)
self
.
assertEqual
(
self
.
mesh
.
n_vertices
(),
8
)
...
...
@@ -108,7 +108,7 @@ class ReadWriteOFF(unittest.TestCase):
options
=
openmesh
.
Options
(
openmesh
.
Options
.
VertexColor
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -118,14 +118,14 @@ class ReadWriteOFF(unittest.TestCase):
options
+=
openmesh
.
Options
.
ColorFloat
# Write the mesh
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"cube_floating_binary.off"
,
options
)
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
cube_floating_binary.off"
,
options
)
self
.
assertTrue
(
ok
)
self
.
mesh
.
clear
()
options
.
clear
()
options
+=
openmesh
.
Options
.
VertexColor
options
+=
openmesh
.
Options
.
Binary
options
+=
openmesh
.
Options
.
ColorFloat
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube_floating_binary.off"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube_floating_binary.off"
,
options
)
self
.
assertTrue
(
ok
)
self
.
assertEqual
(
self
.
mesh
.
n_vertices
(),
8
)
...
...
Unittests/test_read_write_om.py
View file @
1b785cea
...
...
@@ -10,7 +10,7 @@ class ReadWriteOM(unittest.TestCase):
def
test_load_simple_om_force_vertex_colors_although_not_available
(
self
):
self
.
mesh
.
request_vertex_colors
()
file_name
=
"cube-minimal.om"
file_name
=
"
TestFiles/
cube-minimal.om"
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
...
...
@@ -34,7 +34,7 @@ class ReadWriteOM(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexTexCoord
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal-texCoords.om"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal-texCoords.om"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -66,7 +66,7 @@ class ReadWriteOM(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal-vertexColors.om"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal-vertexColors.om"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -97,7 +97,7 @@ class ReadWriteOM(unittest.TestCase):
self
.
mesh
.
release_vertex_colors
()
def
test_write_triangle
(
self
):
filename
=
"triangle-minimal.om"
;
filename
=
"
TestFiles/
triangle-minimal.om"
;
# Generate data
v1
=
self
.
mesh
.
add_vertex
(
openmesh
.
Vec3d
(
1.0
,
0.0
,
0.0
))
...
...
@@ -135,7 +135,7 @@ class ReadWriteOM(unittest.TestCase):
options
+=
openmesh
.
Options
.
VertexColor
options
+=
openmesh
.
Options
.
ColorFloat
filename
=
"triangle-minimal-ColorsPerVertex.om"
filename
=
"
TestFiles/
triangle-minimal-ColorsPerVertex.om"
# Generate data
v1
=
self
.
mesh
.
add_vertex
(
openmesh
.
Vec3d
(
1.0
,
0.0
,
0.0
))
...
...
Unittests/test_read_write_ply.py
View file @
1b785cea
...
...
@@ -7,7 +7,7 @@ class ReadWritePLY(unittest.TestCase):
self
.
mesh
=
openmesh
.
TriMesh
()
def
test_load_simple_point_ply_file_with_bad_encoding
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"pointCloudBadEncoding.ply"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
pointCloudBadEncoding.ply"
)
self
.
assertTrue
(
ok
)
...
...
@@ -16,7 +16,7 @@ class ReadWritePLY(unittest.TestCase):
self
.
assertEqual
(
self
.
mesh
.
n_faces
(),
0
)
def
test_load_simple_point_ply_file_with_good_encoding
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"pointCloudGoodEncoding.ply"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
pointCloudGoodEncoding.ply"
)
self
.
assertTrue
(
ok
)
...
...
@@ -25,7 +25,7 @@ class ReadWritePLY(unittest.TestCase):
self
.
assertEqual
(
self
.
mesh
.
n_faces
(),
0
)
def
test_load_simple_ply
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal.ply"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal.ply"
)
self
.
assertTrue
(
ok
)
...
...
@@ -36,7 +36,7 @@ class ReadWritePLY(unittest.TestCase):
def
test_load_simple_ply_force_vertex_colors_although_not_available
(
self
):
self
.
mesh
.
request_vertex_colors
()
file_name
=
"cube-minimal.ply"
file_name
=
"
TestFiles/
cube-minimal.ply"
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
...
...
@@ -57,12 +57,12 @@ class ReadWritePLY(unittest.TestCase):
def
test_load_simple_ply_with_vertex_colors
(
self
):
self
.
mesh
.
request_vertex_colors
()
file_name
=
"cube-minimal.ply"
file_name
=
"
TestFiles/
cube-minimal.ply"
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal-vertexColors.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal-vertexColors.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -98,7 +98,7 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -134,18 +134,18 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
options
+=
openmesh
.
Options
.
Binary
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"meshlab_binary.ply"
,
options
)
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_binary.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
mesh
.
clear
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab_binary.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_binary.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
assertEqual
(
self
.
mesh
.
n_vertices
(),
8
)
...
...
@@ -180,17 +180,17 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
options
+=
openmesh
.
Options
.
ColorFloat
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"meshlab_float.ply"
,
options
)
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_float.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
mesh
.
clear
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab_float.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_float.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
assertEqual
(
self
.
mesh
.
n_vertices
(),
8
)
...
...
@@ -226,18 +226,18 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexColor
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab.ply"
,
options
)
self
.
assertTrue
(
ok
)
options
+=
openmesh
.
Options
.
ColorFloat
options
+=
openmesh
.
Options
.
Binary
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"meshlab_binary_float.ply"
,
options
)
ok
=
openmesh
.
write_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_binary_float.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
mesh
.
clear
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"meshlab_binary_float.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
meshlab_binary_float.ply"
,
options
)
self
.
assertTrue
(
ok
)
self
.
assertEqual
(
self
.
mesh
.
n_vertices
(),
8
)
...
...
@@ -274,7 +274,7 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexTexCoord
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal-texCoords.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal-texCoords.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -306,7 +306,7 @@ class ReadWritePLY(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
VertexNormal
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube-minimal-normals.ply"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube-minimal-normals.ply"
,
options
)
self
.
assertTrue
(
ok
)
...
...
Unittests/test_read_write_stl.py
View file @
1b785cea
...
...
@@ -7,7 +7,7 @@ class ReadWriteSTL(unittest.TestCase):
self
.
mesh
=
openmesh
.
TriMesh
()
def
test_load_simple_stl_file
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube1.stl"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube1.stl"
)
self
.
assertTrue
(
ok
)
...
...
@@ -21,7 +21,7 @@ class ReadWriteSTL(unittest.TestCase):
options
=
openmesh
.
Options
()
options
+=
openmesh
.
Options
.
FaceNormal
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube1.stl"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube1.stl"
,
options
)
self
.
assertTrue
(
ok
)
...
...
@@ -36,7 +36,7 @@ class ReadWriteSTL(unittest.TestCase):
self
.
mesh
.
release_face_normals
()
def
test_load_simple_stl_binary_file
(
self
):
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube1Binary.stl"
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube1Binary.stl"
)
self
.
assertTrue
(
ok
)
...
...
@@ -51,7 +51,7 @@ class ReadWriteSTL(unittest.TestCase):
options
+=
openmesh
.
Options
.
FaceNormal
options
+=
openmesh
.
Options
.
Binary
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"cube1Binary.stl"
,
options
)
ok
=
openmesh
.
read_mesh
(
self
.
mesh
,
"
TestFiles/
cube1Binary.stl"
,
options
)
self
.
assertTrue
(
ok
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment