protected virtual void AddPrimeLine(IPrintProfileFFF 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.Material.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"); }
public static BaseDepositionAssembler Factory( GCodeBuilder builder, IPrintProfileFFF settings) { var asm = new RepRapAssembler(builder, settings); asm.HeaderCustomizerF = (state, builder) => HeaderCustomF(settings as IPrintProfileFFF, state, builder); return(asm); }
public GenericMillingAssembler(GCodeBuilder useBuilder, IPrintProfileFFF settings) : base(useBuilder, settings.Machine) { Settings = settings; OmitDuplicateZ = true; OmitDuplicateF = true; HomeSequenceF = StandardHomeSequence; }
public static BaseDepositionAssembler Factory( GCodeBuilder builder, IPrintProfileFFF settings) { var asm = new RepRapAssembler(builder, settings); asm.HomeSequenceF = (builder) => HomeSequence(builder, settings); asm.HeaderCustomizerF = HeaderCustomF; asm.TravelGCode = 1; return(asm); }
private static void HeaderCustomF( IPrintProfileFFF settings, RepRapAssembler.HeaderState state, GCodeBuilder builder) { if (state == RepRapAssembler.HeaderState.BeforePrime) { if (settings.Machine.HasAutoBedLeveling && settings.Machine.EnableAutoBedLeveling) { builder.BeginGLine(29, "auto-level bed"); } } }
public CalculateExtrusion(IEnumerable <LinearToolpath3 <T> > paths, IPrintProfileFFF settings) { Paths = paths; Settings = settings; EnableRetraction = settings.Part.EnableRetraction; FilamentDiam = settings.Material.FilamentDiamMM; NozzleDiam = settings.Machine.NozzleDiamMM; LayerHeight = settings.Part.LayerHeightMM; FixedRetractDistance = settings.Part.RetractDistanceMM; MinRetractTravelLength = settings.Part.MinRetractTravelLength; }
public RepRapAssembler(GCodeBuilder useBuilder, IPrintProfileFFF settings) : base(useBuilder, settings.Machine) { Settings = settings; OmitDuplicateZ = true; OmitDuplicateF = true; OmitDuplicateE = true; HomeSequenceF = StandardHomeSequence; UseFirmwareRetraction = settings.Part.UseFirmwareRetraction; }
public MakerbotAssembler(GCodeBuilder useBuilder, IPrintProfileFFF settings) : base(useBuilder, settings.Machine) { Settings = settings; 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; }
private static void HomeSequence(GCodeBuilder builder, IPrintProfileFFF profile) { if (profile.Machine.HasAutoBedLeveling && profile.Machine.EnableAutoBedLeveling) { builder.BeginGLine(28).AppendL("W").AppendComment("home all without bed level"); builder.BeginGLine(80, "auto-level bed"); } else { // standard home sequenece builder.BeginGLine(28, "home x/y").AppendI("X", 0).AppendI("Y", 0); builder.BeginGLine(28, "home z").AppendI("Z", 0); } }
protected virtual void AddStandardHeader(IPrintProfileFFF 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.Part.LayerHeightMM); Builder.AddCommentLine(" Nozzle Diameter: " + Settings.Machine.NozzleDiamMM + " Filament Diameter: " + Settings.Material.FilamentDiamMM); Builder.AddCommentLine(" Extruder Temp: " + Settings.Material.ExtruderTempC); Builder.AddCommentLine(string.Format(" Speeds Extrude: {0} Travel: {1} Z: {2}", Settings.Part.RapidExtrudeSpeed, Settings.Part.RapidTravelSpeed, Settings.Part.ZTravelSpeed)); Builder.AddCommentLine(string.Format(" Retract Distance: {0} Speed: {1}", Settings.Part.RetractDistanceMM, Settings.Part.RetractSpeed)); Builder.AddCommentLine(string.Format(" Shells: {0} InteriorShells: {1}", Settings.Part.Shells, Settings.Part.InteriorSolidRegionShells)); Builder.AddCommentLine(string.Format(" InfillX: {0}", Settings.Part.SparseLinearInfillStepX)); Builder.AddCommentLine(string.Format(" LayerRange: {0}-{1}", Settings.Part.LayerRangeFilter.a, Settings.Part.LayerRangeFilter.b)); }
public virtual void HandleDepositionPath(LinearToolpath path, IPrintProfileFFF useSettings) { // end travel / retract if we are in that state if (Assembler.InTravel) { if (Assembler.InRetract) { Assembler.EndRetract(path[0].Position, useSettings.Part.RetractSpeed, path[0].Extrusion.x); } Assembler.EndTravel(); Assembler.EnableFan(); } AddFeatureTypeLabel(path.FillType); AppendDimensions(path.Start.Dimensions); }
public virtual IEnumerable <string> GenerateTotalExtrusionReport(IPrintProfileFFF settings) { double volume = TotalExtrusion * Math.PI * Math.Pow(settings.Material.FilamentDiamMM / 2d, 2); double mass = volume * settings.Material.GramsPerCubicMM; double cost = mass * settings.Material.CostPerKG / 1000d; List <string> result = new List <string> { " Length: " + TotalExtrusion.ToString("N2") + " mm", " Volume: " + volume.ToString("N2") + " mm^3", " Mass: " + mass.ToString("N2") + " g", " Cost: $" + cost.ToString("N2") }; return(result); }
protected virtual void AddStandardHeader(IPrintProfileFFF 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.Part.LayerHeightMM); Builder.AddCommentLine("; Nozzle Diameter: " + Settings.Machine.NozzleDiamMM + " Filament Diameter: " + Settings.Material.FilamentDiamMM); Builder.AddCommentLine("; Extruder Temp: " + Settings.Material.ExtruderTempC); Builder.AddCommentLine(string.Format("; Speeds Extrude: {0} Travel: {1} Z: {2}", Settings.Part.RapidExtrudeSpeed, Settings.Part.RapidTravelSpeed, Settings.Part.ZTravelSpeed)); if (Settings.Part.EnableRetraction) { Builder.AddCommentLine(string.Format("; Retract Distance: {0} Speed: {1}", Settings.Part.RetractDistanceMM, Settings.Part.RetractSpeed)); } Builder.AddCommentLine(string.Format("; Shells: {0} InteriorShells: {1}", Settings.Part.Shells, Settings.Part.InteriorSolidRegionShells)); Builder.AddCommentLine(string.Format("; RoofLayers: {0} FloorLayers: {1}", Settings.Part.RoofLayers, Settings.Part.FloorLayers)); Builder.AddCommentLine(string.Format("; InfillX: {0}", Settings.Part.SparseLinearInfillStepX)); Builder.AddCommentLine(string.Format("; Support: {0} Angle {1} SpacingX: {2} Shell: {3} Gap: {4} VolScale: {5}", Settings.Part.GenerateSupport, Settings.Part.SupportOverhangAngleDeg, Settings.Part.SupportSpacingStepX, Settings.Part.EnableSupportShell, Settings.Part.SupportSolidSpace, Settings.Part.SupportVolumeScale)); Builder.AddCommentLine(string.Format("; ClipOverlaps: {0} Tolerance: {1}", Settings.Part.ClipSelfOverlaps, Settings.Part.SelfOverlapToleranceX)); Builder.AddCommentLine(string.Format("; LayerRange: {0}-{1}", Settings.Part.LayerRangeFilter.a, Settings.Part.LayerRangeFilter.b)); Builder.AddCommentLine("; the following configures extrusion width and height display for Simplify3D's gcode viewer"); Builder.AddCommentLine(string.Format("; tool H{0} W{1}", Settings.Part.LayerHeightMM, Settings.Machine.NozzleDiamMM)); }
public BaseThreeAxisMillingCompiler(GCodeBuilder builder, IPrintProfileFFF settings, MillingAssemblerFactoryF AssemblerF) { Builder = builder; Settings = settings; this.AssemblerF = AssemblerF; }
public static BaseMillingAssembler Factory(GCodeBuilder builder, IPrintProfileFFF settings) { return(new GenericMillingAssembler(builder, settings)); }
public static BaseDepositionAssembler Factory(GCodeBuilder builder, IPrintProfileFFF settings) { return(new RepRapAssembler(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, IPrintProfileFFF pathSettings) { var useSettings = (pathSettings == null) ? Settings : pathSettings; int path_index = 0; foreach (var gpath in paths) { path_index++; if (IsCommandToolpath(gpath)) { ProcessCommandToolpath(gpath); continue; } LinearToolpath p = gpath as LinearToolpath; // [RMS] this doesn't work because we are doing retract inside assembler... //if (p[0].Position.Distance(Assembler.ToolPosition) > 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) { // do retract cycle if (Assembler.InRetract == false) { Assembler.BeginRetract(useSettings.Part.RetractDistanceMM, useSettings.Part.RetractSpeed, "Retract"); } if (Assembler.InTravel == false) { Assembler.BeginTravel(); } } else if (p.Type == ToolpathTypes.Cut) { if (Assembler.InTravel) { Assembler.EndTravel(); } if (Assembler.InRetract) { Assembler.EndRetract(useSettings.Part.RetractSpeed, "End Retract"); } } 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.AppendCutTo(p[i].Position, p[i].FeedRate); } } } }
public IEnumerable <string> GenerateTotalExtrusionReport(IPrintProfileFFF settings) { return(Assembler.GenerateTotalExtrusionReport(settings)); }
public SingleMaterialFFFCompiler(GCodeBuilder builder, IPrintProfileFFF settings, AssemblerFactoryF AssemblerF) { Builder = builder; Settings = settings; this.AssemblerF = AssemblerF; }
/// <summary> /// Compile this set of toolpaths and pass to assembler. /// Settings are optional, pass null to ignore /// </summary> public virtual void AppendPaths(ToolpathSet toolpathSet, IPrintProfileFFF profile) { Assembler.FlushQueues(); IPrintProfileFFF useSettings = (profile == null) ? Settings : profile; var paths = toolpathSet.GetPaths <PrintVertex>(); var calc = new CalculateExtrusion <PrintVertex>(paths, useSettings); calc.Calculate(Assembler.NozzlePosition, Assembler.ExtruderA, Assembler.InRetract); int path_index = 0; foreach (var gpath in toolpathSet) { 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) { HandleTravelAndPlaneChangePath(p, path_index, useSettings); } else if (p.Type == ToolpathTypes.Deposition) { HandleDepositionPath(p, useSettings); } i = 1; // do not need to emit code for first point of path, // we are already at this pos var currentDimensions = p[1].Dimensions; 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 { if (p.Type == ToolpathTypes.Deposition && !p[i].Dimensions.EpsilonEqual(currentDimensions, 1e-6)) { currentDimensions = p[i].Dimensions; AppendDimensions(p[i].Dimensions); } Assembler.AppendExtrudeTo(p[i].Position, p[i].FeedRate, p[i].Extrusion.x, null); } } } /* * TODO: Should there be an EndTravel() call here? */ HandleDepositionEnd(); Assembler.FlushQueues(); }
public virtual void HandleTravelAndPlaneChangePath(LinearToolpath path, int pathIndex, IPrintProfileFFF settings) { if (Assembler.InTravel == false) { Assembler.DisableFan(); // do retract cycle if (path[0].Extrusion.x < Assembler.ExtruderA) { if (Assembler.InRetract) { throw new Exception("SingleMaterialFFFCompiler.AppendPaths: path " + pathIndex + ": already in retract!"); } Assembler.BeginRetract(path[0].Position, settings.Part.RetractSpeed, path[0].Extrusion.x); } Assembler.BeginTravel(); } }
public static double BridgeFillPathSpacingMM(this IPrintProfileFFF profile) { return(profile.Machine.NozzleDiamMM * profile.Part.BridgeFillNozzleDiamStepX); }
public FillTypeFactory(IPrintProfileFFF settings) { this.settings = settings; }
public SequentialScheduler2d(ToolpathSetBuilder builder, IPrintProfileFFF settings, double layerZ) { Builder = builder; Settings = settings; LayerZ = layerZ; }
public SupportLinesFillPolygon(GeneralPolygon2d poly, IPrintProfileFFF settings) : base(poly, settings.FillTypeFactory.Support()) { SimplifyAmount = SimplificationLevel.Aggressive; }
public BridgeLinesFillPolygon(GeneralPolygon2d poly, IPrintProfileFFF settings) : base(poly, settings.FillTypeFactory.Bridge()) { SimplifyAmount = SimplificationLevel.Minor; }