Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Type-OpenMesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
Type-OpenMesh
Commits
8b7fc743
Commit
8b7fc743
authored
Apr 05, 2019
by
Alexander Dielen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests for getMesh(), addMesh() and vertex_property()
parent
6ec7a795
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
Plugin-OpenMeshPython/PythonTests/CMakeLists.txt
Plugin-OpenMeshPython/PythonTests/CMakeLists.txt
+15
-0
Plugin-OpenMeshPython/PythonTests/addMesh.ofp
Plugin-OpenMeshPython/PythonTests/addMesh.ofp
+23
-0
Plugin-OpenMeshPython/PythonTests/properties.ofp
Plugin-OpenMeshPython/PythonTests/properties.ofp
+15
-0
No files found.
Plugin-OpenMeshPython/PythonTests/CMakeLists.txt
0 → 100644
View file @
8b7fc743
# Include Testing package
if
(
BUILD_TESTING
)
include
(
${
CMAKE_SOURCE_DIR
}
/OpenFlipper/tests/testGenerators.cmake
)
# ========================================================================
# ========================================================================
# Tests
# ========================================================================
# ========================================================================
run_local_script_test
(
"addMesh.ofp"
)
run_local_script_test
(
"properties.ofp"
)
endif
()
Plugin-OpenMeshPython/PythonTests/addMesh.ofp
0 → 100644
View file @
8b7fc743
import OpenMeshPython as om
import numpy as np
core.clearAll()
original = om.read_trimesh("OpenFlipper/cube1.off")
original_verts = original.points().copy()
original_noise = np.random.uniform(size=(original.n_vertices(), 10))
original.set_vertex_property_array("noise", original_noise)
om.addMesh(original, "mesh")
copy = om.getMesh("mesh")
if not np.allclose(copy.points(), original_verts):
print("error: points()")
print("vertex coordinates changed as a result of addMesh() and getMesh()")
core.exitFailure()
if not np.allclose(copy.vertex_property_array("noise"), original_noise):
print("error: vertex_property_array()")
print("vertex property changed as a result of addMesh() and getMesh()")
core.exitFailure()
Plugin-OpenMeshPython/PythonTests/properties.ofp
0 → 100644
View file @
8b7fc743
import OpenMeshPython as om
import numpy as np
core.clearAll()
id = primitivesgenerator.addSphere()
mesh = om.getMesh(id)
if not mesh.has_vertex_property("v:points"):
core.exitFailure()
for vh in mesh.vertices():
if not np.allclose(mesh.vertex_property("v:points", vh), mesh.point(vh)):
core.exitFailure()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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