コード例 #1
0
        public virtual Vector3d AppendExtrude(List <Vector2d> toPoints,
                                              double fSpeed, Vector2d dimensions,
                                              FillTypeFlags pathTypeFlags         = FillTypeFlags.Unknown,
                                              List <TPVertexFlags> perVertexFlags = null)
        {
            Vector2d useDims = currentDims;

            if (dimensions.x > 0 && dimensions.x != NO_DIM.x)
            {
                useDims.x = dimensions.x;
            }
            if (dimensions.y > 0 && dimensions.y != NO_DIM.y)
            {
                useDims.y = dimensions.y;
            }

            LinearToolpath extrusion = new LinearToolpath(ToolpathTypes.Deposition);

            extrusion.TypeModifiers = pathTypeFlags;
            extrusion.AppendVertex(new PrintVertex(currentPos, NO_RATE, useDims), TPVertexFlags.IsPathStart);

            for (int k = 0; k < toPoints.Count; ++k)
            {
                Vector3d      pos  = new Vector3d(toPoints[k].x, toPoints[k].y, currentPos.z);
                TPVertexFlags flag = (k == toPoints.Count - 1) ? TPVertexFlags.IsPathEnd : TPVertexFlags.None;
                extrusion.AppendVertex(new PrintVertex(pos, fSpeed, useDims), flag);
            }
            if (perVertexFlags != null)
            {
                ToolpathUtil.AddPerVertexFlags(extrusion, perVertexFlags);
            }
            AppendPath(extrusion);
            return(currentPos);
        }
コード例 #2
0
        public virtual LinearToolpath CreateExtrude(
            List <Vector2d> toPoints,
            double fSpeed, Vector2d dimensions,
            IFillType fillType,
            bool isHole,
            List <TPVertexFlags> perVertexFlags = null)
        {
            Vector2d useDims = currentDims;

            if (dimensions.x > 0 && dimensions.x != NO_DIM.x)
            {
                useDims.x = dimensions.x;
            }
            if (dimensions.y > 0 && dimensions.y != NO_DIM.y)
            {
                useDims.y = dimensions.y;
            }

            LinearToolpath extrusion = new LinearToolpath(MoveType);

            extrusion.FillType = fillType;
            extrusion.AppendVertex(new PrintVertex(currentPos, NO_RATE, useDims), TPVertexFlags.IsPathStart);

            for (int k = 1; k < toPoints.Count; ++k)
            {
                Vector3d      pos  = new Vector3d(toPoints[k].x, toPoints[k].y, currentPos.z);
                TPVertexFlags flag = (k == toPoints.Count - 1) ? TPVertexFlags.IsPathEnd : TPVertexFlags.None;
                extrusion.AppendVertex(new PrintVertex(pos, fSpeed, useDims), flag);
            }
            if (perVertexFlags != null)
            {
                ToolpathUtil.AddPerVertexFlags(extrusion, perVertexFlags);
            }
            return(extrusion);
        }
コード例 #3
0
        public virtual Vector3d AppendExtrude(List <Vector3d> toPoints, double fSpeed,
                                              IFillType fillType, List <TPVertexFlags> perVertexFlags = null)
        {
            LinearToolpath extrusion = new LinearToolpath(MoveType);

            extrusion.FillType = fillType;
            extrusion.AppendVertex(new PrintVertex(currentPos, NO_RATE, currentDims), TPVertexFlags.IsPathStart);
            for (int k = 0; k < toPoints.Count; ++k)
            {
                TPVertexFlags flag = (k == toPoints.Count - 1) ? TPVertexFlags.IsPathEnd : TPVertexFlags.None;
                extrusion.AppendVertex(new PrintVertex(toPoints[k], fSpeed, currentDims), flag);
            }
            if (perVertexFlags != null)
            {
                ToolpathUtil.AddPerVertexFlags(extrusion, perVertexFlags);
            }
            AppendPath(extrusion);
            return(currentPos);
        }