public SingleMaterialFFFPrintGenerator(PrintMeshAssembly meshes,
                                        PlanarSliceStack slices,
                                        SingleMaterialFFFSettings settings,
                                        AssemblerFactoryF overrideAssemblerF = null)
 {
     Initialize(meshes, slices, settings, overrideAssemblerF);
 }
Esempio n. 2
0
 public SLSPrintGenerator(PrintMeshAssembly meshes,
                          PlanarSliceStack slices,
                          SingleMaterialFFFSettings settings,
                          ThreeAxisLaserCompiler compiler)
 {
     Initialize(meshes, slices, settings, compiler);
 }
Esempio n. 3
0
 public SingleMaterialFFFPrintGenPro(PrintMeshAssembly meshes,
                                     PlanarSliceStack slices,
                                     SingleMaterialFFFSettings settings,
                                     AssemblerFactoryF overrideAssemblerF = null)
     : base(meshes, slices, settings, overrideAssemblerF)
 {
 }
Esempio n. 4
0
        protected virtual void CopyFieldsTo(SingleMaterialFFFSettings to)
        {
            base.CopyFieldsTo(to);
            to.machineInfo = this.machineInfo.CloneAs <FFFMachineInfo>();

            to.ExtruderTempC            = this.ExtruderTempC;
            to.HeatedBedTempC           = this.HeatedBedTempC;
            to.SolidFillNozzleDiamStepX = this.SolidFillNozzleDiamStepX;
            to.SolidFillBorderOverlapX  = this.SolidFillBorderOverlapX;
            to.RetractDistanceMM        = this.RetractDistanceMM;
            to.MinRetractTravelLength   = this.MinRetractTravelLength;

            to.RetractSpeed         = this.RetractSpeed;
            to.ZTravelSpeed         = this.ZTravelSpeed;
            to.RapidTravelSpeed     = this.RapidTravelSpeed;
            to.CarefulExtrudeSpeed  = this.CarefulExtrudeSpeed;
            to.RapidExtrudeSpeed    = this.RapidExtrudeSpeed;
            to.OuterPerimeterSpeedX = this.OuterPerimeterSpeedX;

            to.Shells = this.Shells;
            to.InteriorSolidRegionShells = this.InteriorSolidRegionShells;
            to.RoofLayers               = this.RoofLayers;
            to.FloorLayers              = this.FloorLayers;
            to.SparseLinearInfillStepX  = this.SparseLinearInfillStepX;
            to.SparseFillBorderOverlapX = this.SparseFillBorderOverlapX;
            to.EnableSupport            = this.EnableSupport;
            to.SupportSpacingStepX      = this.SupportSpacingStepX;
            to.SupportVolumeScale       = this.SupportVolumeScale;
            to.ClipSelfOverlaps         = this.ClipSelfOverlaps;
            to.SelfOverlapToleranceX    = this.SelfOverlapToleranceX;
            to.LayerRangeFilter         = this.LayerRangeFilter;
        }
 public SingleMaterialFFFCompiler(GCodeBuilder builder, SingleMaterialFFFSettings settings, AssemblerFactoryF AssemblerF)
 {
     Builder            = builder;
     Settings           = settings;
     this.AssemblerF    = AssemblerF;
     featureTypeLabeler = CreateFeatureTypeLabeler();
 }
Esempio n. 6
0
        public override T CloneAs <T>()
        {
            SingleMaterialFFFSettings copy = new SingleMaterialFFFSettings();

            this.CopyFieldsTo(copy);
            return(copy as T);
        }
Esempio n. 7
0
        protected virtual void AddPrimeLine(SingleMaterialFFFSettings Settings)
        {
            Builder.AddCommentLine(" ");
            Builder.AddCommentLine("feature nozzle priming");
            Builder.AddCommentLine("---begin prime type=line");

            // extruder prime by drawing line across front of bed
            double PrimeHeight = Settings.Machine.MaxLayerHeightMM;
            double PrimeWidth  = 2 * Settings.Machine.NozzleDiamMM;

            // assumes origin is at center of bed...
            Vector3d frontRight = new Vector3d(Settings.Machine.BedSizeXMM / 2, -Settings.Machine.BedSizeYMM / 2, PrimeHeight);

            frontRight.x -= 10;
            frontRight.y += 5;
            Vector3d frontLeft = frontRight; frontLeft.x = -frontRight.x;

            double primeLen = frontRight.Distance(frontLeft);

            double PrimeFeedRate  = 1800;
            double prime_feed_len = AssemblerUtil.CalculateExtrudedFilament(
                PrimeWidth, PrimeHeight, primeLen, Settings.Machine.FilamentDiamMM);

            Builder.BeginGLine(92, "reset extruded length").AppendI("E", 0);
            BeginTravel();
            AppendMoveTo(frontRight, 9000, "start prime");
            EndTravel();
            AppendExtrudeTo(frontLeft, PrimeFeedRate, prime_feed_len, "extrude prime");

            AppendResetExtrudedLength();

            Builder.AddCommentLine("---end prime");
        }
Esempio n. 8
0
        /// <summary>
        /// Read all .txt files in Path and try to parse each one as a Settings object
        /// </summary>
        public bool RestoreFromFolder(string sPath, out List <PlanarAdditiveSettings> SettingsList, out List <string> SourceFilePaths)
        {
            SettingsList    = new List <PlanarAdditiveSettings>();
            SourceFilePaths = new List <string>();

            string[] files = Directory.GetFiles(sPath);
            foreach (string filePath in files)
            {
                if (!filePath.EndsWith(".txt"))
                {
                    continue;
                }

                var save_culture = Thread.CurrentThread.CurrentCulture;
                Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
                string data = File.ReadAllText(filePath);
                Thread.CurrentThread.CurrentCulture = save_culture;

                SingleMaterialFFFSettings settings = JsonToSettings(data);

                if (settings == null)
                {
                    DebugUtil.Log("SettingsSerializer.RestoreFromFolder: error reading " + filePath);
                }
                else
                {
                    SettingsList.Add(settings);
                    SourceFilePaths.Add(filePath);
                }
            }

            return(SettingsList.Count > 0);
        }
Esempio n. 9
0
        public RepRapAssembler(GCodeBuilder useBuilder, SingleMaterialFFFSettings settings) : base(useBuilder, settings.Machine)
        {
            Settings = settings;

            OmitDuplicateZ = true;
            OmitDuplicateF = true;
            OmitDuplicateE = true;
        }
Esempio n. 10
0
        public GenericMillingAssembler(GCodeBuilder useBuilder, SingleMaterialFFFSettings settings) : base(useBuilder, settings.Machine)
        {
            Settings = settings;

            OmitDuplicateZ = true;
            OmitDuplicateF = true;

            HomeSequenceF = StandardHomeSequence;
        }
Esempio n. 11
0
        protected virtual void CopyFieldsTo(SingleMaterialFFFSettings to)
        {
            base.CopyFieldsTo(to);
            to.machineInfo = this.machineInfo.CloneAs <FFFMachineInfo>();

            to.ExtruderTempC          = this.ExtruderTempC;
            to.HeatedBedTempC         = this.HeatedBedTempC;
            to.EnableRetraction       = this.EnableRetraction;
            to.RetractDistanceMM      = this.RetractDistanceMM;
            to.MinRetractTravelLength = this.MinRetractTravelLength;

            to.RetractSpeed         = this.RetractSpeed;
            to.ZTravelSpeed         = this.ZTravelSpeed;
            to.RapidTravelSpeed     = this.RapidTravelSpeed;
            to.CarefulExtrudeSpeed  = this.CarefulExtrudeSpeed;
            to.RapidExtrudeSpeed    = this.RapidExtrudeSpeed;
            to.MinExtrudeSpeed      = this.MinExtrudeSpeed;
            to.OuterPerimeterSpeedX = this.OuterPerimeterSpeedX;

            to.Shells = this.Shells;
            to.InteriorSolidRegionShells = this.InteriorSolidRegionShells;
            to.OuterShellLast            = this.OuterShellLast;
            to.RoofLayers  = this.RoofLayers;
            to.FloorLayers = this.FloorLayers;

            to.SolidFillNozzleDiamStepX = this.SolidFillNozzleDiamStepX;
            to.SolidFillBorderOverlapX  = this.SolidFillBorderOverlapX;

            to.SparseLinearInfillStepX  = this.SparseLinearInfillStepX;
            to.SparseFillBorderOverlapX = this.SparseFillBorderOverlapX;

            to.GenerateSupport         = this.GenerateSupport;
            to.SupportOverhangAngleDeg = this.SupportOverhangAngleDeg;
            to.SupportSpacingStepX     = this.SupportSpacingStepX;
            to.SupportVolumeScale      = this.SupportVolumeScale;
            to.EnableSupportShell      = this.EnableSupportShell;
            to.SupportAreaOffsetX      = this.SupportAreaOffsetX;
            to.SupportSolidSpace       = this.SupportSolidSpace;
            to.SupportRegionJoinTolX   = this.SupportRegionJoinTolX;
            to.SupportMinZTips         = this.SupportMinZTips;
            to.SupportPointDiam        = this.SupportPointDiam;
            to.SupportPointSides       = this.SupportPointSides;

            to.EnableBridging            = this.EnableBridging;
            to.MaxBridgeWidthMM          = this.MaxBridgeWidthMM;
            to.BridgeFillNozzleDiamStepX = this.BridgeFillNozzleDiamStepX;
            to.BridgeVolumeScale         = this.BridgeVolumeScale;
            to.BridgeExtrudeSpeedX       = this.BridgeExtrudeSpeedX;


            to.MinLayerTime          = this.MinLayerTime;
            to.ClipSelfOverlaps      = this.ClipSelfOverlaps;
            to.SelfOverlapToleranceX = this.SelfOverlapToleranceX;

            to.LayerRangeFilter = this.LayerRangeFilter;
        }
Esempio n. 12
0
 public void Initialize(PrintMeshAssembly meshes,
                        PlanarSliceStack slices,
                        SingleMaterialFFFSettings settings,
                        ThreeAxisLaserCompiler compiler)
 {
     PrintMeshes = meshes;
     Slices      = slices;
     Settings    = settings;
     Compiler    = compiler;
 }
        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);
        }
Esempio n. 14
0
        public CalculateExtrusion(IEnumerable <LinearToolpath3 <T> > paths, SingleMaterialFFFSettings settings)
        {
            Paths    = paths;
            Settings = settings;

            EnableRetraction       = settings.EnableRetraction;
            FilamentDiam           = settings.Machine.FilamentDiamMM;
            NozzleDiam             = settings.Machine.NozzleDiamMM;
            LayerHeight            = settings.LayerHeightMM;
            FixedRetractDistance   = settings.RetractDistanceMM;
            MinRetractTravelLength = settings.MinRetractTravelLength;
        }
Esempio n. 15
0
        /// <summary>
        /// Parse the json in data string into the right type of Settings object
        /// </summary>
        public SingleMaterialFFFSettings JsonToSettings(string data)
        {
            if (!is_settings_json(data))
            {
                return(null);
            }

            // [RMS] because we split gsGCode into a separate dll, Type.GetType() will not find it.
            // We have to use a handle to the relevant assembly.
            if (GSGCODE_ASM == null)
            {
                GSGCODE_ASM = Assembly.Load("gsGCode");
            }

            int typeIdx = data.IndexOf("\"ClassTypeName\"");
            SingleMaterialFFFSettings settings = null;

            if (typeIdx > 0)
            {
                try
                {
                    int commaIdx = typeIdx + 1;
                    while (data[commaIdx] != ',')
                    {
                        commaIdx++;
                    }
                    int    startIdx  = typeIdx + 18;
                    string className = data.Substring(startIdx, commaIdx - startIdx - 1);
                    //var type = Type.GetType(className);
                    var    type = GSGCODE_ASM.GetType(className);
                    object o    = JsonConvert.DeserializeObject(data, type);
                    settings = o as SingleMaterialFFFSettings;
                }
                catch
                {
                    // ignore disasters
                }
            }

            // either no typename, or we failed to construct it
            if (settings == null)
            {
                try
                {
                    settings = JsonConvert.DeserializeObject <SingleMaterialFFFSettings>(data);
                }
                catch
                {
                }
            }

            return(settings);
        }
Esempio n. 16
0
        public RepRapAssembler(GCodeBuilder useBuilder, SingleMaterialFFFSettings settings) : base(useBuilder, settings.Machine)
        {
            Settings = settings;

            OmitDuplicateZ = true;
            OmitDuplicateF = true;
            OmitDuplicateE = true;

            HomeSequenceF = StandardHomeSequence;

            UseFirmwareRetraction = settings.UseFirmwareRetraction;
        }
        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);
        }
Esempio n. 18
0
        public CalculateExtrusion(ToolpathSet paths, SingleMaterialFFFSettings settings)
        {
            Paths    = paths;
            Settings = settings;

            EnableRetraction       = settings.EnableRetraction;
            FilamentDiam           = settings.Machine.FilamentDiamMM;
            NozzleDiam             = settings.Machine.NozzleDiamMM;
            LayerHeight            = settings.LayerHeightMM;
            FixedRetractDistance   = settings.RetractDistanceMM;
            MinRetractTravelLength = settings.MinRetractTravelLength;
            SupportExtrudeScale    = settings.SupportVolumeScale;
        }
Esempio n. 19
0
        public MakerbotAssembler(GCodeBuilder useBuilder, SingleMaterialFFFSettings settings) : base(useBuilder, settings.Machine)
        {
            Settings = settings as SingleMaterialFFFSettings;

            PositionBounds = new AxisAlignedBox2d(settings.Machine.BedSizeXMM, settings.Machine.BedSizeYMM);
            PositionBounds.Translate(-PositionBounds.Center);

            // [RMS] currently bed dimensions are hardcoded in header setup, and this trips bounds-checker.
            // So, disable this checking for now.
            EnableBoundsChecking = false;

            TravelGCode = 1;
        }
 protected virtual void AddStandardHeader(SingleMaterialFFFSettings Settings)
 {
     Builder.AddCommentLine(" Generated on " + DateTime.Now.ToLongDateString() + " by Gradientspace gsSlicer");
     Builder.AddCommentLine(string.Format(" Printer: {0} {1}", Settings.Machine.ManufacturerName, Settings.Machine.ModelIdentifier));
     Builder.AddCommentLine(" Print Settings");
     Builder.AddCommentLine(" Layer Height: " + Settings.LayerHeightMM);
     Builder.AddCommentLine(" Nozzle Diameter: " + Settings.Machine.NozzleDiamMM + "  Filament Diameter: " + Settings.Machine.FilamentDiamMM);
     Builder.AddCommentLine(" Extruder Temp: " + Settings.ExtruderTempC);
     Builder.AddCommentLine(string.Format(" Speeds Extrude: {0}  Travel: {1} Z: {2}", Settings.RapidExtrudeSpeed, Settings.RapidTravelSpeed, Settings.ZTravelSpeed));
     Builder.AddCommentLine(string.Format(" Retract Distance: {0}  Speed: {1}", Settings.RetractDistanceMM, Settings.RetractSpeed));
     Builder.AddCommentLine(string.Format(" Shells: {0}  InteriorShells: {1}", Settings.Shells, Settings.InteriorSolidRegionShells));
     Builder.AddCommentLine(string.Format(" InfillX: {0}", Settings.SparseLinearInfillStepX));
     Builder.AddCommentLine(string.Format(" LayerRange: {0}-{1}", Settings.LayerRangeFilter.a, Settings.LayerRangeFilter.b));
 }
Esempio n. 21
0
        public MakerbotAssembler(GCodeBuilder useBuilder, SingleMaterialFFFSettings settings) : base(useBuilder, settings.Machine)
        {
            if (settings is MakerbotSettings == false)
            {
                throw new Exception("MakerbotAssembler: incorrect settings type!");
            }

            Settings = settings as MakerbotSettings;

            PositionBounds = new AxisAlignedBox2d(settings.Machine.BedSizeXMM, settings.Machine.BedSizeYMM);
            PositionBounds.Translate(-PositionBounds.Center);

            TravelGCode = 1;
        }
 protected virtual void AddStandardHeader(SingleMaterialFFFSettings Settings)
 {
     Builder.AddCommentLine("; Generated on " + DateTime.Now.ToLongDateString());
     Builder.AddCommentLine("; Print Settings");
     Builder.AddCommentLine("; Layer Height: " + Settings.LayerHeightMM);
     Builder.AddCommentLine("; Nozzle Diameter: " + Settings.Machine.NozzleDiamMM + "  Filament Diameter: " + Settings.Machine.FilamentDiamMM);
     Builder.AddCommentLine("; Extruder Temp: " + Settings.ExtruderTempC);
     Builder.AddCommentLine(string.Format("; Speeds Extrude: {0}  Travel: {1} Z: {2}", Settings.RapidExtrudeSpeed, Settings.RapidTravelSpeed, Settings.ZTravelSpeed));
     Builder.AddCommentLine(string.Format("; Retract Distance: {0}  Speed: {1}", Settings.RetractDistanceMM, Settings.RetractSpeed));
     Builder.AddCommentLine(string.Format("; Shells: {0}  InteriorShells: {1}", Settings.Shells, Settings.InteriorSolidRegionShells));
     Builder.AddCommentLine(string.Format("; RoofLayers: {0}  FloorLayers: {1}", Settings.RoofLayers, Settings.FloorLayers));
     Builder.AddCommentLine(string.Format("; InfillX: {0}", Settings.SparseLinearInfillStepX));
     Builder.AddCommentLine(string.Format("; Support: {0}  SpacingX: {1}", Settings.EnableSupport, Settings.SupportSpacingStepX));
     Builder.AddCommentLine(string.Format("; ClipOverlaps: {0}  Tolerance: {1}", Settings.ClipSelfOverlaps, Settings.SelfOverlapToleranceX));
     Builder.AddCommentLine(string.Format("; LayerRange: {0}-{1}", Settings.LayerRangeFilter.a, Settings.LayerRangeFilter.b));
 }
Esempio n. 23
0
        public virtual void HandleDepositionPath(LinearToolpath path, SingleMaterialFFFSettings useSettings)
        {
            // end travel / retract if we are in that state
            if (Assembler.InTravel)
            {
                if (Assembler.InRetract)
                {
                    Assembler.EndRetract(path[0].Position, useSettings.RetractSpeed, path[0].Extrusion.x);
                }
                Assembler.EndTravel();
                Assembler.EnableFan();
            }

            AddFeatureTypeLabel(path.FillType);
            AppendDimensions(path.Start.Dimensions);
        }
Esempio n. 24
0
        public virtual List <string> GenerateTotalExtrusionReport(SingleMaterialFFFSettings settings)
        {
            double volume = TotalExtrusion * Math.PI * Math.Pow(settings.Machine.FilamentDiamMM / 2d, 2);
            double mass   = volume * settings.FilamentGramsPerCubicMM;
            double cost   = mass * settings.FilamentCostPerKG / 1000d;

            List <string> result = new List <string>
            {
                "TOTAL EXTRUSION ESTIMATE:",
                "    Length: " + TotalExtrusion.ToString("N2") + " mm",
                "    Volume: " + volume.ToString("N2") + " mm^3",
                "      Mass: " + mass.ToString("N2") + " g",
                "      Cost: $" + cost.ToString("N2")
            };

            return(result);
        }
Esempio n. 25
0
 protected virtual void AddStandardHeader(SingleMaterialFFFSettings Settings)
 {
     Builder.AddCommentLine("; Generated on " + DateTime.Now.ToLongDateString() + " by Gradientspace gsSlicer");
     Builder.AddCommentLine(string.Format("; Printer: {0} {1}", Settings.Machine.ManufacturerName, Settings.Machine.ModelIdentifier));
     Builder.AddCommentLine("; Print Settings");
     Builder.AddCommentLine("; Layer Height: " + Settings.LayerHeightMM);
     Builder.AddCommentLine("; Nozzle Diameter: " + Settings.Machine.NozzleDiamMM + "  Filament Diameter: " + Settings.Machine.FilamentDiamMM);
     Builder.AddCommentLine("; Extruder Temp: " + Settings.ExtruderTempC);
     Builder.AddCommentLine(string.Format("; Speeds Extrude: {0}  Travel: {1} Z: {2}", Settings.RapidExtrudeSpeed, Settings.RapidTravelSpeed, Settings.ZTravelSpeed));
     Builder.AddCommentLine(string.Format("; Retract Distance: {0}  Speed: {1}", Settings.RetractDistanceMM, Settings.RetractSpeed));
     Builder.AddCommentLine(string.Format("; Shells: {0}  InteriorShells: {1}", Settings.Shells, Settings.InteriorSolidRegionShells));
     Builder.AddCommentLine(string.Format("; RoofLayers: {0}  FloorLayers: {1}", Settings.RoofLayers, Settings.FloorLayers));
     Builder.AddCommentLine(string.Format("; InfillX: {0}", Settings.SparseLinearInfillStepX));
     Builder.AddCommentLine(string.Format("; Support: {0}  Angle {1} SpacingX: {2}  Shell: {3}  Gap: {4}  VolScale: {5}",
                                          Settings.GenerateSupport, Settings.SupportOverhangAngleDeg, Settings.SupportSpacingStepX, Settings.EnableSupportShell, Settings.SupportSolidSpace, Settings.SupportVolumeScale));
     Builder.AddCommentLine(string.Format("; ClipOverlaps: {0}  Tolerance: {1}", Settings.ClipSelfOverlaps, Settings.SelfOverlapToleranceX));
     Builder.AddCommentLine(string.Format("; LayerRange: {0}-{1}", Settings.LayerRangeFilter.a, Settings.LayerRangeFilter.b));
 }
Esempio n. 26
0
        public void RefreshSettingsFromDisk(MachineDatabase db, MachinePreset preset)
        {
            if (File.Exists(preset.SourcePath) == false)
            {
                throw new Exception("SettingsSerializer.RefreshSettingsFromDisk: path " + preset.SourcePath + " does not exist!");
            }

            var save_culture = Thread.CurrentThread.CurrentCulture;

            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            string data = File.ReadAllText(preset.SourcePath);

            Thread.CurrentThread.CurrentCulture = save_culture;

            SingleMaterialFFFSettings settings = JsonToSettings(data);

            if (settings == null)
            {
                throw new Exception("SettingsSerializer.RefreshSettingsFromDisk: json data could not be parsed!");
            }

            preset.Settings = settings;
        }
Esempio n. 27
0
 public static BaseDepositionAssembler Factory(GCodeBuilder builder, SingleMaterialFFFSettings settings)
 {
     return(new RepRapAssembler(builder, settings));
 }
Esempio n. 28
0
 public SequentialScheduler2d(ToolpathSetBuilder builder, SingleMaterialFFFSettings settings)
 {
     Builder  = builder;
     Settings = settings;
 }
Esempio n. 29
0
 public static BaseMillingAssembler Factory(GCodeBuilder builder, SingleMaterialFFFSettings settings)
 {
     return(new GenericMillingAssembler(builder, settings));
 }
        /// <summary>
        /// Compile this set of toolpaths and pass to assembler.
        /// Settings are optional, pass null to ignore
        /// </summary>
        public virtual void AppendPaths(ToolpathSet paths, SingleMaterialFFFSettings pathSettings)
        {
            Assembler.FlushQueues();

            SingleMaterialFFFSettings useSettings = (pathSettings == null) ? Settings : pathSettings;

            CalculateExtrusion calc = new CalculateExtrusion(paths, useSettings);

            calc.Calculate(Assembler.NozzlePosition, Assembler.ExtruderA, Assembler.InRetract);


            int path_index = 0;

            foreach (var gpath in paths)
            {
                path_index++;

                if (IsCommandToolpath(gpath))
                {
                    ProcessCommandToolpath(gpath);
                    continue;
                }

                LinearToolpath p = gpath as LinearToolpath;

                if (p[0].Position.Distance(Assembler.NozzlePosition) > 0.00001)
                {
                    throw new Exception("SingleMaterialFFFCompiler.AppendPaths: path " + path_index + ": Start of path is not same as end of previous path!");
                }

                int i = 0;
                if ((p.Type == ToolpathTypes.Travel || p.Type == ToolpathTypes.PlaneChange) && Assembler.InTravel == false)
                {
                    //Assembler.DisableFan();

                    // do retract cycle
                    if (p[0].Extrusion.x < Assembler.ExtruderA)
                    {
                        if (Assembler.InRetract)
                        {
                            throw new Exception("SingleMaterialFFFCompiler.AppendPaths: path " + path_index + ": already in retract!");
                        }
                        Assembler.BeginRetract(p[0].Position, useSettings.RetractSpeed, p[0].Extrusion.x);
                    }
                    Assembler.BeginTravel();
                }
                else if (p.Type == ToolpathTypes.Deposition)
                {
                    // end travel / retract if we are in that state
                    if (Assembler.InTravel)
                    {
                        if (Assembler.InRetract)
                        {
                            Assembler.EndRetract(p[0].Position, useSettings.RetractSpeed, p[0].Extrusion.x);
                        }
                        Assembler.EndTravel();
                        //Assembler.EnableFan();
                    }
                }

                i = 1;                      // do not need to emit code for first point of path,
                // we are already at this pos

                for (; i < p.VertexCount; ++i)
                {
                    if (p.Type == ToolpathTypes.Travel)
                    {
                        Assembler.AppendMoveTo(p[i].Position, p[i].FeedRate, "Travel");
                    }
                    else if (p.Type == ToolpathTypes.PlaneChange)
                    {
                        Assembler.AppendMoveTo(p[i].Position, p[i].FeedRate, "Plane Change");
                    }
                    else
                    {
                        Assembler.AppendExtrudeTo(p[i].Position, p[i].FeedRate, p[i].Extrusion.x);
                    }
                }
            }


            Assembler.FlushQueues();
        }