chiark / gitweb /
Add "Fix horrible" options.
authordaid303 <daid303@gmail.com>
Tue, 28 May 2013 16:31:45 +0000 (18:31 +0200)
committerdaid303 <daid303@gmail.com>
Tue, 28 May 2013 16:31:45 +0000 (18:31 +0200)
Cura/util/profile.py
Cura/util/sliceEngine.py

index 3e238551c000567ce71ee64b8d8e571e7d40ab74..62052ef8ad55f1161ecf6987a9ca828b4dbd0acc 100644 (file)
@@ -172,6 +172,9 @@ setting('raft_base_linewidth', 0.7, float, 'expert', 'Raft').setRange(0).setLabe
 setting('raft_interface_thickness', 0.2, float, 'expert', 'Raft').setRange(0).setLabel('Interface thickness (mm)', 'When you are using the raft this is the thickness of the interface layer which is put down.')
 setting('raft_interface_linewidth', 0.2, float, 'expert', 'Raft').setRange(0).setLabel('Interface line width (mm)', 'When you are using the raft this is the width of the interface layer lines which are put down.')
 #setting('hop_on_move', False, bool, 'expert', 'Hop').setLabel('Enable hop on move', 'When moving from print position to print position, raise the printer head 0.2mm so it does not knock off the print (experimental).')
+setting('fix_horrible_union_all_type_a', False, bool, 'expert', 'Fix horrible').setLabel('Combine everything (Type-A)', 'This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is depended on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer.')
+setting('fix_horrible_union_all_type_b', False, bool, 'expert', 'Fix horrible').setLabel('Combine everything (Type-B)', 'This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is depended on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer.')
+setting('fix_horrible_use_open_bits', False, bool, 'expert', 'Fix horrible').setLabel('Keep open faces', 'This expert option keeps all the open bits of the model intact. Normally Cura tries to stitch up small holes and remove everything with big holes, but this option keeps bits that are not properly part of anything and just goes with whatever it is left. This option is usually not what you want, but it might enable you to slice models otherwise failing to produce proper paths.\nAs with all "Fix horrible" options, results may vary and use at your own risk.')
 
 setting('plugin_config', '', str, 'hidden', 'hidden')
 setting('object_center_x', -1, float, 'hidden', 'hidden')
index fa25bab0a74b2bf3b672415a8b30b003d3ef23b5..9fe0e234bd3f3cc9ef54bb1753f6d70b402bd98b 100644 (file)
@@ -229,6 +229,7 @@ class Slicer(object):
                        'extruderOffset[2].Y': int(profile.getPreferenceFloat('extruder_offset_y2') * 1000),
                        'extruderOffset[3].X': int(profile.getPreferenceFloat('extruder_offset_x3') * 1000),
                        'extruderOffset[3].Y': int(profile.getPreferenceFloat('extruder_offset_y3') * 1000),
+                       'fixHorrible': 0,
                }
                if profile.getProfileSetting('platform_adhesion') == 'Brim':
                        settings['skirtDistance'] = 0
@@ -244,6 +245,14 @@ class Slicer(object):
                else:
                        settings['skirtDistance'] = int(profile.getProfileSettingFloat('skirt_gap') * 1000)
                        settings['skirtLineCount'] = int(profile.getProfileSettingFloat('skirt_line_count'))
+
+               if profile.getProfileSetting('fix_horrible_union_all_type_a') == 'True':
+                       settings['fixHorrible'] |= 0x01
+               if profile.getProfileSetting('fix_horrible_union_all_type_b') == 'True':
+                       settings['fixHorrible'] |= 0x02
+               if profile.getProfileSetting('fix_horrible_use_open_bits') == 'True':
+                       settings['fixHorrible'] |= 0x10
+
                if settings['layerThickness'] <= 0:
                        settings['layerThickness'] = 1000
                return settings