示例#1
0
 public SingleMaterialFFFPrintGenPro(PrintMeshAssembly meshes,
                                     PlanarSliceStack slices,
                                     SingleMaterialFFFSettings settings,
                                     AssemblerFactoryF overrideAssemblerF = null)
     : base(meshes, slices, settings, overrideAssemblerF)
 {
 }
示例#2
0
 public SLSPrintGenerator(PrintMeshAssembly meshes,
                          PlanarSliceStack slices,
                          SingleMaterialFFFSettings settings,
                          ThreeAxisLaserCompiler compiler)
 {
     Initialize(meshes, slices, settings, compiler);
 }
 public SLSPrintGenerator(PrintMeshAssembly meshes,
                          PlanarSliceStack slices,
                          PrintProfileFFF settings,
                          IThreeAxisLaserCompiler compiler)
 {
     Initialize(meshes, slices, settings, compiler);
 }
 public SingleMaterialFFFPrintGenerator(PrintMeshAssembly meshes,
                                        PlanarSliceStack slices,
                                        SingleMaterialFFFSettings settings,
                                        AssemblerFactoryF overrideAssemblerF = null)
 {
     Initialize(meshes, slices, settings, overrideAssemblerF);
 }
示例#5
0
        public GCodeFile GCodeFromPrintMeshAssembly(PrintMeshAssembly printMeshAssembly, out IEnumerable <string> generationReport, TPrintSettings settings = null)
        {
            PlanarSliceStack slices = null;

            if (AcceptsParts)
            {
                SliceMesh(printMeshAssembly, out slices);
            }

            var globalSettings = settings ?? settingsBuilder.Settings;

            // Run the print generator
            logger.WriteLine("Running print generator...");
            var printGenerator = new TPrintGenerator();
            AssemblerFactoryF overrideAssemblerF = globalSettings.AssemblerType();

            printGenerator.Initialize(printMeshAssembly, slices, globalSettings, overrideAssemblerF);

            if (printGenerator.Generate())
            {
                generationReport = printGenerator.GenerationReport;
                return(printGenerator.Result);
            }
            else
            {
                throw new Exception("PrintGenerator failed to generate gcode!");
            }
        }
示例#6
0
        public virtual GCodeFile GCodeFromPrintMeshAssembly(PrintMeshAssembly printMeshAssembly, out GCodeGenerationDetails details, TPrintSettings settings = null, CancellationToken?cancellationToken = null)
        {
            PlanarSliceStack slices = null;

            var globalSettings = settings ?? settingsBuilder.Settings;

            if (AcceptsParts)
            {
                SliceMesh(printMeshAssembly, out slices, globalSettings.Part.LayerHeightMM);
            }

            // Run the print generator
            logger.WriteLine("Running print generator...");
            var printGenerator = new TPrintGenerator();
            AssemblerFactoryF overrideAssemblerF = (globalSettings.MachineProfile as MachineProfileBase).AssemblerFactory();

            printGenerator.Initialize(printMeshAssembly, slices, globalSettings, overrideAssemblerF);

            if (printGenerator.Generate(cancellationToken))
            {
                details = new GCodeGenerationDetails(printGenerator.PrintTimeEstimate, printGenerator.MaterialUsageEstimate, printGenerator.Warnings);
                return(printGenerator.Result);
            }
            else
            {
                throw new Exception("PrintGenerator failed to generate gcode!");
            }
        }
示例#7
0
 public bool Add(PrintMeshAssembly assy)
 {
     foreach (var pair in assy.MeshesAndOptions())
     {
         AddMesh(pair.Item1, pair.Item2);
     }
     return(true);
 }
示例#8
0
 public void Initialize(PrintMeshAssembly meshes,
                        PlanarSliceStack slices,
                        SingleMaterialFFFSettings settings,
                        ThreeAxisLaserCompiler compiler)
 {
     PrintMeshes = meshes;
     Slices      = slices;
     Settings    = settings;
     Compiler    = compiler;
 }
 public void Initialize(PrintMeshAssembly meshes,
                        PlanarSliceStack slices,
                        PrintProfileFFF settings,
                        IThreeAxisLaserCompiler compiler)
 {
     PrintMeshes = meshes;
     Slices      = slices;
     Settings    = settings;
     Compiler    = compiler;
 }
示例#10
0
 private PrintMeshAssembly PrintMeshAssemblyFromMeshes(IEnumerable <DMesh3> meshes)
 {
     if (AcceptsParts)
     {
         var printMeshAssembly = new PrintMeshAssembly();
         printMeshAssembly.AddMeshes(meshes, PrintMeshOptionsFactory.Default());
         return(printMeshAssembly);
     }
     return(null);
 }
        public GenericSLSPrintGenerator(PrintMeshAssembly meshes,
                                        PlanarSliceStack slices,
                                        SingleMaterialFFFSettings settings)
        {
            file_accumulator = new GCodeFileAccumulator();
            //builder = new GCodeBuilder(file_accumulator);
            //compiler = new SLSCompiler(builder, settings);
            compiler = new SLSCompiler(settings);

            base.Initialize(meshes, slices, settings, compiler);
        }
        public override void Initialize(PrintMeshAssembly meshes,
                                        PlanarSliceStack slices,
                                        SingleMaterialFFFSettings settings,
                                        AssemblerFactoryF overrideAssemblerF = null)
        {
            file_accumulator = new GCodeFileAccumulator();
            builder          = new GCodeBuilder(file_accumulator);
            AssemblerFactoryF useAssembler = overrideAssemblerF ?? settings.AssemblerType();

            compiler = new SingleMaterialFFFCompiler(builder, settings, useAssembler);
            Initialize(meshes, slices, settings, compiler);
        }
示例#13
0
        private void SliceMesh(PrintMeshAssembly meshes, out PlanarSliceStack slices)
        {
            logger?.WriteLine("Slicing...");

            // Do slicing
            MeshPlanarSlicer slicer = new MeshPlanarSlicer()
            {
                LayerHeightMM = Settings.LayerHeightMM
            };

            slicer.Add(meshes);
            slices = slicer.Compute();
        }
示例#14
0
        protected virtual void SliceMesh(PrintMeshAssembly meshes, out PlanarSliceStack slices, double layerHeight)
        {
            logger?.WriteLine("Slicing...");

            // Do slicing
            MeshPlanarSlicer slicer = new MeshPlanarSlicer()
            {
                LayerHeightMM = layerHeight,
            };

            slicer.Add(meshes);
            slices = slicer.Compute();
        }
示例#15
0
        public GCodeFile GenerateGCode(IList <Tuple <DMesh3, TPrintSettings> > parts,
                                       TPrintSettings globalSettings,
                                       out IEnumerable <string> generationReport,
                                       Action <GCodeLine> gcodeLineReadyF = null,
                                       Action <string> progressMessageF   = null)
        {
            if (AcceptsParts == false && parts != null && parts.Count > 0)
            {
                throw new Exception("Must pass null or empty list of parts to generator that does not accept parts.");
            }

            // Create print mesh set
            PrintMeshAssembly meshes = new PrintMeshAssembly();

            foreach (var part in parts)
            {
                if (part.Item2 != null)
                {
                    throw new ArgumentException($"Entries for the `parts` arguments must have a null second item since this generator does not handle per-part settings.");
                }
                meshes.AddMesh(part.Item1, PrintMeshOptions.Default());
            }

            progressMessageF?.Invoke("Slicing...");

            // Do slicing
            MeshPlanarSlicer slicer = new MeshPlanarSlicer()
            {
                LayerHeightMM = globalSettings.LayerHeightMM
            };

            slicer.Add(meshes);
            PlanarSliceStack slices = slicer.Compute();

            // Run the print generator
            progressMessageF?.Invoke("Running print generator...");
            var printGenerator = new TPrintGenerator();
            AssemblerFactoryF overrideAssemblerF = globalSettings.AssemblerType();

            printGenerator.Initialize(meshes, slices, globalSettings, overrideAssemblerF);

            if (printGenerator.Generate())
            {
                generationReport = printGenerator.GenerationReport;
                return(printGenerator.Result);
            }
            else
            {
                throw new Exception("PrintGenerator failed to generate gcode!");
            }
        }