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 generate profiles or update them, make sure there are no existing profiles
7 # by doing a rm -rf resources/quickprint/lulzbot_mini* resources/quickprint/lulzbot_TAZ*
8 # then run the script from the root Cura directory with ./scripts/create_lulzbot_profiles.py
17 CURA_QUICKPRINT_DIR="resources/quickprint/"
18 PROFILES_DIR="lulzbot_profiles"
21 'Mini_single_extruder_v2': ('lulzbot_mini',),
22 'Mini_flexystruder_v2': ('lulzbot_mini_flexystruder',),
23 'TAZ_single_extruder_0.35nozzle': ('lulzbot_TAZ_4_SingleV1',
24 'lulzbot_TAZ_5_SingleV1',
25 'lulzbot_TAZ_4_035nozzle',
26 'lulzbot_TAZ_5_035nozzle'),
27 'TAZ_single_extruder_0.5nozzle': ('lulzbot_TAZ_4_05nozzle',
28 'lulzbot_TAZ_5_05nozzle'),
29 'TAZ_dual_extruder_v1': ('lulzbot_TAZ_4_DualV1',
30 'lulzbot_TAZ_5_DualV1'),
31 'TAZ_dual_extruder_v2': ('lulzbot_TAZ_4_DualV2',
32 'lulzbot_TAZ_5_DualV2'),
33 'TAZ_flexystruder_v1': ('lulzbot_TAZ_4_FlexystruderV1',
34 'lulzbot_TAZ_5_FlexystruderV1'),
35 'TAZ_flexystruder_v2': ('lulzbot_TAZ_4_FlexystruderV2',
36 'lulzbot_TAZ_5_FlexystruderV2'),
37 'TAZ_flexy_dually_v1': ('lulzbot_TAZ_4_FlexyDuallyV1',
38 'lulzbot_TAZ_5_FlexyDuallyV1'),
39 'TAZ_flexy_dually_v2': ('lulzbot_TAZ_4_FlexyDuallyV2',
40 'lulzbot_TAZ_5_FlexyDuallyV2'),
50 "Laybrick" : "laybrick",
51 "PP-Iron": "protopasta-magnetic-iron",
52 "PP-Steel": "protopasta-stainless-steel",
54 "Alloy910": "alloy910",
62 "PP-Conductive": "protopasta-conductive-PLA",
64 "PC_VP": "polycarbonate",
65 "618-Nylon": "618-645-nylon",
66 "645-Nylon": "618-645-nylon",
67 # Dual extruder (Expert)
68 'PLA_PVA': 'PLA-PVA-support',
71 # Flexystruder (Expert)
72 "ninjaflex" : "ninjaflex",
73 "semiflex" : "semiflex",
74 # Flexy Dually (Expert)
75 "ABS_ninjaflex" : "ABS-ninjaflex",
76 "ABS_semiflex" : "ABS-semiflex",
84 # PLA-protopasta-conductive-PLA
106 "PP-Conductive": 500,
111 # Dual extruder (Expert)
115 # Flexystruder (Expert)
118 # Flexy Dually (Expert)
125 "HIPS_eSUN": "Beginner",
126 "PLA_eSUN": "Beginner",
127 "PLA_VP": "Beginner",
129 "ABS_VP": "Intermediate",
130 "Laybrick" : "Intermediate",
131 "PP-Iron": "Intermediate",
132 "PP-Steel": "Intermediate",
134 "Alloy910": "Advanced",
135 "Bridge": "Advanced",
136 "Laywood": "Advanced",
137 "n-vent": "Advanced",
139 "PC-ABS": "Advanced",
140 "T-Glase": "Advanced",
142 "PP-Conductive": "Expert",
143 "HIPS_VP" : "Expert",
145 "618-Nylon": "Expert",
146 "645-Nylon": "Expert",
147 # Dual extruder (Expert)
151 # Flexystruder (Expert)
152 "ninjaflex" : "Expert",
153 "semiflex" : "Expert",
154 # Flexy Dually (Expert)
155 "ABS_ninjaflex" : "Expert",
156 "ABS_semiflex" : "Expert",
161 "HIPS_eSUN": "HIPS (eSUN)",
162 "PLA_eSUN": "PLA (eSUN)",
163 "PLA_VP": "PLA (Village Plastics)",
165 "ABS_VP": "ABS (Village Plastics)",
166 "Laybrick" : "Laybrick (CC-Products)",
167 "PP-Iron": "Iron PLA (Proto-pasta)",
168 "PP-Steel": "Steel PLA (Proto-pasta)",
170 "Alloy910": "Alloy 910 (Taulman)",
171 "Bridge": "Bridge Nylon (Taulman)",
172 "Laywood": "Laywoo-D3 (CC-Products)",
173 "n-vent": "n-vent (Taulman)",
174 "PCTPE": "PCTPE (Taulman)",
175 "PC-ABS": "PC-ABS (Proto-pasta",
176 "T-Glase": "t-glase (Taulman)",
178 "PP-Conductive": "Conductive (Proto-pasta)",
179 "HIPS_VP" : "HIPS (Village Plastics)",
180 "PC_VP": "PC (Village Plastics)",
181 "618-Nylon": "618 Nylon (Taulman)",
182 "645-Nylon": "645 Nylon (Taulman)",
183 # Dual extruder (Expert)
184 'PLA_PVA': "PLA & PVA",
185 'ABS_ABS': "ABS & ABS",
186 'PLA_PLA': "ABS & ABS",
187 # Flexystruder (Expert)
188 "ninjaflex" : "NinjaFlex (Fenner Drives)",
189 "semiflex" : "SemiFlex (Fenner Drives)",
190 # Flexy Dually (Expert)
191 "ABS_ninjaflex" : "ABS & NinjaFlex",
192 "ABS_semiflex" : "ABS & SemiFlex",
197 "HIPS_eSUN": "https://www.lulzbot.com/products/hips-3mm-filament-1kg-reel-esun",
198 "PLA_eSUN": "https://www.lulzbot.com/products/pla-3mm-filament-1kg-or-500g-reel-esun",
199 "PLA_VP": "https://www.lulzbot.com/products/pla-3mm-filament-1kg-reel-village-plastics",
201 "ABS_VP": "https://www.lulzbot.com/products/abs-3mm-filament-1kg-reel",
202 "Laybrick" : "https://www.lulzbot.com/products/laybrick-filament-3mm",
203 "PP-Iron": "https://www.lulzbot.com/products/magnetic-iron-pla-3mm-filament-500g-reel-proto-pasta",
204 "PP-Steel": "https://www.lulzbot.com/products/stainless-steel-pla-3mm-filament-500g-reel-proto-pasta",
206 "Alloy910": "https://www.lulzbot.com/products/alloy-910-3mm-filament-1lb-reel-taulman",
207 "Bridge": "https://www.lulzbot.com/products/taulman-bridge-nylon-3mm-filament-1-pound",
208 "Laywood": "https://www.lulzbot.com/products/laywoo-d3-cherry-laywood-3mm-250g-coil-cc-products",
209 "n-vent": "https://www.lulzbot.com/products/n-vent-3mm-filament-1lb-taulman",
210 "PCTPE": "https://www.lulzbot.com/products/taulman-pctpe-3mm-filament-1-pound",
211 "PC-ABS": "https://www.lulzbot.com/products/pc-abs-alloy-3mm-filament-500g-reel-proto-pasta",
212 "T-Glase": "https://www.lulzbot.com/products/t-glase-3mm-filament-1lb-reel",
214 "PP-Conductive": "https://www.lulzbot.com/products/conductive-pla-3mm-filament-500g-reel-proto-pasta",
215 "HIPS_VP" : "https://www.lulzbot.com/products/hips-3mm-filament-1kg-or-5lb-reel-village-plastics",
216 "PC_VP": "https://www.lulzbot.com/products/polycarbonate-3mm-filament-1kg-reel",
217 "618-Nylon": "https://www.lulzbot.com/products/taulman-618-nylon-3mm-filament-1-pound",
218 "645-Nylon": "https://www.lulzbot.com/products/taulman-645-nylon-3mm-filament-1-pound",
219 # Dual extruder (Expert)
220 'ABS_ABS': "https://www.lulzbot.com/products/abs-3mm-filament-1kg-reel",
221 'PLA_PLA': "https://www.lulzbot.com/products/pla-3mm-filament-1kg-or-500g-reel-esun",
222 'PLA_PVA': "https://www.lulzbot.com/products/natural-pva-3mm-filament-05kg-reel-esun",
223 # Flexystruder (Expert)
224 "ninjaflex" : "https://www.lulzbot.com/ninjaflex",
225 "semiflex" : "https://www.lulzbot.com/products/semiflex-tpe-thermoplastic-elastomer-3mm-075kg",
226 # Flexy Dually (Expert)
227 "ABS_ninjaflex" : "https://www.lulzbot.com/ninjaflex",
228 "ABS_semiflex" : "https://www.lulzbot.com/products/semiflex-tpe-thermoplastic-elastomer-3mm-075kg",
232 'medium-quality': 'Standard',
233 'high-speed': 'High Speed',
234 'high-quality': 'High Detail',
235 'high-clarity': 'High Clarity',
236 'high-strength': 'High Strength'
247 disable_materials = {
248 'PET': ('High', 'Low', 'Normal', 'Ulti'),
249 'PLA': ('High', 'Low', 'Normal', 'Ulti'),
250 'ABS': ('High', 'Low', 'Normal', 'Ulti')
253 def find_files_for_material(files, material):
256 filename = os.path.basename(file)
257 if filename.startswith(material):
258 for p in profile_map.keys():
259 if filename.startswith(material + "_" + p):
261 result.append((file, material, profile))
264 def create_machine_type(machine_type, path, dir):
265 files = glob.glob(os.path.join(path, "*.ini"))
266 path = os.path.join(CURA_QUICKPRINT_DIR, machine_type)
267 for m in material_map.keys():
268 result = find_files_for_material(files, material_map[m])
269 for (file, material, profile) in result:
271 if file is None or material is None or profile is None:
273 filename = os.path.basename(file)
274 profile_file = os.path.join("..", "..", "..", PROFILES_DIR, dir, filename)
275 if not os.path.exists(os.path.join(path, material, profile)):
276 os.makedirs(os.path.join(path, material, profile))
277 with open(os.path.join(path, material, 'material.ini'), 'w') as f:
279 f.write("name = %s\n" % material_names[material])
280 order = material_order[material]
281 if material_types.has_key(material):
282 types = material_types[material]
283 if (material == "HIPS_eSUN" and machine_type.startswith("lulzbot_mini")) or \
284 (material == "ABS_VP" and machine_type.startswith("lulzbot_TAZ")):
285 types = types + "|First Run"
287 f.write("material_types = %s\n" % types)
288 f.write("order = %d\n" % order)
289 if material_url.has_key(material):
290 f.write("url = %s\n" % material_url[material])
291 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
293 f.write("name = %s\n" % profile_map[profile])
294 f.write("order = %d\n" % profile_order[profile])
295 f.write("profile_file = %s\n" % profile_file)
296 for material in disable_materials.keys():
297 if os.path.exists(os.path.join(path, material)):
298 for profile in disable_materials[material]:
299 if not os.path.exists(os.path.join(path, material, profile)):
300 os.makedirs(os.path.join(path, material, profile))
301 with open(os.path.join(path, material, profile, 'profile.ini'), 'w') as f:
303 f.write("disabled = true\n")
305 os.makedirs(os.path.join(path, material))
306 with open(os.path.join(path, material, 'material.ini'), 'w') as f:
308 f.write("disabled = true\n")
312 if not os.path.exists(CURA_QUICKPRINT_DIR):
313 print "Cura path is wrong"
316 dirs = glob.glob(os.path.join(CURA_QUICKPRINT_DIR, PROFILES_DIR, "*"))
319 dir = os.path.basename(d)
320 if dir_map.has_key(dir):
321 for machine_type in dir_map[dir]:
322 create_machine_type(machine_type, d, dir)
327 if __name__ == '__main__':