Jump to content

FredFish

Member
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

FredFish last won the day on June 18 2023

FredFish had the most liked content!

Personal Information

  • 3D printer
    Other 3D printer

FredFish's Achievements

  1. can you create two files, one with the base the way you want it, and the other with the lettering the way you want it, then bring them both into Cura, and offset the z for the top lettering?, this should not combine the top with the base, just print the top on top (providing top and base alignment with the slices z distance), slashee may be able to discribethe processes better, but i have done something like this type of stackup with transparent fillament in the past.
  2. Thanks for posting and updating the code, I can use the example, I think I should better explain the purpose of the program in more detail. the original intent is to be able to take output from some printed circuit design software (Gerber data a.k.a. RS274X) and using a conductive ink pen, draw out the traces and pads required to connect components that would be loaded into a 3d printed circuit board. Similar technics have been done by using magic markers to colorize the outer walls of prints. I had originally written a standalone program, about 3 years ago, to insert the needed data into a 3d printer g-code file. But it seemed like extra work to save the g-code file from Cura, run the program, and then having to reload the edited g-code file back into Cura to print it. The current insert Gerber at layer script is meant to emulate the program using post processing from within Cura. I do not purposely run into bearers however I do seem to find my share. Python is not my first language so some programming style may seem a bit chaotic as I am taking bits from different examples and pasting them together to replicate previous processes. Your wisdom in this area is very much appreciated. I thank you for the example of looping the input windows, it seems to work well. however for me the script stopped working at the r”\n” line, on both the new and old versions of Cura, the error log shows: 2023-10-24 05:26:54,295 - ERROR - [MainThread] UM.Logger.logException [116]: gcode_list = script.execute(gcode_list) 2023-10-24 05:26:54,295 - ERROR - [MainThread] UM.Logger.logException [116]: File "D:\Cura4.12.1\Ultimaker Cura 4.12.1\plugins\PostProcessingPlugin\scripts\ff_InsertGerberAtLayerChange.py", line 598, in execute 2023-10-24 05:26:54,295 - ERROR - [MainThread] UM.Logger.logException [116]: start_gcode = start_gcode_raw.replace(r"\n", "\n") 2023-10-24 05:26:54,311 - ERROR - [MainThread] UM.Logger.logException [116]: AttributeError: 'NoneType' object has no attribute 'replace' any idea what is missing?
  3. Thanks for the coding updates, you are correct in that I am using older Windows and an ender 3, the code issues I ran into may be a result of that. And your character replacement had different results with the different versions of my windows and Cura, the code was what worked on both, even though you are correct that it Should work as you described. i think i mentioned something about it being repetitive, you are correct i should have used a loop, my limitation on lines was arbitrary (just got tired of copying) , using the paradigm how would you make the amount of lines match the capacity of the stack location? is there a limit? All I am doing is collecting the lines and making them into one string anyway. and finally thanks for going down the rabbit hole with me, I could have stuck with the program limitations, but what fun would that be? like you mentioned before scope creep it’ll get you every time.
  4. I had an epiphany regarding the multiline input, and updated the script :) Almost comical in implementation, it fills the missing void by combining both single lines and slash-n’s. Several single lines are in fact a multiline input. Just don’t know how to loop the return definition to call more than one line, so it’s currently limited to 20 lines because it’s just repetitive code for each line, and each line can still have multiple slash-n’s (\n) for newlines. I had ncluded the variable notes to include comments within the g-code for debugging, but set it not none as the default. Thanks for all the assistance with new eyes when my lines of code get blurry, moving this to thingiverse. ff_InsertGerberAtLayerChange(update).zip
  5. Thanks for your patience with my repetition. I am utterly frustrated with fences with no gates that I run into, I understand it is good practice to keep the nefarious file parsers at bay, but do not know why it should limit everyone else. the terse issue listings in the log file are why I posted the question here, and I also found the need for additional output when debugging (I had added a notes option throughout the script, to include information to the output file as comments) The first suggestion using replace did not initially work, because in the newer cura version, once input was converted to a string, changed the string \n to \\\n (but not in the older version that allowed \r\n), I now see going back over it, this was a script sequence error, I needed to do replace before making the input line a string, thanks for that, I get it now (pounding head on fence post). Sorry for wining about the multiline input. I have been searching the Cura files for the place where the input sequences from the machine manager window, swaps out the variants for the values. I could see that allowing this globally with eval() could cause unintended consequences. What file has the setting that limits this transaction to local() within the machine manager, so I can get an idea of how this is done? The three consecutive newlines being blocked issue is still a mystery, but not relevant here for now, I can live with it, just don’t know why it exists. Finally let me say thank you again for replying to my questions, this project started as a weekend wish list, of just using scriptable options instead of using external programs and jumping back and forth between them, I do appreciate the help.
  6. I'm standing on the edge looking down, but still haven’t found what I’m looking for, I changed the input to allow for 4 types of input, I find I still have to set up a separate format for each type of input variable. (See updated script) the back end tool setup allows for picking up preset variables from existing stacks when used, but does not replace the variable names from within the strings retrieved, indicating that replacement of these is done after the run processing but before scripting. Any idea about how to run this after scripting without having to swap each one out one at a time (repeating this procedure)? Something like reload as g-code but internally, this would also allow you to see all the changes made by the script in the preview window as well. the input file option, allows for automatic conversion of \r\n newlines to \n, when the file is loaded into a variable, but the input as a string still won’t allow for multiple lines only \n, and as a side note won’t allow for three consecutive blank lines \n\n\n to be added, what is this restriction for?, is there another input option type in these python scripts that allow for multiline input? I am trying to stay within the boundaries but looking for other options. it just seems like I’m missing something with all the upgrades, advice would be appreciated. Current script update attached for reference, to be posted with Pen holder on thingiverse when stable. ff_InsertGerberAtLayerChange.zip
  7. I use Esun transparent PETG, clear? Well almost, here is some hopefully useful tips I use for my E3, print as hot as you can without stringing (I use about 240c but PETG string a lot), if you need fill, set fill pattern all in one direction depending on final light source(I use 100% fill all at 90 degrees), typically the extruder path leaves rounded edges of extrusion on fill patterns, the extrusion then squishes up to the next edge, these edges together create the fill pattern, sometimes this doesn’t work, and you get white fill (air pockets) visible by looking across the fill pattern direction more than with the fill pattern direction, for this you can try smaller Z step (depending on nozzle size) or use smoothing for all layers to flatten and fill in these edges. finally yes you will go through lots of tests before you get it correct so keep track of what changes are made for what print, because just when you think you get it right, some little variable will change and you will be back readjusting again :) , printing transparently with a FFF printer is tricky, but can be done.
  8. Down the rabbit hole we must go. In diving into this anomaly with my win7 laptop running Cura4.12 it seems that I can indeed cut from the Machine Settings window, both the start and stop codes, and past the multiple lines into the single input line boxes of the script, although you cannot see the line brakes, the output g-code has the multiple lines of code included. So although a little odd, this seems to work for me but limits any new Cura options. However when I attempted to do the same on my win10 laptop running Cura5.4 this is not the case, attempting to paste more than a single line into the single input line box, the paste option seems to be blocked, with only visible characters allowed. Using an external editor to include swappable characters just to reinsert them, seems to defeat the purpose of running the process as a script and not just running the whole thing externally. Is this a case of upgrade into failure just to keep me safe, or is there a way to modify the new input line permissions, or even popup the extruder tool menu like interface window from within the script?
  9. Thanks for your response. I think I get it now, I may have been overthinking the issue of using the input line as the editor. Sooo, the input window size cannot change without modifying the QML code (To much work for now), but if I cut and paste from an editor (like word or notepad) I can paste multiple lines simultaneously into the input window, I just cannot see the line brakes or do much in the way of editing the lines other than seethe single string without newlines (although the newlines are there when I use the inputted data), so no need to add any extra “\n” at the end of each line, is this correct?
  10. I set out this weekend to generate a post process script in Cura that would allow me to draw with a pen or marker between transparent layers, originally printing embedded traces from a PCB design output as Gerber data code (rs274x type), but it turned into making imbedded logos as well, this first part I think works for me, and is better than exporting editing and importing the code, it’s not the question, I included the script to illustrate the issue. I set up Cura with a custom profile having 3 separate tools, the extruder and 2 pens, and wrote some of the very redundant code. Realizing I was coping over most of the original settings from my printer (Creality Ender 3 Pro) before ever running the script just to get it to re-read all the variables, because the Custom printer selection loads directly from the fdmprinter.py profile, bypassing all the Creality settings. Soooo, I tried to add a section to my script to allow for when the printer only has one print head (the default in my case). The script reads through the data until it finds the correct end of layer section. The pen loads (needed load pen sequence), prints (using converted Gerber data), and unloads (needed unload pen sequence) using the g-code being added by the script. This is where I ran into questions. My question may be with script window formatting under PostProcessingPlugin.qml itself, in order to include the pen load and unload g-code I need to enter several lines of code like is done in the machine setting window to set tool start and end, using the default single entry type line, I end up with hard to enter \n in a long code line, not the newlines that are needed, these are then transposed to be left as is in the PostProcessingPlugin.py section, any idea on how to get a multi-line window in the script section, or reformat the string for multiple lines without the need for \n? ff_InsertGerberAtLayerChange.zip
  11. I also noted extruder extra movement with installation of 4.5.0 stable install, Needed to adjust several settings pertaining to size including Initial layer horizontal expansion, hole horizontal expansion, horizontal expansion, and also lowered various extruder flow parameters. But the print speed and quality has improved after making changes. this may have something to do with material density, in my case the listing of old model for Esun black PETG was 1.23 new listing is 1.24 g/cm2, other material setting may have also been changed. my extracted Samples show table center shifted, and these were computed on two separate computers, newer on win10 and older on win7, with settings as close to same as possible, but may not be apples to apples however the by doing the math the increase in extrusion is evident. Cura 5.4.0 ;TYPE:WALL-OUTER G1 F1800 X124.8 Y115.2 E11.8283 G1 X115.2 Y115.2 E12.08374 G1 X115.2 Y124.8 E12.33917 G1 X124.8 Y124.8 E12.59461 Cura 4.12.1 ;TYPE:WALL-OUTER G1 F1200 X114.798 Y114.798 E10.22926 G1 X105.202 Y114.798 E10.48714 G1 X105.202 Y105.202 E10.74503 G1 X114.798 Y105.202 E11.00291 Hope this helps narrow down something that may have been overlooked.
  12. cura 5.4 beta has updates, and GregValiant has posted a post process script to include the last tool change, so no need to add {machine_extruder_end_code, Extruder_nr} to the printer end gcode Thanks GregValiant, good work
  13. yes, even with my 4.12.1 , using multiple extruders, if I add M117 {extruder_nr} in the printer end gcode window, the returned value in the previous revisions gcode file was 0, running the same model in 5.4 the returned gcode is 1 (consistently the last extruder in the model, not the last extruder used) thanks to GregValiant’s script, it’s now a moot point for me, but interesting to note that 5.4 has changed this setting for some other reason, that may affect other areas less apparent . thanks again for staying on this, I like the upgrades, and I hope you add the script as part of the release.
  14. This was a previous issue but has now changed, The difference I saw was 5.3 did always default to extruder stack[0], after installing 5.4 it seems to defaults to last item in extruder stack, position [1 or 2] on my system depending on printed item tools used, so it can no longer be used as a preset variable, I pointed out something has changed. Regardless, the post processes script can make the required changes, so the machine_end_gcode does not need to be used as a preset now. Thanks
  15. It looks like at the end of the print, the {machine_extruder_end_code} is set to the last tool position in the used extruder stack rather than the last extruder tool that was used. example; print two items each with different heights, each with different extruders (multi extruder setup) swap the extruder order, its missing the last {extruder_end_gcode} in both cases. If you add the line {machine_extruder_end_code} to the printer_end_gcode box,the output for {extruder_end_gcode} is pointing to the last position in the extruder stack regardless of what tool code was used last. I think it should include the start and end code for each extruder, and point to the last extruder tool used at the end. Hope this helps
×
×
  • Create New...