// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // // polyCleanup (command). // // Input Arguments: // 0 / 1 : Do the cleanup on all selectable meshes // 0 / 1 : Only select things that need to be cleaned up // 0 / 1 : With or without construction history // // 0 / 1 : Triangulate 4-sided faces // 0 / 1 : Triangulate > 4-sided faces // 0 / 1 : Triangulate concave faces // 0 / 1 : Triangulate holed faces // 0 / 1 : Triangulate non-planar faces // // 0 / 1 : Delete zero area faces // : Face tolerance // 0 / 1 : Delete zero area edges // : Edge tolerance // 0 / 1 : Delete faces with zero area map (uv area) // : Map tolerance // Returns: // string, of items affected. Empty if no items affected. // // Example: // // Select from all meshes, all of the criteria // // // polyCleanup 1 1 1 1 1 1 1 1 1 0.1 1 0.1 1 0.1; // // Description: // // Perform a 'cleanup' of various 'bad' polygon geometry // attributes. This includes: // // Deletion of: // - zero area face // - zero area edges // - zero area mapped faces // // Triangulization of : // - non-planar polygons // - 4 to N sided polygons // - concave polygons // - polygons with holes. // // Triangulization will occur first, before deletion. // // ////////////////////////////////////////////////////////////////////// global proc string[] polyCleanup(int $allMeshes, int $selectOnly, int $historyOn, int $quads, int $nsided, int $concave, int $holed, int $nonplanar, int $zeroGeom, float $zeroGeomTol, int $zeroEdge, float $zeroEdgeTol, int $zeroMap, float $zeroMapTol) // // Description: // Perform a cleanup on polygonal meshes (command) // Arguments: // allMeshes : All selectable meshes // selectOnly : Only perform a selection // historyOn : keep construction history // // quads : check for quads polys // nsided : check for n-sided polys // nonplanar : check fo non-planar polys // holed : check for holed polys // concave : check for concave polys // // zeroGeom : check for 0 area faces // zeroGeomTol : tolerance for face areas // zeroEdge : check for 0 length edges // zeroEdgeTol : tolerance for edge length // zeroMap : check for 0 uv face area // zeroMapTol : tolerance for uv face areas // // Returns: // list of items cleaned up. Empty if none // { string $args[] = {(string) $allMeshes, $selectOnly, $historyOn, $quads, $nsided, $concave, $holed, $nonplanar, $zeroGeom, $zeroGeomTol, $zeroEdge, $zeroEdgeTol, $zeroMap, $zeroMapTol }; return (polyCleanupArgList ("1", $args)); }