private static float CalculateLengthScale(StandardLine line, float length)
        {
            if (Utils.ApproximatelyZero(length))
            {
                return(1f);
            }

            var items       = CalculateItems(line, length);
            var totalLength = Utils.CalculateLengthSum(items);

            return(length / totalLength);
        }
        private static float SelectMaxDepth(StandardLine line)
        {
            var items    = line.start.GetValidItems();
            var startMax = Utils.SelectMaxDepth(items);

            items = line.middle.GetValidItems();
            var middleMax = Utils.SelectMaxDepth(items);

            items = line.finish.GetValidItems();
            var finishMax = Utils.SelectMaxDepth(items);

            return(Mathf.Max(startMax, middleMax, finishMax));
        }
        private static float GetTotalMinLength(StandardLine line)
        {
            var result = 0f;

            var items = line.start.GetRequiredItems();

            result += Utils.CalculateLengthSum(items);

            items   = line.middle.GetRequiredItems();
            result += Utils.CalculateLengthSum(items);

            items   = line.finish.GetRequiredItems();
            result += Utils.CalculateLengthSum(items);

            return(result);
        }
        /// ======================================================================

        private static LineGenerationSettings CreateSettings(StandardLine builder, LineDraft draft)
        {
            var result = LineGenerationSettings.Create();

            result.length = draft.length;
            result.height = draft.height;

            result.forwardScale = draft.forwardScale;

            result.parent = draft.parent;
            result.pivot  = draft.pivot;

            result.up      = draft.up;
            result.right   = draft.right;
            result.forward = draft.forward;

            return(result);
        }
        private static float CalculateHeightScale(StandardLine line, float height)
        {
            if (Utils.ApproximatelyZero(height))
            {
                return(1f);
            }

            var startScale  = line.start.GetAvergeScaleByHeight(height);
            var middleScale = line.middle.GetAvergeScaleByHeight(height);
            var finishScale = line.finish.GetAvergeScaleByHeight(height);

            var result = Utils.GetAverage(startScale, middleScale, finishScale);

            if (Utils.ApproximatelyZero(result))
            {
                return(1f);
            }

            return(result);
        }