/// <summary>
        /// Because Structure.Margin() has upper limit of 50mm for the margin, this
        /// extension allows larger values.
        /// </summary>
        /// <param name="target"></param>
        /// <param name="ss"></param>
        /// <param name="mm"></param>
        /// <returns></returns>
        public static SegmentVolume LargeMargin(this Structure target, double mm)
        {
            double        mmLeft     = mm;
            SegmentVolume targetLeft = target.SegmentVolume;

            while (mmLeft > 50)
            {
                mmLeft    -= 50;
                targetLeft = targetLeft.Margin(50);
            }
            SegmentVolume result = targetLeft.Margin(mmLeft);

            return(result);
        }
Beispiel #2
0
 /// <summary>
 /// Crop structure from another structure
 /// </summary>
 /// <param name="structureToCrop"></param>
 /// <param name="StructureToCropFrom"></param>
 /// <param name="cropMargin"></param>
 /// <returns></returns>
 public static SegmentVolume CropStructure(SegmentVolume structureToCrop, SegmentVolume structureToCropFrom, double cropMargin)
 {
     return(structureToCrop.Sub(structureToCropFrom.Margin(cropMargin)));
 }