3 # This script is used to generate print profiles for lulzbot printers
4 # based off of the lulzbot_profiles directory which contains common
5 # profiles for multiple toolheads.
6 # To update profiles, run the script from the root Cura
7 # directory with ./scripts/recreate_lulzbot_profiles.py
16 CURA_QUICKPRINT_DIR="resources/quickprint/"
17 PROFILES_DIR="lulzbot_profiles"
20 'Mini_single_extruder_v2': ('lulzbot_mini',),
21 'Mini_flexystruder_v2': ('lulzbot_mini_flexystruder',),
22 'TAZ_single_extruder_0.35nozzle': ('lulzbot_TAZ_4_SingleV1',
23 'lulzbot_TAZ_5_SingleV1',
24 'lulzbot_TAZ_4_035nozzle',
25 'lulzbot_TAZ_5_035nozzle'),
26 'TAZ_single_extruder_0.5nozzle': ('lulzbot_TAZ_4_05nozzle',
27 'lulzbot_TAZ_5_05nozzle'),
28 'TAZ_dual_extruder_v1': ('lulzbot_TAZ_4_DualV1',
29 'lulzbot_TAZ_5_DualV1'),
30 'TAZ_dual_extruder_v2': ('lulzbot_TAZ_4_DualV2',
31 'lulzbot_TAZ_5_DualV2'),
32 'TAZ_flexystruder_v1': ('lulzbot_TAZ_4_FlexystruderV1',
33 'lulzbot_TAZ_5_FlexystruderV1'),
34 'TAZ_flexystruder_v2': ('lulzbot_TAZ_4_FlexystruderV2',
35 'lulzbot_TAZ_5_FlexystruderV2'),
36 'TAZ_flexy_dually_v1': ('lulzbot_TAZ_4_FlexyDuallyV1',
37 'lulzbot_TAZ_5_FlexyDuallyV1'),
38 'TAZ_flexy_dually_v2': ('lulzbot_TAZ_4_FlexyDuallyV2',
39 'lulzbot_TAZ_5_FlexyDuallyV2'),
49 "Laybrick" : "laybrick",
50 "PP-Iron": "protopasta-magnetic-iron",
51 "PP-Steel": "protopasta-stainless-steel",
52 "Bamboofill": "bamboofill",
53 "Woodfill": "woodfill",
55 "Alloy910": "alloy910",
60 "INOVA-1800": "CS-INOVA-1800",
64 "Bronzefill": "bronzefill",
65 "Copperfill": "copperfill",
67 "PP-Conductive": "protopasta-conductive-PLA",
69 "PC_VP": "polycarbonate",
70 "618-Nylon": "618-645-nylon",
71 "645-Nylon": "618-645-nylon",
72 # Dual extruder (Expert)
73 'PLA_PVA': 'PLA-PVA-support',
76 # Flexystruder (Expert)
77 "ninjaflex" : "ninjaflex",
78 "semiflex" : "semiflex",
79 # Flexy Dually (Expert)
80 "ABS_ninjaflex" : "ABS-ninjaflex",
81 "ABS_semiflex" : "ABS-semiflex",
86 # PLA-protopasta-conductive-PLA
114 "PP-Conductive": 500,
119 # Dual extruder (Expert)
123 # Flexystruder (Expert)
126 # Flexy Dually (Expert)
133 "HIPS_eSUN": "Beginner",
134 "PLA_eSUN": "Beginner",
135 "PLA_VP": "Beginner",
137 "ABS_VP": "Intermediate",
138 "Laybrick" : "Intermediate",
139 "PP-Iron": "Intermediate",
140 "PP-Steel": "Intermediate",
141 "Bamboofill": "Intermediate",
142 "Woodfill": "Intermediate",
144 "Alloy910": "Advanced",
145 "Bridge": "Advanced",
146 "Laywood": "Advanced",
147 "n-vent": "Advanced",
149 "INOVA-1800": "Advanced",
151 "PC-ABS": "Advanced",
152 "T-Glase": "Advanced",
153 "Bronzefill": "Advanced",
154 "Copperfill": "Advanced",
156 "PP-Conductive": "Expert",
157 "HIPS_VP" : "Expert",
159 "618-Nylon": "Expert",
160 "645-Nylon": "Expert",
161 # Dual extruder (Expert)
165 # Flexystruder (Expert)
166 "ninjaflex" : "Expert",
167 "semiflex" : "Expert",
168 # Flexy Dually (Expert)
169 "ABS_ninjaflex" : "Expert",
170 "ABS_semiflex" : "Expert",
175 "HIPS_eSUN": "HIPS (eSUN)",
176 "PLA_eSUN": "PLA (eSUN)",
177 "PLA_VP": "PLA (Village Plastics)",
179 "ABS_VP": "ABS (Village Plastics)",
180 "Laybrick" : "Laybrick (CC-Products)",
181 "PP-Iron": "Magnetic (Proto-pasta)",
182 "PP-Steel": "Steel PLA (Proto-pasta)",
183 "Bamboofill": "Bamboofill (Colorfabb)",
184 "Woodfill": "Woodfill (Colorfabb)",
186 "Alloy910": "Alloy 910 (Taulman)",
187 "Bridge": "Bridge Nylon (Taulman)",
188 "Laywood": "Laywoo-D3 (CC-Products)",
189 "n-vent": "n-vent (Taulman)",
190 "XT": "XT (Colorfabb)",
191 "INOVA-1800": "INOVA-1800 (ChromaStrand)",
192 "PCTPE": "PCTPE (Taulman)",
193 "PC-ABS": "PC-ABS (Proto-pasta)",
194 "T-Glase": "t-glase (Taulman)",
195 "Bronzefill": "Bronzefill (Colorfabb)",
196 "Copperfill": "Copperfill (Colorfabb)",
198 "PP-Conductive": "Conductive (Proto-pasta)",
199 "HIPS_VP" : "HIPS (Village Plastics)",
200 "PC_VP": "PC (Village Plastics)",
201 "618-Nylon": "618 Nylon (Taulman)",
202 "645-Nylon": "645 Nylon (Taulman)",
203 # Dual extruder (Expert)
204 'PLA_PVA': "PLA & PVA",
205 'ABS_ABS': "ABS & ABS",
206 'PLA_PLA': "PLA & PLA",
207 # Flexystruder (Expert)
208 "ninjaflex" : "NinjaFlex (Fenner Drives)",
209 "semiflex" : "SemiFlex (Fenner Drives)",
210 # Flexy Dually (Expert)
211 "ABS_ninjaflex" : "ABS & NinjaFlex",
212 "ABS_semiflex" : "ABS & SemiFlex",
215 bed_prep_materials = {
232 "HIPS_eSUN": "www.lulzbot.com/products/hips-3mm-filament-1kg-reel-esun",
233 "PLA_eSUN": "www.lulzbot.com/products/pla-3mm-filament-1kg-or-500g-reel-esun",
234 "PLA_VP": "www.lulzbot.com/products/pla-3mm-filament-1kg-reel-village-plastics",
236 "ABS_VP": "www.lulzbot.com/products/abs-3mm-filament-1kg-reel",
237 "Laybrick" : "www.lulzbot.com/products/laybrick-filament-3mm",
238 "PP-Iron": "www.lulzbot.com/products/magnetic-iron-pla-3mm-filament-500g-reel-proto-pasta",
239 "PP-Steel": "www.lulzbot.com/products/stainless-steel-pla-3mm-filament-500g-reel-proto-pasta",
243 "Alloy910": "www.lulzbot.com/products/alloy-910-3mm-filament-1lb-reel-taulman",
244 "Bridge": "www.lulzbot.com/products/taulman-bridge-nylon-3mm-filament-1-pound",
245 "Laywood": "www.lulzbot.com/products/laywoo-d3-cherry-laywood-3mm-250g-coil-cc-products",
246 "n-vent": "www.lulzbot.com/products/n-vent-3mm-filament-1lb-taulman",
249 "PCTPE": "www.lulzbot.com/products/taulman-pctpe-3mm-filament-1-pound",
250 "PC-ABS": "www.lulzbot.com/products/pc-abs-alloy-3mm-filament-500g-reel-proto-pasta",
251 "T-Glase": "www.lulzbot.com/products/t-glase-3mm-filament-1lb-reel",
255 "PP-Conductive": "www.lulzbot.com/products/conductive-pla-3mm-filament-500g-reel-proto-pasta",
256 "HIPS_VP" : "www.lulzbot.com/products/hips-3mm-filament-1kg-or-5lb-reel-village-plastics",
257 "PC_VP": "www.lulzbot.com/products/polycarbonate-3mm-filament-1kg-reel",
258 "618-Nylon": "www.lulzbot.com/products/taulman-618-nylon-3mm-filament-1-pound",
259 "645-Nylon": "www.lulzbot.com/products/taulman-645-nylon-3mm-filament-1-pound",
260 # Dual extruder (Expert)
261 'ABS_ABS': "www.lulzbot.com/products/abs-3mm-filament-1kg-reel",
262 'PLA_PLA': "www.lulzbot.com/products/pla-3mm-filament-1kg-or-500g-reel-esun",
263 'PLA_PVA': "www.lulzbot.com/products/natural-pva-3mm-filament-05kg-reel-esun",
264 # Flexystruder (Expert)
265 "ninjaflex" : "www.lulzbot.com/ninjaflex",
266 "semiflex" : "www.lulzbot.com/products/semiflex-tpe-thermoplastic-elastomer-3mm-075kg",
267 # Flexy Dually (Expert)
268 "ABS_ninjaflex" : "www.lulzbot.com/ninjaflex",
269 "ABS_semiflex" : "www.lulzbot.com/products/semiflex-tpe-thermoplastic-elastomer-3mm-075kg",
273 'medium-quality': 'Standard',
274 'high-speed': 'High speed',
275 'high-quality': 'High detail',
276 'high-clarity': 'High clarity',
277 'high-strength': 'High strength'
288 disable_materials = {
289 'PET': ('High', 'Low', 'Normal', 'Ulti'),
290 'PLA': ('High', 'Low', 'Normal', 'Ulti'),
291 'ABS': ('High', 'Low', 'Normal', 'Ulti')
294 def find_files_for_material(files, material):
297 filename = os.path.basename(file)
298 if filename.startswith(material):
299 for p in profile_map.keys():
300 if filename.startswith(material + "_" + p):
302 result.append((file, material, profile))
305 def create_machine_type(machine_type, path, dir):
306 files = glob.glob(os.path.join(path, "*.ini"))
307 path = os.path.join(CURA_QUICKPRINT_DIR, machine_type)
308 for m in material_map.keys():
309 result = find_files_for_material(files, material_map[m])
310 for (file, material, profile) in result:
312 if file is None or material is None or profile is None:
314 filename = os.path.basename(file)
315 profile_file = os.path.join("..", "..", "..", PROFILES_DIR, dir, filename)
316 if not os.path.exists(os.path.join(path, material, profile)):
317 os.makedirs(os.path.join(path, material, profile))
318 with open(os.path.join(path, material, 'material.ini'), 'w') as f:
320 f.write("name = %s\n" % material_names[material])
321 order = material_order[material]
322 if material_types.has_key(material):
323 types = material_types[material]
324 if (material == "HIPS_eSUN" and machine_type.startswith("lulzbot_mini")) or \
325 (material == "ABS_VP" and machine_type.startswith("lulzbot_TAZ")):
326 types = types + "|First Run"
328 f.write("material_types = %s\n" % types)
329 f.write("order = %d\n" % order)
330 if material in bed_prep_materials:
331 f.write("description = \
332 Bed preparation required: \n\
333 Apply a PVA-based glue stick \n\
334 to bed surface before printing.\n")
335 if material_url.has_key(material):
336 f.write("url = %s\n" % material_url[material])
337 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
339 f.write("name = %s\n" % profile_map[profile])
340 f.write("order = %d\n" % profile_order[profile])
341 f.write("profile_file = %s\n" % profile_file)
342 for material in disable_materials.keys():
343 if os.path.exists(os.path.join(path, material)):
344 for profile in disable_materials[material]:
345 if not os.path.exists(os.path.join(path, material, profile)):
346 os.makedirs(os.path.join(path, material, profile))
347 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
349 f.write("disabled = true\n")
351 os.makedirs(os.path.join(path, material))
352 with open(os.path.join(path, material, 'material.ini'), 'w') as f:
354 f.write("disabled = true\n")
356 def clear_quickprint_folders():
358 quickprint_path = os.path.join(here,CURA_QUICKPRINT_DIR)
359 candidates = os.listdir(quickprint_path)
362 for candidate in candidates:
363 if "lulzbot_mini" in candidate or \
364 "lulzbot_TAZ" in candidate:
365 candidate_path = os.path.join(quickprint_path, candidate)
366 if os.path.isdir(candidate_path):
367 folder_paths.append(candidate_path)
368 for path in folder_paths:
371 print("No Quickprint folders to delete")
373 print("Quickprint folders deleted")
376 if not os.path.exists(CURA_QUICKPRINT_DIR):
377 print "Cura path is wrong"
380 clear_quickprint_folders()
382 dirs = glob.glob(os.path.join(CURA_QUICKPRINT_DIR, PROFILES_DIR, "*"))
385 dir = os.path.basename(d)
386 if dir_map.has_key(dir):
387 for machine_type in dir_map[dir]:
388 create_machine_type(machine_type, d, dir)
390 print "Quickprint profiles regenerated"
393 if __name__ == '__main__':