Пример #1
0
        public void NestPaths(VectorDocument doc, int size, uint sheet)
        {
            CutLibWrapper.CutTestResult res = new CutLibWrapper.CutTestResult();

            CutLibWrapper.ResetSheet(sheet, size);

            doc.DocHeight = size;

            foreach (VectorPath pi in doc.Paths)
            {
                pi.Nested = false;
            }

            VectorPath p = null;

            while ((p = GetPathByMaxArea(doc)) != null)
            {
                res.resultOK = false;
                CutLibWrapper.TestShape(sheet, p.Shape, ref res, true, 0);

                if (res.resultOK)
                {
                    CutLibWrapper.Plot(sheet, p.Shape, res.angle, res.x, res.y);

                    p.SetPos(res.x, res.y);
                    p.Rotate(res.angle);
                }

                p.Nested = true;
            }
        }
Пример #2
0
        public void ResetSheet(int size)
        {
            if (cutSheet < 0)
            {
                cutSheet = (int)CutLibWrapper.CreateSheet(size);
            }

            CutLibWrapper.ResetSheet((uint)cutSheet, size);

            curSize = size;
        }