コード例 #1
0
        public ContourStitcher(ContourLine line1, ContourLine line2)
        {
            if (line1.GetZ() > line2.GetZ())
            {
                lineUp   = line1;
                lineDown = line2;
            }
            else
            {
                lineUp   = line2;
                lineDown = line1;
            }
            lineUpProcessed   = new List <FloatDouble>(lineUp.GetLinePointCount());
            lineDownProcessed = new List <FloatDouble>(lineDown.GetLinePointCount());
            CopyArray(lineUp.GetPointList(), lineUpProcessed);
            CopyArray(lineDown.GetPointList(), lineDownProcessed);
            boxUp   = lineUp.GetBox();
            boxDown = lineDown.GetBox();
            Point3d cU = boxUp.GetCenter();
            Point3d cD = boxDown.GetCenter();

            ContourLineSurfaceGenerator.Transform(lineDownProcessed, -cD.X, -cD.Y);
            ContourLineSurfaceGenerator.Transform(lineUpProcessed, -cU.X, -cU.Y);
            int indexDown = GetNearIndex();

            AdjustDownArray(indexDown);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: zhy890524/SeededGrow2d
        static void Main(string[] args)
        {
            ContourLine line0 = new ContourLine();

            line0.SetZ(-3);
            ContourLine line1 = new ContourLine();

            line1.SetZ(0);
            ContourLine line2 = new ContourLine();

            line2.SetZ(3);
            ContourLine line3 = new ContourLine();

            line3.SetZ(8);

            Test4(line0, line1, line2, line3);
            //ContourStitcher cs = new ContourStitcher(line1, line3);
            //Mesh m = cs.DoStitching();
            List <ContourLine> list = new List <ContourLine>()
            {
                line0, line1, line2, line3
            };
            ContourLineSurfaceGenerator scg = new ContourLineSurfaceGenerator(list);
            Mesh m = scg.GenerateSurface();

            m.Scale(20, 20, 20);
            m.Transform(300, 300, 300);
            PlyManager.Output(m, "test2.ply");
        }