CAM: Add comprehensive TSP tunnel solver tests and wrapper function
Added extensive test coverage for the TSP tunnel solver including linear tunnels, pentagram diagonals, and complex wire geometries with various constraint combinations. Introduced a Python wrapper function for tunnel sorting that integrates with the C++ solver. src/Mod/CAM/CAMTests/TestTSPSolver.py: - Renumbered existing tests to run in sequential order (test_01_simple_tsp, test_02_start_point, etc.) - Added print_tunnels() helper function for displaying tunnel information with original indices - Added test_06_tunnels_tsp: Tests 7 linear tunnels with varying lengths, connectivity, and flipping behavior - Added test_07_pentagram_tunnels_tsp: Tests pentagram diagonal tunnels with no constraints, start+end constraints, and start-only constraints - Added test_08_open_wire_end_only: Tests end-only constraint on complex wire with 8 tunnels including crossings and diagonals src/Mod/CAM/PathScripts/PathUtils.py: - Added sort_tunnels_tsp() wrapper function that interfaces with the C++ tsp_solver.solveTunnels() - Supports allowFlipping, routeStartPoint, and routeEndPoint parameters
This commit is contained in:
@@ -183,7 +183,7 @@ std::vector<py::dict> tspSolveTunnelsPy(
|
||||
tunnelDict["endY"] = tunnel.endY;
|
||||
tunnelDict["isOpen"] = tunnel.isOpen;
|
||||
tunnelDict["flipped"] = tunnel.flipped;
|
||||
tunnelDict["originalIdx"] = tunnel.originalIdx;
|
||||
tunnelDict["index"] = tunnel.index;
|
||||
pyResult.push_back(tunnelDict);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user