// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Mar. 14, 1997 // // Description: // Global function to make sure the options for rebuildCurve are set. // // Input Arguments: // Force the factory setting or not. // // Return Value: // None. // global proc rebuildCurveSetOptionVars( int $forceFactorySettings ) { // Keep Original option var. This corresponds to the // "-rpo/-replaceOriginal" flag for rebuild curve commands. if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepOriginal`) { optionVar -intValue rebuildCurveKeepOriginal 0; } // -nc/-noChanges boolean if ($forceFactorySettings || !`optionVar -exists rebuildCurveChanges`) { optionVar -intValue rebuildCurveChanges 1; } // Rebuild Type , one of Uniform, Reduce Spans, Match Knots, // No Mult. Knots, Curvature. if ($forceFactorySettings || !`optionVar -exists rebuildCurveType`) { optionVar -intValue rebuildCurveType 0; } // Uniform Rebuild Type: Number of resulting spans and degree when // rebuilding a curve. if ($forceFactorySettings || !`optionVar -exists rebuildCurveTypeUniformNumSpans`) { optionVar -intValue rebuildCurveTypeUniformNumSpans 4; } if ($forceFactorySettings || !`optionVar -exists rebuildCurveTypeUniformDegree`) { optionVar -intValue rebuildCurveTypeUniformDegree 3; } // End knots - nonmultiple if ($forceFactorySettings || !`optionVar -exists rebuildCurveEndKnots`) { optionVar -intValue rebuildCurveEndKnots 1; } // Keep Parameter Range - boolean if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepRange`) { optionVar -intValue rebuildCurveKeepRange 0; } // Keep Control Points - boolean if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepControlPoints`) { optionVar -intValue rebuildCurveKeepControlPoints 0; } // Keep End Points - boolean if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepEndPoints`) { optionVar -intValue rebuildCurveKeepEndPoints 1; } // Keep End Tangents - boolean for curves only if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepEndTangents`) { optionVar -intValue rebuildCurveKeepEndTangents 0; } // Keep Num Spans - boolean if ($forceFactorySettings || !`optionVar -exists rebuildCurveKeepNumSpans`) { optionVar -intValue rebuildCurveKeepNumSpans 0; } // Tolerance for rebuilding curves - whether to use global or local // tolerance (boolean), local tolerance (float) if ($forceFactorySettings || !`optionVar -exists rebuildCurveUseGlobalTolerance`) { optionVar -intValue rebuildCurveUseGlobalTolerance 1; } if ($forceFactorySettings || !`optionVar -exists rebuildCurveLocalTolerance`) { optionVar -floatValue rebuildCurveLocalTolerance 0.05; } }