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'),
40 'TAZ6_single_tilapia': ('lulzbot_TAZ_6_Single_Tilapia',),
50 "Laybrick" : "laybrick",
51 "PP-Iron": "protopasta-magnetic-iron",
52 "PP-Steel": "protopasta-stainless-steel",
53 "Bamboofill": "bamboofill",
54 "Woodfill": "woodfill",
56 "Alloy910": "alloy910",
61 "INOVA-1800": "CS-INOVA-1800",
65 "Bronzefill": "bronzefill",
66 "Copperfill": "copperfill",
68 "PP-Conductive": "protopasta-conductive-PLA",
70 "PC_VP": "polycarbonate",
71 "618-Nylon": "618-645-nylon",
72 "645-Nylon": "618-645-nylon",
73 # Dual extruder (Expert)
74 'PLA_PVA': 'PLA-PVA-support',
77 # Flexystruder (Expert)
78 "ninjaflex" : "ninjaflex",
79 "semiflex" : "semiflex",
80 # Flexy Dually (Expert)
81 "ABS_ninjaflex" : "ABS-ninjaflex",
82 "ABS_semiflex" : "ABS-semiflex",
87 # PLA-protopasta-conductive-PLA
115 "PP-Conductive": 500,
120 # Dual extruder (Expert)
124 # Flexystruder (Expert)
127 # Flexy Dually (Expert)
134 "HIPS_eSUN": "Beginner",
135 "PLA_eSUN": "Beginner",
136 "PLA_VP": "Beginner",
138 "ABS_VP": "Intermediate",
139 "Laybrick" : "Intermediate",
140 "PP-Iron": "Intermediate",
141 "PP-Steel": "Intermediate",
142 "Bamboofill": "Intermediate",
143 "Woodfill": "Intermediate",
145 "Alloy910": "Advanced",
146 "Bridge": "Advanced",
147 "Laywood": "Advanced",
148 "n-vent": "Advanced",
150 "INOVA-1800": "Advanced",
152 "PC-ABS": "Advanced",
153 "T-Glase": "Advanced",
154 "Bronzefill": "Advanced",
155 "Copperfill": "Advanced",
157 "PP-Conductive": "Expert",
158 "HIPS_VP" : "Expert",
160 "618-Nylon": "Expert",
161 "645-Nylon": "Expert",
162 # Dual extruder (Expert)
166 # Flexystruder (Expert)
167 "ninjaflex" : "Expert",
168 "semiflex" : "Expert",
169 # Flexy Dually (Expert)
170 "ABS_ninjaflex" : "Expert",
171 "ABS_semiflex" : "Expert",
176 "HIPS_eSUN": "HIPS (eSUN)",
177 "PLA_eSUN": "PLA (eSUN)",
178 "PLA_VP": "PLA (Village Plastics)",
180 "ABS_VP": "ABS (Village Plastics)",
181 "Laybrick" : "Laybrick (CC-Products)",
182 "PP-Iron": "Magnetic (Proto-pasta)",
183 "PP-Steel": "Steel PLA (Proto-pasta)",
184 "Bamboofill": "Bamboofill (colorFabb)",
185 "Woodfill": "Woodfill (colorFabb)",
187 "Alloy910": "Alloy 910 (Taulman)",
188 "Bridge": "Bridge Nylon (Taulman)",
189 "Laywood": "Laywoo-D3 (CC-Products)",
190 "n-vent": "n-vent (Taulman)",
191 "XT": "XT (colorFabb)",
192 "INOVA-1800": "INOVA-1800 (ChromaStrand)",
193 "PCTPE": "PCTPE (Taulman)",
194 "PC-ABS": "PC-ABS (Proto-pasta)",
195 "T-Glase": "t-glase (Taulman)",
196 "Bronzefill": "Bronzefill (colorFabb)",
197 "Copperfill": "Copperfill (colorFabb)",
199 "PP-Conductive": "Conductive (Proto-pasta)",
200 "HIPS_VP" : "HIPS (Village Plastics)",
201 "PC_VP": "PC (Village Plastics)",
202 "618-Nylon": "618 Nylon (Taulman)",
203 "645-Nylon": "645 Nylon (Taulman)",
204 # Dual extruder (Expert)
205 'PLA_PVA': "PLA & PVA",
206 'ABS_ABS': "ABS & ABS",
207 'PLA_PLA': "PLA & PLA",
208 # Flexystruder (Expert)
209 "ninjaflex" : "NinjaFlex (Fenner Drives)",
210 "semiflex" : "SemiFlex (Fenner Drives)",
211 # Flexy Dually (Expert)
212 "ABS_ninjaflex" : "ABS & NinjaFlex",
213 "ABS_semiflex" : "ABS & SemiFlex",
216 bed_prep_materials = {
233 "HIPS_eSUN": "lulzbot.com/store/filament/hips-esun",
234 "PLA_eSUN": "lulzbot.com/store/filament/pla-esun",
235 "PLA_VP": "lulzbot.com/store/filament/pla-village",
237 "ABS_VP": "lulzbot.com/store/filament/abs",
238 "Laybrick" : "lulzbot.com/store/filament/laybrick",
239 "PP-Iron": "lulzbot.com/store/filament/magnetic-iron-pla",
240 "PP-Steel": "lulzbot.com/store/filament/stainless-steel-pla",
244 "Alloy910": "lulzbot.com/store/filament/alloy-910",
245 "Bridge": "lulzbot.com/store/filament/bridge-nylon",
246 "Laywood": "lulzbot.com/store/filament/laywoo-d3-laywood",
247 "n-vent": "lulzbot.com/store/filament/n-vent",
249 "PCTPE": "lulzbot.com/store/filament/pctpe",
250 "PC-ABS": "lulzbot.com/store/filament/pc-abs-alloy",
251 "T-Glase": "lulzbot.com/store/filament/t-glase",
255 "PP-Conductive": "lulzbot.com/store/filament/conductive-pla",
256 "HIPS_VP" : "lulzbot.com/store/filament/hips",
257 "PC_VP": "lulzbot.com/store/filament/polycarbonate",
258 "618-Nylon": "lulzbot.com/store/filament/nylon-618",
259 "645-Nylon": "lulzbot.com/store/filament/nylon-645",
260 # Dual extruder (Expert)
261 'ABS_ABS': "lulzbot.com/store/filament/abs",
262 'PLA_PLA': "lulzbot.com/store/filament/pla-esun",
263 'PLA_PVA': "lulzbot.com/store/filament/natural-pva",
264 # Flexystruder (Expert)
265 "ninjaflex" : "lulzbot.com/store/filament/ninjaflex",
266 "semiflex" : "lulzbot.com/store/filament/semiflex",
267 # Flexy Dually (Expert)
268 "ABS_ninjaflex" : "lulzbot.com/store/filament/ninjaflex",
269 "ABS_semiflex" : "lulzbot.com/store/filament/semiflex",
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 referer = "?pk_campaign=software-cura"
337 f.write("url = %s%s\n" %(material_url[material], referer) )
338 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
340 f.write("name = %s\n" % profile_map[profile])
341 f.write("order = %d\n" % profile_order[profile])
342 f.write("profile_file = %s\n" % profile_file)
343 for material in disable_materials.keys():
344 if os.path.exists(os.path.join(path, material)):
345 for profile in disable_materials[material]:
346 if not os.path.exists(os.path.join(path, material, profile)):
347 os.makedirs(os.path.join(path, material, profile))
348 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
350 f.write("disabled = true\n")
352 os.makedirs(os.path.join(path, material))
353 with open(os.path.join(path, material, 'material.ini'), 'w') as f:
355 f.write("disabled = true\n")
357 def clear_quickprint_folders():
359 quickprint_path = os.path.join(here,CURA_QUICKPRINT_DIR)
360 candidates = os.listdir(quickprint_path)
363 for candidate in candidates:
364 if "lulzbot_mini" in candidate or \
365 "lulzbot_TAZ" in candidate:
366 candidate_path = os.path.join(quickprint_path, candidate)
367 if os.path.isdir(candidate_path):
368 folder_paths.append(candidate_path)
369 for path in folder_paths:
372 print("No Quickprint folders to delete")
374 print("Quickprint folders deleted")
377 if not os.path.exists(CURA_QUICKPRINT_DIR):
378 print "Cura path is wrong"
381 clear_quickprint_folders()
383 dirs = glob.glob(os.path.join(CURA_QUICKPRINT_DIR, PROFILES_DIR, "*"))
386 dir = os.path.basename(d)
387 if dir_map.has_key(dir):
388 for machine_type in dir_map[dir]:
389 create_machine_type(machine_type, d, dir)
391 print "Quickprint profiles regenerated"
394 if __name__ == '__main__':