コード例 #1
0
ファイル: BandsTechOperation.cs プロジェクト: airmay/CAM
        public void CalcPassList()
        {
            if (TechProcess.Tool.Thickness == null)
            {
                Acad.Alert("Не указана толщина инструмента");
                return;
            }
            var toolThickness = TechProcess.Tool.Thickness.Value;

            if (MaxCrestWidth == 0 || MaxCrestWidth > toolThickness)
            {
                MaxCrestWidth = toolThickness;
            }
            var periodAll   = BandWidth - toolThickness;
            var periodWidth = toolThickness + MaxCrestWidth;
            var count       = Math.Ceiling(periodAll / periodWidth);

            periodWidth = periodAll / count;
            var x     = (toolThickness - (periodWidth - toolThickness)) / 2;
            var shift = TechProcess.MachineType == MachineType.ScemaLogic ^ ProcessingAngle == 45? toolThickness : 0;

            PassList.Clear();
            PassList.Add(new Pass(shift, CuttingType.Roughing));
            for (int i = 1; i <= count; i++)
            {
                PassList.Add(new Pass(i * periodWidth + shift, CuttingType.Roughing));
                PassList.Add(new Pass(i * periodWidth + x + shift - toolThickness, CuttingType.Finishing));
            }
        }
コード例 #2
0
        /// <summary>
        ///		Removes all passes from this technique and queues them for deletion.
        /// </summary>
        public void RemoveAllPasses()
        {
            // load each pass
            for (int i = 0; i < passes.Count; i++)
            {
                Pass pass = (Pass)passes[i];
                pass.QueueForDeletion();
            }

            passes.Clear();
        }