Пример #1
0
 private void AddEntity(PathEntity5Axis pe)
 {
     if (toolpath.Count > 0)
     {
         pe.PrevPosition = new CNCLib.XYZBCMachPosition(toolpath.Last().Position);
     }
     else
     {
         pe.PrevPosition = new CNCLib.XYZBCMachPosition(pe.Position);
     }
     toolpath.Add(pe);
 }
Пример #2
0
        internal ToolPath5Axis ParsePath(List <string> file)
        {
            jeton = false;
            int pathNumber = 0;

            foreach (string line in file)
            {
                BlockType blockT = BlockType.Unknown;

                if (!jeton)
                {
                    jeton = isPathStart(line);
                }
                else
                {
                    jeton = !isPathEnd(line);
                }

                if (isPath(line, out blockT))
                {
                    PathEntity5Axis pe = parseString(line, blockT, jeton);
                    pe.PathNumber = pathNumber;

                    path.Add(pe);
                    pathNumber++;
                }
            }
            for (int i = 1; i < path.Count; i++)
            {
                if (path[i].JetOn && !path[i - 1].JetOn)
                {
                    path[i - 1].JetOn    = true;
                    path[i - 1].Feedrate = path[i].Feedrate;
                }
            }
            // calc arc sweep angle and travel time for each segment

            calcPathLengths();
            fillMissingCoords();
            return(path);
        }