public SCTriangleCrosshatchGenerator(
     MachineConfig machineConfig,
     GeneratorConfig generatorConfig,
     TriTree <PixelTriData> triTree,
     BitMapPointGenerator bitMapPointGenerator) :
     base(machineConfig, bitMapPointGenerator.inputImageBox, generatorConfig)
 {
     this.triTree              = triTree;
     this.BaseFileName         = bitMapPointGenerator.GetBaseName();
     this.bitMapPointGenerator = bitMapPointGenerator;
 }
Esempio n. 2
0
        public static void PNGToLKH(string bmapPath = "bitmap/manga.png")
        {
            //var _crosshatch = FindObjectOfType<SVGCrosshatch>();
            var bmapToPoint = new BitMapPointGenerator(); // _crosshatch.GetBitMapPointGenerator();

            bmapToPoint.bmapName = bmapPath;

            var points = bmapToPoint.getPoints();

            for (int i = 0; i < points.Count; ++i)
            {
                string name    = bmapToPoint.GetBaseName() + i;
                var    tspProb = TSPLibProblem.FromPoints(points[i].GetEnumerator(), name);
                //string name = Path.GetFileNameWithoutExtension(bmapToPoint._bmapName);
                tspProb.WriteParamAndProbWithBaseName(name);
            }
        }