示例#1
0
 public static void createLayerParts(SliceVolumeStorage storage, Slicer slicer, ConfigConstants.REPAIR_OVERLAPS unionAllType)
 {
     for (int layerIndex = 0; layerIndex < slicer.layers.Count; layerIndex++)
     {
         storage.layers.Add(new SliceLayer());
         storage.layers[layerIndex].printZ = slicer.layers[layerIndex].z;
         LayerPart.createLayerWithParts(storage.layers[layerIndex], slicer.layers[layerIndex], unionAllType);
     }
 }
示例#2
0
 public static void CreateLayerParts(SliceVolumeStorage storage, Slicer slicer, ConfigConstants.REPAIR_OVERLAPS unionAllType)
 {
     for (int layerIndex = 0; layerIndex < slicer.layers.Count; layerIndex++)
     {
         storage.layers.Add(new SliceLayer());
         storage.layers[layerIndex].printZ = slicer.layers[layerIndex].Z;
         LayerPart.CreateLayerWithParts(storage.layers[layerIndex], slicer.layers[layerIndex], unionAllType);
     }
 }
示例#3
0
		private void sliceModels(SliceDataStorage storage)
		{
			timeKeeper.Restart();
#if false
            optomizedModel.saveDebugSTL("debug_output.stl");
#endif

			LogOutput.Log("Slicing model...\n");
			List<Slicer> slicerList = new List<Slicer>();
			for (int volumeIndex = 0; volumeIndex < optomizedModel.volumes.Count; volumeIndex++)
			{
				Slicer slicer = new Slicer(optomizedModel.volumes[volumeIndex], config);
				slicerList.Add(slicer);
			}

#if false
            slicerList[0].DumpSegmentsToGcode("Volume 0 Segments.gcode");
            slicerList[0].DumpPolygonsToGcode("Volume 0 Polygons.gcode");
            //slicerList[0].DumpPolygonsToHTML("Volume 0 Polygons.html");
#endif

			LogOutput.Log("Sliced model in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.Seconds));
			timeKeeper.Restart();

			LogOutput.Log("Generating support map...\n");
			storage.support.GenerateSupportGrid(optomizedModel, config);

			storage.modelSize = optomizedModel.size_um;
			storage.modelMin = optomizedModel.minXYZ_um;
			storage.modelMax = optomizedModel.maxXYZ_um;

			LogOutput.Log("Generating layer parts...\n");
			for (int volumeIndex = 0; volumeIndex < slicerList.Count; volumeIndex++)
			{
				storage.volumes.Add(new SliceVolumeStorage());
				LayerPart.CreateLayerParts(storage.volumes[volumeIndex], slicerList[volumeIndex], config.repairOverlaps);

				if (config.enableRaft)
				{
					//Add the raft offset to each layer.
					for (int layerNr = 0; layerNr < storage.volumes[volumeIndex].layers.Count; layerNr++)
					{
						storage.volumes[volumeIndex].layers[layerNr].printZ += config.raftBaseThickness_um + config.raftInterfaceThicknes_um;
					}
				}
			}
			LogOutput.Log("Generated layer parts in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.Seconds));
			timeKeeper.Restart();
		}
示例#4
0
        public void InitializeLayerData(Slicer slicer, ConfigSettings config)
        {
            for (int layerIndex = 0; layerIndex < slicer.layers.Count; layerIndex++)
            {
                if (config.outputOnlyFirstLayer && layerIndex > 0)
                {
                    break;
                }

                Layers.Add(new SliceLayer());
                Layers[layerIndex].LayerZ = slicer.layers[layerIndex].Z;

                Layers[layerIndex].AllOutlines = slicer.layers[layerIndex].PolygonList;

                Layers[layerIndex].AllOutlines = Layers[layerIndex].AllOutlines.GetCorrectedWinding();
            }
        }
示例#5
0
        private void sliceModels(SliceDataStorage storage)
        {
            timeKeeper.Restart();
            #if false
            optomizedModel.saveDebugSTL("debug_output.stl");
            #endif

            LogOutput.Log("Slicing model...\n");
            List<Slicer> slicerList = new List<Slicer>();
            for (int volumeIndex = 0; volumeIndex < optomizedModel.volumes.Count; volumeIndex++)
            {
                Slicer slicer = new Slicer(optomizedModel.volumes[volumeIndex], config);
                slicerList.Add(slicer);
            }

            #if false
            slicerList[0].DumpSegmentsToGcode("Volume 0 Segments.gcode");
            slicerList[0].DumpPolygonsToGcode("Volume 0 Polygons.gcode");
            //slicerList[0].DumpPolygonsToHTML("Volume 0 Polygons.html");
            #endif

            LogOutput.Log("Sliced model in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.Seconds));
            timeKeeper.Restart();

            LogOutput.Log("Generating support map...\n");
            storage.support.GenerateSupportGrid(optomizedModel, config);

            storage.modelSize = optomizedModel.size_um;
            storage.modelMin = optomizedModel.minXYZ_um;
            storage.modelMax = optomizedModel.maxXYZ_um;

            LogOutput.Log("Generating layer parts...\n");
            for (int volumeIndex = 0; volumeIndex < slicerList.Count; volumeIndex++)
            {
                storage.volumes.Add(new SliceVolumeStorage());
                LayerPart.CreateLayerParts(storage.volumes[volumeIndex], slicerList[volumeIndex], config.repairOverlaps);

                if (config.enableRaft)
                {
                    //Add the raft offset to each layer.
                    for (int layerNr = 0; layerNr < storage.volumes[volumeIndex].layers.Count; layerNr++)
                    {
                        storage.volumes[volumeIndex].layers[layerNr].printZ += config.raftBaseThickness_um + config.raftInterfaceThicknes_um;
                    }
                }
            }
            LogOutput.Log("Generated layer parts in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.Seconds));
            timeKeeper.Restart();
        }
示例#6
0
		private void SliceModels(LayerDataStorage slicingData)
		{
			timeKeeper.Restart();
#if false
            optomizedModel.saveDebugSTL("debug_output.stl");
#endif

			LogOutput.Log("Slicing model...\n");
			List<Slicer> slicerList = new List<Slicer>();
			for (int optimizedMeshIndex = 0; optimizedMeshIndex < optomizedMeshCollection.OptimizedMeshes.Count; optimizedMeshIndex++)
			{
				Slicer slicer = new Slicer(optomizedMeshCollection.OptimizedMeshes[optimizedMeshIndex], config);
				slicerList.Add(slicer);
			}

#if false
            slicerList[0].DumpSegmentsToGcode("Volume 0 Segments.gcode");
            slicerList[0].DumpPolygonsToGcode("Volume 0 Polygons.gcode");
            //slicerList[0].DumpPolygonsToHTML("Volume 0 Polygons.html");
#endif

			LogOutput.Log("Sliced model in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.TotalSeconds));
			timeKeeper.Restart();

			slicingData.modelSize = optomizedMeshCollection.size_um;
			slicingData.modelMin = optomizedMeshCollection.minXYZ_um;
			slicingData.modelMax = optomizedMeshCollection.maxXYZ_um;

			LogOutput.Log("Generating layer parts...\n");
			for (int extruderIndex = 0; extruderIndex < slicerList.Count; extruderIndex++)
			{
				slicingData.Extruders.Add(new ExtruderLayers());
				slicingData.Extruders[extruderIndex].InitializeLayerData(slicerList[extruderIndex]);

				if (config.enableRaft)
				{
					//Add the raft offset to each layer.
					for (int layerIndex = 0; layerIndex < slicingData.Extruders[extruderIndex].Layers.Count; layerIndex++)
					{
						slicingData.Extruders[extruderIndex].Layers[layerIndex].LayerZ += config.raftBaseThickness_um + config.raftInterfaceThicknes_um;
					}
				}
			}
			LogOutput.Log("Generated layer parts in {0:0.0}s\n".FormatWith(timeKeeper.Elapsed.TotalSeconds));
			timeKeeper.Restart();
		}
示例#7
0
		public void InitializeLayerData(Slicer slicer)
		{
			for (int layerIndex = 0; layerIndex < slicer.layers.Count; layerIndex++)
			{
				Layers.Add(new SliceLayer());
				Layers[layerIndex].LayerZ = slicer.layers[layerIndex].Z;

				Layers[layerIndex].AllOutlines = slicer.layers[layerIndex].PolygonList;

				Layers[layerIndex].AllOutlines = Layers[layerIndex].AllOutlines.GetCorrectedWinding();
			}
		}
示例#8
0
        public void InitializeLayerData(Slicer slicer, ConfigSettings config)
        {
            for (int layerIndex = 0; layerIndex < slicer.layers.Count; layerIndex++)
            {
                if (config.outputOnlyFirstLayer && layerIndex > 0)
                {
                    break;
                }

                Layers.Add(new SliceLayer());
                Layers[layerIndex].LayerZ = slicer.layers[layerIndex].Z;

                Layers[layerIndex].AllOutlines = slicer.layers[layerIndex].PolygonList;

                Layers[layerIndex].AllOutlines = Layers[layerIndex].AllOutlines.GetCorrectedWinding();
            }
        }