|
4 | 4 |
|
5 | 5 | MR_ADD_PYTHON_CUSTOM_DEF( mrmeshpy, Decimate, [] ( pybind11::module_& m ) |
6 | 6 | { |
| 7 | + pybind11::enum_<MR::DecimateStrategy>( m, "DecimateStrategy", "Defines the order of edge collapses inside Decimate algorithm" ). |
| 8 | + value( "MinimizeError", MR::DecimateStrategy::MinimizeError, "the next edge to collapse will be the one that introduced minimal error to the surface" ). |
| 9 | + value( "ShortestEdgeFirst", MR::DecimateStrategy::ShortestEdgeFirst, "the next edge to collapse will be the shortest one" ); |
| 10 | + |
7 | 11 | pybind11::class_<MR::DecimateSettings>( m, "DecimateSettings", "Parameters structure for decimateMesh" ). |
8 | 12 | def( pybind11::init<>() ). |
9 | | - def_readwrite( "maxError", &MR::DecimateSettings::maxError, "stop the decimation as soon as the estimated distance deviation from the original mesh is more than this value" ). // only comment about default strategy |
| 13 | + def_readwrite( "strategy", &MR::DecimateSettings::strategy ). |
| 14 | + def_readwrite( "maxError", &MR::DecimateSettings::maxError, |
| 15 | + "for DecimateStrategy::MinimizeError:\n" |
| 16 | + "\tstop the decimation as soon as the estimated distance deviation from the original mesh is more than this value\n" |
| 17 | + "for DecimateStrategy::ShortestEdgeFirst only:\n" |
| 18 | + "\tstop the decimation as soon as the shortest edge in the mesh is greater than this value" ). |
| 19 | + def_readwrite( "maxEdgeLen", &MR::DecimateSettings::maxEdgeLen, "Edges longer than this value will not be collapsed (but they can appear after collapsing of shorter ones)" ). |
10 | 20 | def_readwrite( "maxDeletedFaces", &MR::DecimateSettings::maxDeletedFaces, "Limit on the number of deleted faces" ). |
11 | 21 | def_readwrite( "maxDeletedVertices", &MR::DecimateSettings::maxDeletedVertices, "Limit on the number of deleted vertices" ). |
12 | 22 | def_readwrite( "maxTriangleAspectRatio", &MR::DecimateSettings::maxTriangleAspectRatio, "Maximal possible aspect ratio of a triangle introduced during decimation" ). |
13 | 23 | def_readwrite( "stabilizer", &MR::DecimateSettings::stabilizer, |
14 | 24 | "Small stabilizer is important to achieve good results on completely planar mesh parts,\n" |
15 | 25 | "if your mesh is not-planer everywhere, then you can set it to zero" ). |
16 | | - def_readwrite( "region", &MR::DecimateSettings::region, "Region on mesh to be decimated, it is updated during the operation" ); |
| 26 | + def_readwrite("optimizeVertexPos",&MR::DecimateSettings::optimizeVertexPos, |
| 27 | + "if true then after each edge collapse the position of remaining vertex is optimized to\n" |
| 28 | + "minimize local shape change, if false then the edge is collapsed in one of its vertices, which keeps its position" ). |
| 29 | + def_readwrite( "region", &MR::DecimateSettings::region, "Region on mesh to be decimated, it is updated during the operation" ). |
| 30 | + def_readwrite( "touchBdVertices", &MR::DecimateSettings::touchBdVertices, "Whether to allow collapsing edges having at least one vertex on (region) boundary" ). |
| 31 | + def_readwrite( "packMesh", &MR::DecimateSettings::packMesh, "whether to pack mesh at the end" ); |
17 | 32 |
|
18 | 33 | pybind11::class_<MR::DecimateResult>( m, "DecimateResult", "Results of decimateMesh" ). |
19 | 34 | def( pybind11::init<>() ). |
|
0 commit comments