Commit 25c922d0 authored by Jan Möbius's avatar Jan Möbius

- Added defaults to python smoother function export

- Added smoother python unittest
parent f52ac17d
......@@ -87,8 +87,8 @@ PYBIND11_EMBEDDED_MODULE(Smoother, m) {
py::arg(QCoreApplication::translate("PythonDocSmoother","Number of iterations").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocSmoother","Direction (String containing either tangential,normal or tangential+normal )").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocSmoother","Continuity (String containing either C0 or C1 )").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocSmoother","Max distance the smoothed mesh is allowed to differ from the original").toLatin1().data()),
py::arg(QCoreApplication::translate("PythonDocSmoother","Respect features?").toLatin1().data()));
py::arg(QCoreApplication::translate("PythonDocSmoother","Max distance the smoothed mesh is allowed to differ from the original").toLatin1().data()) = -1.0,
py::arg(QCoreApplication::translate("PythonDocSmoother","Respect features?").toLatin1().data()) = true );
}
......
# Include Testing package
if(BUILD_TESTING)
# ========================================================================
# ========================================================================
# Tests
# ========================================================================
# ========================================================================
include( ${CMAKE_SOURCE_DIR}/OpenFlipper/tests/testGenerators.cmake )
# ========================================================================
# ========================================================================
# Tests
# ========================================================================
# ========================================================================
run_algorithm_test( "smoother_c0_normal_10.ofp" "cube_sharp.off" "result_cube_sharp_smooth_normal_c0_10.off" )
endif()
input = core.loadObject("@OPENFLIPPER_TEST_INPUT_FILE@");
reference = core.loadObject("@OPENFLIPPER_TEST_REFERENCE_FILE@");
smoother.smooth(input,10,"normal","C0");
meshcompare.compare(reference,input);
f = open("@OUTPUT_TEST_DATA_FILE@", "w+")
f.write( "TEST=@TESTNAME@\n" )
f.write( "LOADEDFILE=@OPENFLIPPER_TEST_INPUT_FILE@\n" )
f.write( "MAXIMALDISTANCE_DOUBLE="+str(meshcompare.lastMaximalDistance()) + "\n" )
f.write( "MAXIMALNORMALDEVIATION_DOUBLE="+str(meshcompare.lastMaximalNormalDeviation()) + "\n" )
f.write( "MAXIMALMEANCURVATUREDEVIATION_DOUBLE="+str(meshcompare.lastMaximalMeanCurvatureDeviation()) + "\n" )
f.write( "MAXIMALGAUSSCURVATUREDEVIATION_DOUBLE="+str(meshcompare.lastMaximalGaussCurvatureDeviation()) + "\n" )
f.close()
core.exitApplication();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment