예제 #1
0
        public ToolpathSet()
        {
            Paths = new List <IToolpath>();

            eType    = ToolpathTypes.Custom;
            isPlanar = isLinear = false;
        }
예제 #2
0
 public LinearToolpath3(ILinearToolpath <T> copy)
 {
     Path      = new List <T>();
     _pathtype = copy.Type;
     foreach (T v in copy)
     {
         Path.Add(v);
     }
 }
예제 #3
0
        public virtual Vector3d AppendZChange(double ZDelta, double fSpeed, ToolpathTypes ttype = ToolpathTypes.PlaneChange)
        {
            LinearToolpath zup = new LinearToolpath(ttype);

            zup.AppendVertex(new PrintVertex(currentPos, NO_RATE, NO_DIM), TPVertexFlags.IsPathStart);
            Vector3d toPos = new Vector3d(currentPos);

            toPos.z += ZDelta;
            zup.AppendVertex(new PrintVertex(toPos, fSpeed, NO_DIM), TPVertexFlags.IsPathEnd);
            AppendPath(zup);
            return(currentPos);
        }
예제 #4
0
        public void BeginTravel()
        {
            var newPath = new PolyLine3d();

            if (ActivePath != null && ActivePath.VertexCount > 0)
            {
                newPath.AppendVertex(ActivePath.End);
            }

            push_active_path();
            ActivePath     = newPath;
            ActivePathType = ToolpathTypes.Travel;
        }
예제 #5
0
 public void Append(IToolpath path)
 {
     if (Paths.Count == 0)
     {
         eType    = path.Type;
         isPlanar = path.IsPlanar;
         isLinear = path.IsLinear;
     }
     else if (eType != path.Type)
     {
         eType    = ToolpathTypes.Composite;
         isPlanar = isPlanar && path.IsPlanar;
         isLinear = isLinear && path.IsLinear;
     }
     Paths.Add(path);
 }
예제 #6
0
        public void LinearMoveToAbsolute3d(LinearMoveData move)
        {
            if (ActivePath == null)
            {
                throw new Exception("GCodeToLayerPaths.LinearMoveToAbsolute3D: ActivePath is null!");
            }

            // if we are doing a Z-move, convert to 3D path
            bool bZMove = (ActivePath.VertexCount > 0 && ActivePath.End.z != move.position.z);

            if (bZMove)
            {
                ActivePathType = ToolpathTypes.PlaneChange;
            }

            ActivePath.AppendVertex(move.position);
        }
예제 #7
0
 public void ChangeType(ToolpathTypes type)
 {
     Type = type;
 }
예제 #8
0
        // todo: add speed
        //  ?? extend PolyLine3d ??

        public LinearToolpath3(ToolpathTypes type = ToolpathTypes.Travel)
        {
            Path      = new List <T>();
            _pathtype = type;
        }
예제 #9
0
        public virtual Vector3d AppendMoveToZ(double ZAbs, double fSpeed, ToolpathTypes ttype = ToolpathTypes.PlaneChange)
        {
            double zDelta = ZAbs - currentPos.z;

            return(AppendZChange(zDelta, fSpeed, ttype));
        }