/* GCode Process for building 3d DVP UV objects * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> Example: * G1 Z0.05 F10 (move to the layer position .05 mm distance) * (<Layer 0 >) (show the slice image layer) * (<Delay 1000 >) (pause to expose the layer, first layer time is longer) * (<Layer Blank >) (show the blank image layer now) * (pre- lift gcode goes here) * G1 Z5 F10 (Move up (or down) for the lift sequence) * G1 X20 F20 (Move the wiper) * G1 X-20 F20 (Move the wiper back) * G1 Z5 F10 (Move down (or up) for the lift sequence) * (post - lift gcode goes here) * (<Delay blanktime >) (the previous commands will all be run, this command will cause the build manager to delay before moving to the next layer) */ /* This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); double zdist = 0.0; double feedrate = pi.ZMaxFeedrate; // 10mm/min double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } // append the build parameters as reference sb.Append(sf.m_config.ToString()); // append the header sb.Append(sf.m_config.HeaderCode); String firstlayerdelay = "(<Delay> " + sf.m_config.firstlayertime_ms + " )\r\n"; String layerdelay = "(<Delay> " + sf.m_config.layertime_ms + " )\r\n"; String blankdelay = "(<Delay> " + sf.m_config.blanktime_ms + " )\r\n"; String raisetime = "(<Delay> " + sf.m_config.raise_time_ms + " )\r\n"; zdist = sf.m_config.ZThick; for (int c = 0; c < sf.m_slices.Count; c++ ) { //move the z axis to the right layer position // sb.Append("G1 Z" + String.Format("{0:0.00000}", (zdist * zdir)) + " F" + feedrate + "\r\n"); // this is the marker the BuildManager uses to display the correct slice sb.Append( "(<Slice> " + c + " )\r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append("(<Slice> Blank )\r\n"); // show the blank layer sb.Append(sf.m_config.PreLiftCode); // append the pre-lift codes //do the lift sb.Append("G1 Z" + String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir)) + " F" + feedrate + " (Lift) \r\n"); sb.Append(sf.m_config.PostLiftCode); // append the post-lift codes // move back from the lift sb.Append("G1 Z" + String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir * -1)) + " F" + feedrate + " (End Lift) \r\n"); // add a delay for the lift sequence and the pre/post lift codes to execute sb.Append(blankdelay); // this move is moved to the end, so the first layer doesn't try to move up sb.Append("G1 Z" + String.Format("{0:0.00000}", (zdist * zdir)) + " F" + feedrate + "\r\n"); sb.Append(raisetime); } //append the footer sb.Append(sf.m_config.FooterCode); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return gc; }
public void UpdateFrom(MachineConfig mf) { dpmmX = mf.PixPerMMX; //10 dots per mm dpmmY = mf.PixPerMMY; // 10; xres = mf.XRes; yres = mf.YRes; }
private UVDLPApp() { m_supportmode = eSupportEditMode.eNone; SceneFileName = ""; m_callbackhandler = new CallbackHandler(); m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.m_slicemethod = Slicer.eSliceMethod.eNormalCount;// configure the slicer to user the new normal count - Thanks Shai!!! m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); //m_dispmgr = DisplayManager.Instance(); // initialize the singleton for early event app binding //m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent += new SupportGeneratorEvent(SupEvent); CSG.Instance().CSGEvent += new CSG.CSGEventDel(CSGEvent); m_proj_cmd_lst = new prjcmdlst(); m_plugins = new List <PluginEntry>(); // list of user plug-ins m_pluginstates = PluginStates.Instance(); // initialize the plugin state singleton m_undoer = new Undoer(); m_2d_graphics = new C2DGraphics(); m_gui_config = new GuiConfigManager(); m_AuxBuildCmds = AuxBuildCmds.Instance(); // make sure the singleton doesn't go away... m_sequencemanager = SequenceManager.Instance(); }
private void CheckAndCreateDefaultMachines() { //Check to see if the null machine exists if (!File.Exists(UVDLPApp.Instance().m_PathMachines + UVDLPApp.m_pathsep + "NullMachine.machine")) { DebugLogger.Instance().LogWarning("Null Machine not found, creating..."); // if it doesn't, create it MachineConfig mc = new MachineConfig(); mc.CreateNullMachine(); if (!mc.Save(UVDLPApp.Instance().m_PathMachines + UVDLPApp.m_pathsep + "NullMachine.machine")) { DebugLogger.Instance().LogError("Could not save Null Machine"); } } //Check to see if the default SLA machine exists if (!File.Exists(UVDLPApp.Instance().m_PathMachines + UVDLPApp.m_pathsep + "Default_SLA.machine")) { DebugLogger.Instance().LogWarning("Default_SLA Machine not found, creating..."); // if it doesn't, create it MachineConfig mc = new MachineConfig(); if (!mc.Save(UVDLPApp.Instance().m_PathMachines + UVDLPApp.m_pathsep + "Default_SLA.machine")) { DebugLogger.Instance().LogError("Could not save Default_SLA Machine"); } } }
/* * This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); PreProcessor pp = PreparePreprocessor(sf, pi); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } pp.SetVar("$ZDir", zdir); // append the build parameters as reference sb.Append(sf.m_config.ToString()); sb.Append(";Number of Slices = " + sf.NumSlices.ToString() + "\r\n"); sb.Append(pi.ToString());//add the machine build parameters string // append the header sb.Append(pp.Process(sf.m_config.HeaderCode)); zdist = sf.m_config.ZThick; String firstlayerdelay = ";<Delay> " + sf.m_config.firstlayertime_ms + " \r\n"; String layerdelay = ";<Delay> " + sf.m_config.layertime_ms + " \r\n"; String blankdelay = ";<Delay> " + sf.m_config.blanktime_ms + " \r\n"; String preSliceGCode = pp.Process(sf.m_config.PreSliceCode); String LiftGCode = pp.Process(sf.m_config.LiftCode); for (int c = 0; c < sf.NumSlices; c++) { sb.Append(preSliceGCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append(";<Slice> Blank \r\n"); // show the blank layer sb.Append(LiftGCode); // append the pre-lift codes } //append the footer sb.Append(pp.Process(sf.m_config.FooterCode)); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return(gc); }
/* This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); PreProcessor pp = PreparePreprocessor(sf, pi); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } pp.SetVar("$ZDir", zdir); // append the build parameters as reference sb.Append(sf.m_config.ToString()); sb.Append(";Number of Slices = " + sf.NumSlices.ToString() + "\r\n"); sb.Append(pi.ToString());//add the machine build parameters string // append the header sb.Append(pp.Process(sf.m_config.HeaderCode)); zdist = sf.m_config.ZThick; String firstlayerdelay = ";<Delay> " + sf.m_config.firstlayertime_ms + " \r\n"; String layerdelay = ";<Delay> " + sf.m_config.layertime_ms + " \r\n"; String blankdelay = ";<Delay> " + sf.m_config.blanktime_ms + " \r\n"; String preSliceGCode = pp.Process(sf.m_config.PreSliceCode); String LiftGCode = pp.Process(sf.m_config.LiftCode); for (int c = 0; c < sf.NumSlices; c++) { sb.Append(preSliceGCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append(";<Slice> Blank \r\n"); // show the blank layer sb.Append(LiftGCode); // append the pre-lift codes } //append the footer sb.Append(pp.Process(sf.m_config.FooterCode)); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return gc; }
/* * GCode Process for building 3d DVP UV objects * * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> * * * Example: * G1 Z0.05 F10 (move to the layer position .05 mm distance) * (<Layer 0 >) (show the slice image layer) * (<Delay 1000 >) (pause to expose the layer, first layer time is longer) * (<Layer Blank >) (show the blank image layer now) * (pre- lift gcode goes here) * G1 Z5 F10 (Move up (or down) for the lift sequence) * G1 X20 F20 (Move the wiper) * G1 X-20 F20 (Move the wiper back) * G1 Z5 F10 (Move down (or up) for the lift sequence) * (post - lift gcode goes here) * (<Delay blanktime >) (the previous commands will all be run, this command will cause the build manager to delay before moving to the next layer) * */ /* * This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); double zdist = 0.0; double feedrate = pi.m_ZMaxFeedrate; // 10mm/min double zdir = 1.0; // assume a bottom up machine if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } // append the build parameters as reference sb.Append(sf.m_config.ToString()); // append the header sb.Append(sf.m_config.HeaderCode); String firstlayerdelay = "(<Delay> " + sf.m_config.firstlayertime_ms + " )\r\n"; String layerdelay = "(<Delay> " + sf.m_config.layertime_ms + " )\r\n"; String blankdelay = "(<Delay> " + sf.m_config.blanktime_ms + " )\r\n"; zdist = sf.m_config.ZThick; for (int c = 0; c < sf.m_slices.Count; c++) { //move the z axis to the right layer position sb.Append("G1 Z" + String.Format("{0:0.00000}", (zdist * zdir)) + " F" + feedrate + "\r\n"); // this is the marker the BuildManager uses to display the correct slice sb.Append("(<Slice> " + c + " )\r\n"); // add a pause for the UV resin to be set using this image if (c == 0)// check for the first layer { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append("(<Slice> Blank )\r\n"); // show the blank layer sb.Append(sf.m_config.PreLiftCode); // append the pre-lift codes //do the lift sb.Append("G1 Z" + String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir)) + " F" + feedrate + " (Lift) \r\n"); sb.Append(sf.m_config.PostLiftCode); // append the post-lift codes // move back from the lift sb.Append("G1 Z" + String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir * -1)) + " F" + feedrate + " (End Lift) \r\n"); // add a delay for the lift sequence and the pre/post lift codes to execute sb.Append(blankdelay); } //append the footer sb.Append(sf.m_config.FooterCode); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return(gc); }
private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); m_gcode = null; }
public void UpdateFrom(MachineConfig mf) { //update the slice / build profile here with the // x/y resolution for the current display(s) xres = mf.XRenderSize; yres = mf.YRenderSize; //get the first monitor configuration MonitorConfig mc = mf.m_lstMonitorconfigs[0]; dpmmX = (xres) / mf.m_PlatXSize; dpmmY = (yres) / mf.m_PlatYSize; }
/* * GCode Process for building 3d DVP UV objects * * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> * * */ // here we prepare the gcode preprocessor and fill all nessesary variables protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi) { PreProcessor pp = new PreProcessor(); pp.SetVar("$LayerThickness", sf.m_config.ZThick); pp.SetVar("$ZLiftDist", sf.m_config.liftdistance); pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate); pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate); pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval); pp.SetVar("$BlankTime", sf.m_config.blanktime_ms); pp.SetVar("$LayerTime", sf.m_config.layertime_ms); pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms); return(pp); }
/* GCode Process for building 3d DVP UV objects * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> */ // here we prepare the gcode preprocessor and fill all nessesary variables protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi) { PreProcessor pp = new PreProcessor(); pp.SetVar("$LayerThickness", sf.m_config.ZThick); // the thickenss of the layer in mm pp.SetVar("$ZLiftDist", sf.m_config.liftdistance); // how far we're lifting pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate); // the rate at which we're lifting pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate); // how fast we'r retracting pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval); // any used slide / tilt value on the x axis pp.SetVar("$BlankTime", sf.m_config.blanktime_ms); // how long to show the blank in ms pp.SetVar("$LayerTime", sf.m_config.layertime_ms); // total delay for a layer for gcode commands to complete - not including expusre time pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms); // time to expose the first layers in ms pp.SetVar("$NumFirstLayers", sf.m_config.numfirstlayers); // number of first layers return pp; }
/* * GCode Process for building 3d DVP UV objects * * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> * * */ // here we prepare the gcode preprocessor and fill all nessesary variables protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi) { PreProcessor pp = new PreProcessor(); pp.SetVar("$LayerThickness", sf.m_config.ZThick); // the thickenss of the layer in mm pp.SetVar("$ZLiftDist", sf.m_config.liftdistance); // how far we're lifting pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate); // the rate at which we're lifting pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate); // how fast we'r retracting pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval); // any used slide / tilt value on the x axis pp.SetVar("$BlankTime", sf.m_config.blanktime_ms); // how long to show the blank in ms pp.SetVar("$LayerTime", sf.m_config.layertime_ms); // total delay for a layer for gcode commands to complete - not including expusre time pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms); // time to expose the first layers in ms pp.SetVar("$NumFirstLayers", sf.m_config.numfirstlayers); // number of first layers return(pp); }
private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent += new SupportGeneratorEvent(SupEvent); }
private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); //m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent += new SupportGeneratorEvent(SupEvent); m_proj_cmd_lst = new prjcmdlst(); m_plugins = new List <IPlugin>(); // list of user plug-ins m_undoer = new Undoer(); }
public void UpdateFrom(MachineConfig mf) { try { //update the slice / build profile here with the // x/y resolution for the current display(s) xres = mf.XRenderSize; yres = mf.YRenderSize; //get the first monitor configuration MonitorConfig mc = mf.m_lstMonitorconfigs[0]; dpmmX = (xres) / mf.m_PlatXSize; dpmmY = (yres) / mf.m_PlatYSize; } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } }
/* GCode Process for building 3d DVP UV objects * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> */ /* This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } // append the build parameters as reference sb.Append(sf.m_config.ToString()); sb.Append(";(Number of Slices = " + sf.NumSlices.ToString() + ")\r\n"); sb.Append(pi.ToString());//add the machine build parameters string // append the header sb.Append(sf.m_config.HeaderCode); zdist = sf.m_config.ZThick; String firstlayerdelay = ";(<Delay> " + sf.m_config.firstlayertime_ms + " )\r\n"; String layerdelay = ";(<Delay> " + sf.m_config.layertime_ms + " )\r\n"; String blankdelay = ";(<Delay> " + sf.m_config.blanktime_ms + " )\r\n"; String tmpZU = String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir)).Replace(',', '.'); String tmpZD = String.Format("{0:0.00000}", ((sf.m_config.liftdistance - zdist) * zdir * -1)).Replace(',', '.'); String tmpX1 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval)).Replace(',', '.'); String tmpX2 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval * -1)).Replace(',', '.'); for (int c = 0; c < sf.NumSlices; c++) { sb.Append(sf.m_config.PreSliceCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append(";(<Slice> " + c + " )\r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append(";(<Slice> Blank )\r\n"); // show the blank layer sb.Append(sf.m_config.PreLiftCode); // append the pre-lift codes // I put the following two lines out of the loop to reduce calculationTime //String tmpZU = String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir)).Replace(',', '.'); //String tmpZD = String.Format("{0:0.00000}", ((sf.m_config.liftdistance - zdist) * zdir * -1)).Replace(',', '.'); if (sf.m_config.usemainliftgcode == true) // if you want to use the GCode from the MainLiftGCode-Tab { sb.Append(sf.m_config.MainLiftCode); } else if (sf.m_config.slidetiltval == 0.0) // tilt/slide is not used here { sb.Append("G1 Z" + tmpZU + " F" + liftfeed + " ;(Lift) \r\n"); sb.Append("G1 Z" + tmpZD + " F" + retractfeed + " ;(End Lift) \r\n"); } else // tilt/slide has a value, so it is used { // I put the following two lines out of the loop to reduce calculationTime // format the X slide/tilt value //String tmpX1 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval)).Replace(',', '.'); //String tmpX2 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval * -1)).Replace(',', '.'); sb.Append("G1 X" + tmpX1 + " Z" + tmpZU + " F" + liftfeed + " ;(Lift) \r\n"); sb.Append("G1 X" + tmpX2 + " Z" + tmpZD + " F" + retractfeed + " ;(End Lift) \r\n"); } // add a delay for the lift sequence and the pre/post lift codes to execute sb.Append(blankdelay); // append the post-lift codes sb.Append(sf.m_config.PostLiftCode); } //append the footer sb.Append(sf.m_config.FooterCode); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return gc; }
/* * This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); PreProcessor pp = PreparePreprocessor(sf, pi); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double bottomliftfeed = sf.m_config.bottomliftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } pp.SetVar("$ZDir", zdir); // append the build parameters as reference sb.Append(sf.m_config.ToString()); sb.Append(";Number of Slices = " + sf.NumSlices.ToString() + "\r\n"); sb.Append(pi.ToString());//add the machine build parameters string // append the header sb.Append(pp.Process(sf.m_config.HeaderCode)); zdist = sf.m_config.ZThick; String firstlayerdelay = ";<Delay> " + sf.m_config.firstlayertime_ms + " \r\n"; String layerdelay = ";<Delay> " + sf.m_config.layertime_ms + " \r\n"; String blankdelay = ";<Delay> " + sf.m_config.blanktime_ms + " \r\n"; String preSliceGCode = pp.Process(sf.m_config.PreSliceCode); String LiftGCode = pp.Process(sf.m_config.LiftCode); int numslices = sf.NumSlices; if (sf.m_modeltype == SliceFile.ModelType.eResinTest1) { numslices -= 10; } // for a per-slice basis, we're going to re-evaluate the prelift and lift gcode // doing this will allow us to have per-slice determinations based on slice index. int c; for (c = 0; c < numslices; c++) { pp.SetVar("$CURSLICE", c); preSliceGCode = pp.Process(sf.m_config.PreSliceCode); //pp.SetVar("$CURSLICE", c); sb.Append(preSliceGCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append(";<Slice> Blank \r\n"); // show the blank layer LiftGCode = pp.Process(sf.m_config.LiftCode); // re-run the lift code sb.Append(LiftGCode); // append the pre-lift codes } // special ending on resin test model slicing if (sf.m_modeltype == SliceFile.ModelType.eResinTest1) { for (; c < sf.NumSlices; c++) { sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c == sf.NumSlices - 1) // set minimus exposure time on final layer { sb.Append(";<Delay> " + sf.m_config.minExposure + " \r\n"); } else { sb.Append(";<Delay> " + sf.m_config.exposureStep + " \r\n"); } } sb.Append(";<Slice> Blank \r\n"); // show the blank layer LiftGCode = pp.Process(sf.m_config.LiftCode); // re-run the lift code sb.Append(LiftGCode); // append the pre-lift codes } //append the footer sb.Append(pp.Process(sf.m_config.FooterCode)); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return(gc); }
/* * GCode Process for building 3d DVP UV objects * * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> * * */ /* * This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } // append the build parameters as reference sb.Append(sf.m_config.ToString()); // append the header sb.Append(sf.m_config.HeaderCode); String firstlayerdelay = "(<Delay> " + sf.m_config.firstlayertime_ms + " )\r\n"; String layerdelay = "(<Delay> " + sf.m_config.layertime_ms + " )\r\n"; String blankdelay = "(<Delay> " + sf.m_config.blanktime_ms + " )\r\n"; zdist = sf.m_config.ZThick; for (int c = 0; c < sf.m_slices.Count; c++) { sb.Append(sf.m_config.PreSliceCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append("(<Slice> " + c + " )\r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append("(<Slice> Blank )\r\n"); // show the blank layer sb.Append(sf.m_config.PreLiftCode); // append the pre-lift codes String tmpZU = String.Format("{0:0.00000}", (sf.m_config.liftdistance * zdir)).Replace(',', '.'); String tmpZD = String.Format("{0:0.00000}", ((sf.m_config.liftdistance - zdist) * zdir * -1)).Replace(',', '.'); if (sf.m_config.slidetiltval == 0.0) // tilt/slide is not used here { sb.Append("G1 Z" + tmpZU + " F" + liftfeed + " (Lift) \r\n"); sb.Append("G1 Z" + tmpZD + " F" + retractfeed + " (End Lift) \r\n"); } else // tilt/slide has a value, so it is used { // format the X slide/tilt value String tmpX1 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval)).Replace(',', '.'); String tmpX2 = String.Format("{0:0.00000}", (sf.m_config.slidetiltval * -1)).Replace(',', '.'); sb.Append("G1 X" + tmpX1 + " Z" + tmpZU + " F" + liftfeed + " (Lift) \r\n"); sb.Append("G1 X" + tmpX2 + " Z" + tmpZD + " F" + retractfeed + " (End Lift) \r\n"); } // append the post-lift codes sb.Append(sf.m_config.PostLiftCode); // add a delay for the lift sequence and the pre/post lift codes to execute sb.Append(blankdelay); } //append the footer sb.Append(sf.m_config.FooterCode); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return(gc); }
/* GCode Process for building 3d DVP UV objects * <Build Start> * <Slicing Comments> comments containing the slicing and building parameters * <Header Code> start.gcode - commands from this * file are inserted, they contain whatever intiailization sequences are need to initialize the machine * at this point, the build tray is in position to start printing a layer * <Layer Start> * Display the correct image slice for the current layer * Delay for <Layertime> to expose the UV resin * <Layer End> */ // here we prepare the gcode preprocessor and fill all nessesary variables protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi) { PreProcessor pp = new PreProcessor(); pp.SetVar("$LayerThickness", sf.m_config.ZThick); pp.SetVar("$ZLiftDist", sf.m_config.liftdistance); pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate); pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate); pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval); pp.SetVar("$BlankTime", sf.m_config.blanktime_ms); pp.SetVar("$LayerTime", sf.m_config.layertime_ms); pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms); return pp; }
public frmMachineConfig(ref MachineConfig config) { InitializeComponent(); m_config = config; FillMonitors(); // list out the system monitors }
private void SetupForMachineType() { MachineConfig mc = UVDLPApp.Instance().m_printerinfo; m_camera.UpdateBuildVolume((float)mc.m_PlatXSize, (float)mc.m_PlatYSize, (float)mc.m_PlatZSize); }
private UVDLPApp() { m_callbackhandler = new CallbackHandler(); m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); //m_dispmgr = DisplayManager.Instance(); // initialize the singleton for early event app binding //m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent+= new SupportGeneratorEvent(SupEvent); CSG.Instance().CSGEvent += new CSG.CSGEventDel(CSGEvent); m_proj_cmd_lst = new prjcmdlst(); m_plugins = new List<PluginEntry>(); // list of user plug-ins m_undoer = new Undoer(); m_2d_graphics = new C2DGraphics(); m_gui_config = new GuiConfig(); }
public void UpdateFrom(MachineConfig mf) { dpmmX = mf.PixPerMMX; //10 dots per mm dpmmY = mf.PixPerMMY;// 10; xres = mf.XRes; yres = mf.YRes; }
private ZipFile m_zip; // for storing image slices #endregion Fields #region Constructors private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent+= new SupportGeneratorEvent(SupEvent); }
private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); //m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent+= new SupportGeneratorEvent(SupEvent); CSG.Instance().CSGEvent += new CSG.CSGEventDel(CSGEvent); m_proj_cmd_lst = new prjcmdlst(); m_plugins = new List<PluginEntry>(); // list of user plug-ins m_undoer = new Undoer(); }
/* This is the main function to generate gcode files for the * already sliced model */ public static GCodeFile Generate(SliceFile sf, MachineConfig pi) { String gcode; StringBuilder sb = new StringBuilder(); PreProcessor pp = PreparePreprocessor(sf, pi); double zdist = 0.0; // double feedrate = pi.ZMaxFeedrate; // 10mm/min double liftfeed = sf.m_config.liftfeedrate; double bottomliftfeed = sf.m_config.bottomliftfeedrate; double retractfeed = sf.m_config.liftretractrate; double zdir = 1.0; // assume a bottom up machine int numbottom = sf.m_config.numfirstlayers; if (sf.m_config.direction == SliceBuildConfig.eBuildDirection.Top_Down) { zdir = -1.0;// top down machine, reverse the z direction } pp.SetVar("$ZDir", zdir); // append the build parameters as reference sb.Append(sf.m_config.ToString()); sb.Append(";Number of Slices = " + sf.NumSlices.ToString() + "\r\n"); sb.Append(pi.ToString());//add the machine build parameters string // append the header sb.Append(pp.Process(sf.m_config.HeaderCode)); zdist = sf.m_config.ZThick; String firstlayerdelay = ";<Delay> " + sf.m_config.firstlayertime_ms + " \r\n"; String layerdelay = ";<Delay> " + sf.m_config.layertime_ms + " \r\n"; String blankdelay = ";<Delay> " + sf.m_config.blanktime_ms + " \r\n"; String preSliceGCode = pp.Process(sf.m_config.PreSliceCode); String LiftGCode = pp.Process(sf.m_config.LiftCode); int numslices = sf.NumSlices; if (sf.m_modeltype == SliceFile.ModelType.eResinTest1) numslices -= 10; // for a per-slice basis, we're going to re-evaluate the prelift and lift gcode // doing this will allow us to have per-slice determinations based on slice index. int c; for (c = 0; c < numslices; c++) { pp.SetVar("$CURSLICE", c); preSliceGCode = pp.Process(sf.m_config.PreSliceCode); //pp.SetVar("$CURSLICE", c); sb.Append(preSliceGCode);//add in the pre-slice code // this is the marker the BuildManager uses to display the correct slice sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c < numbottom)// check for the bottom layers { sb.Append(firstlayerdelay); } else { sb.Append(layerdelay); } sb.Append(";<Slice> Blank \r\n"); // show the blank layer LiftGCode = pp.Process(sf.m_config.LiftCode); // re-run the lift code sb.Append(LiftGCode); // append the pre-lift codes } // special ending on resin test model slicing if (sf.m_modeltype == SliceFile.ModelType.eResinTest1) { for (; c < sf.NumSlices; c++) { sb.Append(";<Slice> " + c + " \r\n"); // add a pause for the UV resin to be set using this image if (c == sf.NumSlices -1) // set minimus exposure time on final layer sb.Append(";<Delay> " + sf.m_config.minExposure + " \r\n"); else sb.Append(";<Delay> " + sf.m_config.exposureStep + " \r\n"); } sb.Append(";<Slice> Blank \r\n"); // show the blank layer LiftGCode = pp.Process(sf.m_config.LiftCode); // re-run the lift code sb.Append(LiftGCode); // append the pre-lift codes } //append the footer sb.Append(pp.Process(sf.m_config.FooterCode)); gcode = sb.ToString(); GCodeFile gc = new GCodeFile(gcode); return gc; }
private UVDLPApp() { m_supportmode = eSupportEditMode.eNone; SceneFileName = ""; m_callbackhandler = new CallbackHandler(); m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.m_slicemethod = Slicer.eSliceMethod.eNormalCount;// configure the slicer to user the new normal count - Thanks Shai!!! m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); //m_dispmgr = DisplayManager.Instance(); // initialize the singleton for early event app binding //m_flexslice = new FlexSlice(); m_gcode = new GCodeFile(""); // create a blank gcode to start with m_supportconfig = new SupportConfig(); m_supportgenerator = new SupportGenerator(); m_supportgenerator.SupportEvent+= new SupportGeneratorEvent(SupEvent); CSG.Instance().CSGEvent += new CSG.CSGEventDel(CSGEvent); m_proj_cmd_lst = new prjcmdlst(); m_plugins = new List<PluginEntry>(); // list of user plug-ins m_pluginstates = PluginStates.Instance(); // initialize the plugin state singleton m_undoer = new Undoer(); m_2d_graphics = new C2DGraphics(); m_gui_config = new GuiConfigManager(); m_AuxBuildCmds = AuxBuildCmds.Instance(); // make sure the singleton doesn't go away... m_sequencemanager = SequenceManager.Instance(); m_exporter = new frmExport(); m_exporter.RegisterExporter(new B9JExporter()); }
private UVDLPApp() { m_appconfig = new AppConfig(); m_printerinfo = new MachineConfig(); m_buildparms = new SliceBuildConfig(); m_deviceinterface = new DeviceInterface(); m_buildmgr = new BuildManager(); m_slicer = new Slicer(); m_slicer.Slice_Event += new Slicer.SliceEvent(SliceEv); m_flexslice = new FlexSlice(); m_gcode = null; }