diff --git a/source/Boltfactory.py b/source/Boltfactory.py index 2ff740b..bf7566d 100644 --- a/source/Boltfactory.py +++ b/source/Boltfactory.py @@ -28,6 +28,11 @@ class add_mesh_bolt(Operator, AddObjectHelper): MAX_INPUT_NUMBER = 250 # mm + def update_head_type(self, context): + # Reset bit type when head type is set to None. + if self.bf_Head_Type == 'bf_Head_None': + self.bf_Bit_Type = 'bf_Bit_None' + Bolt: BoolProperty(name="Bolt", default=True, description="Bolt") @@ -45,7 +50,8 @@ class add_mesh_bolt(Operator, AddObjectHelper): items=Model_Type_List, default='bf_Model_Bolt' ) # Head Types - Model_Type_List = [('bf_Head_Hex', 'HEX', 'Hex Head'), + Model_Type_List = [('bf_Head_None', 'NONE', 'No Head'), + ('bf_Head_Hex', 'HEX', 'Hex Head'), ('bf_Head_12Pnt', '12 POINT', '12 Point Head'), ('bf_Head_Cap', 'CAP', 'Cap Head'), ('bf_Head_Dome', 'DOME', 'Dome Head'), @@ -55,7 +61,8 @@ class add_mesh_bolt(Operator, AddObjectHelper): attr='bf_Head_Type', name='Head', description='Choose the type off Head you would like', - items=Model_Type_List, default='bf_Head_Hex' + items=Model_Type_List, default='bf_Head_Hex', + update=update_head_type # Call this function when the head type changes ) # Bit Types Bit_Type_List = [('bf_Bit_None', 'NONE', 'No Bit Type'), @@ -77,46 +84,46 @@ class add_mesh_bolt(Operator, AddObjectHelper): name='Nut Type', description='Choose the type of nut you would like', items=Nut_Type_List, default='bf_Nut_Hex' - ) + ) # type: ignore # Shank Types bf_Shank_Length: FloatProperty( attr='bf_Shank_Length', - name='Shank Length', default=0, - min=0, soft_min=0, max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + name='Shank Length (mm)', default=0, + min=0, soft_min=0, max=MAX_INPUT_NUMBER, description='Length of the unthreaded shank', - unit='LENGTH', - ) + unit='NONE', + ) # type: ignore bf_Shank_Dia: FloatProperty( attr='bf_Shank_Dia', - name='Shank Dia', default=3 * createMesh.GLOBAL_SCALE, + name='Shank Dia (mm)', default=3, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Diameter of the shank', - unit='LENGTH', - ) + unit='NONE', + ) # type: ignore bf_Phillips_Bit_Depth: FloatProperty( attr='bf_Phillips_Bit_Depth', - name='Bit Depth', default=1.1431535482406616 * createMesh.GLOBAL_SCALE, + name='Bit Depth (mm)', default=1.1431535482406616, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Depth of the Phillips Bit', - unit='LENGTH', + unit='NONE', ) bf_Allen_Bit_Depth: FloatProperty( attr='bf_Allen_Bit_Depth', - name='Bit Depth', default=1.5 * createMesh.GLOBAL_SCALE, + name='Bit Depth (mm)', default=1.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Depth of the Allen Bit', - unit='LENGTH', + unit='NONE', ) bf_Allen_Bit_Flat_Distance: FloatProperty( attr='bf_Allen_Bit_Flat_Distance', - name='Flat Dist', default=2.5 * createMesh.GLOBAL_SCALE, + name='Flat Dist (mm)', default=2.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Flat Distance of the Allen Bit', - unit='LENGTH', + unit='NONE', ) # Torx Size Types Torx_Size_Type_List = [('bf_Torx_T10', 'T10', 'T10'), @@ -136,133 +143,133 @@ class add_mesh_bolt(Operator, AddObjectHelper): ) bf_Torx_Bit_Depth: FloatProperty( attr='bf_Torx_Bit_Depth', - name='Bit Depth', default=1.5 * createMesh.GLOBAL_SCALE, + name='Bit Depth (mm)', default=1.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Depth of the Torx Bit', - unit='LENGTH', + unit='NONE', ) bf_Hex_Head_Height: FloatProperty( attr='bf_Hex_Head_Height', - name='Head Height', default=2 * createMesh.GLOBAL_SCALE, - min=0, soft_min=0, max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + name='Head Height (mm)', default=2, + min=0, soft_min=0, max=MAX_INPUT_NUMBER, description='Height of the Hex Head', - unit='LENGTH', + unit='NONE', ) bf_Hex_Head_Flat_Distance: FloatProperty( attr='bf_Hex_Head_Flat_Distance', - name='Flat Dist', default=5.5 * createMesh.GLOBAL_SCALE, + name='Flat Dist (mm)', default=5.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Flat Distance of the Hex Head', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Head_Height: FloatProperty( attr='bf_12_Point_Head_Height', - name='Head Height', default=3.0 * createMesh.GLOBAL_SCALE, - min=0, soft_min=0, max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + name='Head Height (mm)', default=3.0, + min=0, soft_min=0, max=MAX_INPUT_NUMBER, description='Height of the 12 Point Head', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Head_Flat_Distance: FloatProperty( attr='bf_12_Point_Head_Flat_Distance', - name='Flat Dist', default=3.0 * createMesh.GLOBAL_SCALE, - min=0.001 * createMesh.GLOBAL_SCALE, soft_min=0, # limit to 0.001*createMesh.GLOBAL_SCALE to avoid calculation error - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + name='Flat Dist (mm)', default=3.0, + min=0.001, soft_min=0, # limit to 0.001 to avoid calculation error + max=MAX_INPUT_NUMBER, description='Flat Distance of the 12 Point Head', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Head_Flange_Dia: FloatProperty( attr='bf_12_Point_Head_Flange_Dia', - name='12 Point Head Flange Dia', default=5.5 * createMesh.GLOBAL_SCALE, + name='12 Point Head Flange Dia (mm)', default=5.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Flange diameter of the 12 point Head', - unit='LENGTH', + unit='NONE', ) bf_CounterSink_Head_Dia: FloatProperty( attr='bf_CounterSink_Head_Dia', - name='Head Dia', default=6.300000190734863 * createMesh.GLOBAL_SCALE, + name='Head Dia (mm)', default=6.300000190734863, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Diameter of the Counter Sink Head', - unit='LENGTH', + unit='NONE', ) bf_Cap_Head_Height: FloatProperty( attr='bf_Cap_Head_Height', - name='Head Height', default=3 * createMesh.GLOBAL_SCALE, + name='Head Height (mm)', default=3, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Height of the Cap Head', - unit='LENGTH', + unit='NONE', ) bf_Cap_Head_Dia: FloatProperty( attr='bf_Cap_Head_Dia', - name='Head Dia', default=5.5 * createMesh.GLOBAL_SCALE, + name='Head Dia (mm)', default=5.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Diameter of the Cap Head', - unit='LENGTH', + unit='NONE', ) bf_Dome_Head_Dia: FloatProperty( attr='bf_Dome_Head_Dia', - name='Dome Head Dia', default=5.599999904632568 * createMesh.GLOBAL_SCALE, + name='Dome Head Dia (mm)', default=5.599999904632568, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Length of the unthreaded shank', - unit='LENGTH', + unit='NONE', ) bf_Pan_Head_Dia: FloatProperty( attr='bf_Pan_Head_Dia', - name='Pan Head Dia', default=5.599999904632568 * createMesh.GLOBAL_SCALE, + name='Pan Head Dia (mm)', default=5.599999904632568, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Diameter of the Pan Head', - unit='LENGTH', + unit='NONE', ) bf_Philips_Bit_Dia: FloatProperty( attr='bf_Philips_Bit_Dia', - name='Bit Dia', default=1.8199999332427979 * createMesh.GLOBAL_SCALE, + name='Bit Dia (mm)', default=1.8199999332427979, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Diameter of the Philips Bit', - unit='LENGTH', + unit='NONE', ) bf_Thread_Length: FloatProperty( attr='bf_Thread_Length', - name='Thread Length', default=6 * createMesh.GLOBAL_SCALE, + name='Thread Length (mm)', default=6, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Length of the Thread', - unit='LENGTH', + unit='NONE', ) bf_Major_Dia: FloatProperty( attr='bf_Major_Dia', - name='Major Dia', default=3 * createMesh.GLOBAL_SCALE, + name='Major Dia (mm)', default=3, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Outside diameter of the Thread', - unit='LENGTH', + unit='NONE', ) bf_Pitch: FloatProperty( attr='bf_Pitch', - name='Pitch', default=0.3499999940395355 * createMesh.GLOBAL_SCALE, - min=0.1 * createMesh.GLOBAL_SCALE, soft_min=0.1 * createMesh.GLOBAL_SCALE, - max=7.0 * createMesh.GLOBAL_SCALE, + name='Pitch (mm)', default=0.3499999940395355, + min=0.1, soft_min=0.1, + max=7.0, description='Pitch if the thread', - unit='LENGTH', + unit='NONE', ) bf_Minor_Dia: FloatProperty( attr='bf_Minor_Dia', - name='Minor Dia', default=2.6211137771606445 * createMesh.GLOBAL_SCALE, + name='Minor Dia (mm)', default=2.6211137771606445, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Inside diameter of the Thread', - unit='LENGTH', + unit='NONE', ) bf_Crest_Percent: FloatProperty( attr='bf_Crest_Percent', @@ -287,44 +294,44 @@ class add_mesh_bolt(Operator, AddObjectHelper): ) bf_Hex_Nut_Height: FloatProperty( attr='bf_Hex_Nut_Height', - name='Hex Nut Height', default=2.4000000953674316 * createMesh.GLOBAL_SCALE, + name='Hex Nut Height (mm)', default=2.4000000953674316, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Height of the Hex Nut', - unit='LENGTH', + unit='NONE', ) bf_Hex_Nut_Flat_Distance: FloatProperty( attr='bf_Hex_Nut_Flat_Distance', - name='Hex Nut Flat Dist', default=5.5 * createMesh.GLOBAL_SCALE, + name='Hex Nut Flat Dist (mm)', default=5.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Flat distance of the Hex Nut', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Nut_Height: FloatProperty( attr='bf_12_Point_Nut_Height', - name='12 Point Nut Height', default=2.4000000953674316 * createMesh.GLOBAL_SCALE, + name='12 Point Nut Height (mm)', default=2.4000000953674316, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Height of the 12 Point Nut', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Nut_Flat_Distance: FloatProperty( attr='bf_12_Point_Nut_Flat_Distance', - name='12 Point Nut Flat Dist', default=3.0 * createMesh.GLOBAL_SCALE, - min=0.001 * createMesh.GLOBAL_SCALE, soft_min=0, # limit to 0.001 to avoid calculation error - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + name='12 Point Nut Flat Dist (mm)', default=3.0, + min=0.001, soft_min=0, # limit to 0.001 to avoid calculation error + max=MAX_INPUT_NUMBER, description='Flat distance of the 12 point Nut', - unit='LENGTH', + unit='NONE', ) bf_12_Point_Nut_Flange_Dia: FloatProperty( attr='bf_12_Point_Nut_Flange_Dia', - name='12 Point Nut Flange Dia', default=5.5 * createMesh.GLOBAL_SCALE, + name='12 Point Nut Flange Dia (mm)', default=5.5, min=0, soft_min=0, - max=MAX_INPUT_NUMBER * createMesh.GLOBAL_SCALE, + max=MAX_INPUT_NUMBER, description='Flange diameter of the 12 point Nut', - unit='LENGTH', + unit='NONE', ) def draw(self, context): @@ -337,7 +344,10 @@ class add_mesh_bolt(Operator, AddObjectHelper): # Bit if self.bf_Model_Type == 'bf_Model_Bolt': - col.prop(self, 'bf_Bit_Type') + if self.bf_Head_Type == 'bf_Head_None': + col.label(text="No bit type availabe when Head is None.") + else: + col.prop(self, 'bf_Bit_Type') if self.bf_Bit_Type == 'bf_Bit_None': pass elif self.bf_Bit_Type == 'bf_Bit_Allen': @@ -353,7 +363,9 @@ class add_mesh_bolt(Operator, AddObjectHelper): # Head if self.bf_Model_Type == 'bf_Model_Bolt': col.prop(self, 'bf_Head_Type') - if self.bf_Head_Type == 'bf_Head_Hex': + if self.bf_Head_Type == 'bf_Head_None': + pass + elif self.bf_Head_Type == 'bf_Head_Hex': col.prop(self, 'bf_Hex_Head_Height') col.prop(self, 'bf_Hex_Head_Flat_Distance') elif self.bf_Head_Type == 'bf_Head_12Pnt': @@ -411,6 +423,12 @@ class add_mesh_bolt(Operator, AddObjectHelper): def execute(self, context): + # This formula ensures that bolts (or other objects) are generated at their default sizes + # regardless of the unit scale setting in the scene. It normalizes the scale to maintain + # consistent dimensions across various unit configurations. + scene = context.scene + adjusted_scale = 0.001 / scene.unit_settings.scale_length + if bpy.context.mode == "OBJECT": if context.selected_objects != [] and context.active_object and \ (context.active_object.data is not None) and ('Bolt' in context.active_object.data.keys()) and \ @@ -418,7 +436,7 @@ class add_mesh_bolt(Operator, AddObjectHelper): obj = context.active_object use_smooth = bool(obj.data.polygons[0].use_smooth) # Copy value, do not take a reference - mesh = createMesh.Create_New_Mesh(self, context) + mesh = createMesh.Create_New_Mesh(self, context, adjusted_scale) # Modify existing mesh data object by replacing geometry (but leaving materials etc) bm = bmesh.new() @@ -440,7 +458,7 @@ class add_mesh_bolt(Operator, AddObjectHelper): pass else: - mesh = createMesh.Create_New_Mesh(self, context) + mesh = createMesh.Create_New_Mesh(self, context, adjusted_scale) obj = object_utils.object_data_add(context, mesh, operator=self) obj.data["Bolt"] = True @@ -450,7 +468,7 @@ class add_mesh_bolt(Operator, AddObjectHelper): if bpy.context.mode == "EDIT_MESH": obj = context.edit_object - mesh = createMesh.Create_New_Mesh(self, context) + mesh = createMesh.Create_New_Mesh(self, context, adjusted_scale) bm = bmesh.from_edit_mesh(obj.data) # Access edit mode's mesh data bm.from_mesh(mesh) # Append new mesh data diff --git a/source/createMesh.py b/source/createMesh.py index 8d0fa5c..1ea3919 100644 --- a/source/createMesh.py +++ b/source/createMesh.py @@ -18,9 +18,6 @@ from bpy_extras.object_utils import AddObjectHelper, object_data_add NARROW_UI = 180 MAX_INPUT_NUMBER = 50 -GLOBAL_SCALE = 0.001 # GLOBAL_SCALE blender unit = 1 mm - - # next two utility functions are stolen from import_obj.py def unpack_list(list_of_tuples): @@ -2276,13 +2273,13 @@ def Nut_Mesh(props, context): Face_Start = len(verts) if props.bf_Nut_Type == 'bf_Nut_12Pnt': - Nut_Height = props.bf_12_Point_Nut_Height / GLOBAL_SCALE + Nut_Height = props.bf_12_Point_Nut_Height else: - Nut_Height = props.bf_Hex_Nut_Height / GLOBAL_SCALE + Nut_Height = props.bf_Hex_Nut_Height Thread_Verts, Thread_Faces, New_Nut_Height = Create_Internal_Thread( - props.bf_Minor_Dia / GLOBAL_SCALE, props.bf_Major_Dia / GLOBAL_SCALE, - props.bf_Pitch / GLOBAL_SCALE, Nut_Height, + props.bf_Minor_Dia, props.bf_Major_Dia, + props.bf_Pitch, Nut_Height, props.bf_Crest_Percent, props.bf_Root_Percent, 1, props.bf_Div_Count ) @@ -2293,15 +2290,15 @@ def Nut_Mesh(props, context): if props.bf_Nut_Type == 'bf_Nut_12Pnt': Head_Verts, Head_Faces, Lock_Nut_Rad = add_12_Point_Nut( - props.bf_12_Point_Nut_Flat_Distance / GLOBAL_SCALE, - props.bf_Major_Dia / GLOBAL_SCALE, New_Nut_Height, + props.bf_12_Point_Nut_Flat_Distance, + props.bf_Major_Dia, New_Nut_Height, # Limit the size of the Flange to avoid calculation error - max(props.bf_12_Point_Nut_Flange_Dia / GLOBAL_SCALE, props.bf_12_Point_Nut_Flat_Distance / GLOBAL_SCALE) + max(props.bf_12_Point_Nut_Flange_Dia, props.bf_12_Point_Nut_Flat_Distance) ) else: Head_Verts, Head_Faces, Lock_Nut_Rad = add_Hex_Nut( - props.bf_Hex_Nut_Flat_Distance / GLOBAL_SCALE, - props.bf_Major_Dia / GLOBAL_SCALE, New_Nut_Height + props.bf_Hex_Nut_Flat_Distance, + props.bf_Major_Dia, New_Nut_Height ) verts.extend((Head_Verts)) faces.extend(Copy_Faces(Head_Faces, Face_Start)) @@ -2343,19 +2340,17 @@ def Bolt_Mesh(props, context): Head_Faces = [] Head_Height = 0.0 - ReSized_Allen_Bit_Flat_Distance = props.bf_Allen_Bit_Flat_Distance / GLOBAL_SCALE # set default + ReSized_Allen_Bit_Flat_Distance = props.bf_Allen_Bit_Flat_Distance # set default - Head_Height = props.bf_Hex_Head_Height / GLOBAL_SCALE # will be changed by the Head Functions + Head_Height = props.bf_Hex_Head_Height # will be changed by the Head Functions if props.bf_Bit_Type == 'bf_Bit_Allen' and props.bf_Head_Type == 'bf_Head_Pan': # need to size Allen bit if it is too big. if Allen_Bit_Dia( - props.bf_Allen_Bit_Flat_Distance / - GLOBAL_SCALE) > Max_Pan_Bit_Dia( - props.bf_Pan_Head_Dia / - GLOBAL_SCALE): + props.bf_Allen_Bit_Flat_Distance) > Max_Pan_Bit_Dia( + props.bf_Pan_Head_Dia): ReSized_Allen_Bit_Flat_Distance = Allen_Bit_Dia_To_Flat( - Max_Pan_Bit_Dia(props.bf_Pan_Head_Dia / GLOBAL_SCALE) + Max_Pan_Bit_Dia(props.bf_Pan_Head_Dia) ) ReSized_Allen_Bit_Flat_Distance -= ReSized_Allen_Bit_Flat_Distance * 0.05 # It looks better if it is just a bit smaller # print ("Resized Allen Bit Flat Distance to ",ReSized_Allen_Bit_Flat_Distance) @@ -2364,62 +2359,62 @@ def Bolt_Mesh(props, context): if props.bf_Bit_Type == 'bf_Bit_Allen': Bit_Verts, Bit_Faces, Bit_Dia = Create_Allen_Bit( ReSized_Allen_Bit_Flat_Distance, - props.bf_Allen_Bit_Depth / GLOBAL_SCALE + props.bf_Allen_Bit_Depth ) if props.bf_Bit_Type == 'bf_Bit_Torx': Bit_Verts, Bit_Faces, Bit_Dia = Create_Torx_Bit( Torx_Bit_Size_To_Point_Distance(props.bf_Torx_Size_Type), - props.bf_Torx_Bit_Depth / GLOBAL_SCALE + props.bf_Torx_Bit_Depth ) if props.bf_Bit_Type == 'bf_Bit_Philips': Bit_Verts, Bit_Faces, Bit_Dia = Create_Phillips_Bit( - props.bf_Philips_Bit_Dia / GLOBAL_SCALE, - props.bf_Philips_Bit_Dia / GLOBAL_SCALE * (0.5 / 1.82), - props.bf_Phillips_Bit_Depth / GLOBAL_SCALE + props.bf_Philips_Bit_Dia, + props.bf_Philips_Bit_Dia * (0.5 / 1.82), + props.bf_Phillips_Bit_Depth ) # Head Mesh if props.bf_Head_Type == 'bf_Head_Hex': Head_Verts, Head_Faces, Head_Height = Create_Hex_Head( - props.bf_Hex_Head_Flat_Distance / GLOBAL_SCALE, Bit_Dia, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_Hex_Head_Height / GLOBAL_SCALE + props.bf_Hex_Head_Flat_Distance, Bit_Dia, + props.bf_Shank_Dia, props.bf_Hex_Head_Height ) elif props.bf_Head_Type == 'bf_Head_12Pnt': Head_Verts, Head_Faces, Head_Height = Create_12_Point_Head( - props.bf_12_Point_Head_Flat_Distance / GLOBAL_SCALE, Bit_Dia, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_12_Point_Head_Height / GLOBAL_SCALE, + props.bf_12_Point_Head_Flat_Distance, Bit_Dia, + props.bf_Shank_Dia, props.bf_12_Point_Head_Height, # Limit the size of the Flange to avoid calculation error - max(props.bf_12_Point_Head_Flange_Dia / GLOBAL_SCALE, props.bf_12_Point_Head_Flat_Distance / GLOBAL_SCALE) + max(props.bf_12_Point_Head_Flange_Dia, props.bf_12_Point_Head_Flat_Distance) ) elif props.bf_Head_Type == 'bf_Head_Cap': Head_Verts, Head_Faces, Head_Height = Create_Cap_Head( - Bit_Dia, props.bf_Cap_Head_Dia / GLOBAL_SCALE, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_Cap_Head_Height / GLOBAL_SCALE, - props.bf_Cap_Head_Dia / GLOBAL_SCALE * (1.0 / 19.0), - props.bf_Cap_Head_Dia / GLOBAL_SCALE * (1.0 / 19.0), + Bit_Dia, props.bf_Cap_Head_Dia, + props.bf_Shank_Dia, props.bf_Cap_Head_Height, + props.bf_Cap_Head_Dia * (1.0 / 19.0), + props.bf_Cap_Head_Dia * (1.0 / 19.0), props.bf_Div_Count ) elif props.bf_Head_Type == 'bf_Head_Dome': Head_Verts, Head_Faces, Head_Height = Create_Dome_Head( - Bit_Dia, props.bf_Dome_Head_Dia / GLOBAL_SCALE, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_Hex_Head_Height / GLOBAL_SCALE, + Bit_Dia, props.bf_Dome_Head_Dia, + props.bf_Shank_Dia, props.bf_Hex_Head_Height, 1, 1, 0, props.bf_Div_Count ) elif props.bf_Head_Type == 'bf_Head_Pan': Head_Verts, Head_Faces, Head_Height = Create_Pan_Head( - Bit_Dia, props.bf_Pan_Head_Dia / GLOBAL_SCALE, - props.bf_Shank_Dia / GLOBAL_SCALE, - props.bf_Hex_Head_Height / GLOBAL_SCALE, 1, 1, 0, + Bit_Dia, props.bf_Pan_Head_Dia, + props.bf_Shank_Dia, + props.bf_Hex_Head_Height, 1, 1, 0, props.bf_Div_Count ) elif props.bf_Head_Type == 'bf_Head_CounterSink': Head_Verts, Head_Faces, Head_Height = Create_CounterSink_Head( - Bit_Dia, props.bf_CounterSink_Head_Dia / GLOBAL_SCALE, - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_CounterSink_Head_Dia / GLOBAL_SCALE, - props.bf_CounterSink_Head_Dia / GLOBAL_SCALE * (0.09 / 6.31), + Bit_Dia, props.bf_CounterSink_Head_Dia, + props.bf_Shank_Dia, props.bf_CounterSink_Head_Dia, + props.bf_CounterSink_Head_Dia * (0.09 / 6.31), props.bf_Div_Count ) @@ -2433,9 +2428,9 @@ def Bolt_Mesh(props, context): Face_Start = len(verts) Thread_Verts, Thread_Faces, Thread_Height = Create_External_Thread( - props.bf_Shank_Dia / GLOBAL_SCALE, props.bf_Shank_Length / GLOBAL_SCALE, - props.bf_Minor_Dia / GLOBAL_SCALE, props.bf_Major_Dia / GLOBAL_SCALE, - props.bf_Pitch / GLOBAL_SCALE, props.bf_Thread_Length / GLOBAL_SCALE, + props.bf_Shank_Dia, props.bf_Shank_Length, + props.bf_Minor_Dia, props.bf_Major_Dia, + props.bf_Pitch, props.bf_Thread_Length, props.bf_Crest_Percent, props.bf_Root_Percent, props.bf_Div_Count ) @@ -2446,7 +2441,8 @@ def Bolt_Mesh(props, context): return Move_Verts_Up_Z(verts, Thread_Height), faces -def Create_New_Mesh(props, context): + +def Create_New_Mesh(props, context, adjusted_scale): verts = [] faces = [] @@ -2465,7 +2461,7 @@ def Create_New_Mesh(props, context): verts, faces = RemoveDoubles(verts, faces) - verts = Scale_Mesh_Verts(verts, GLOBAL_SCALE) + verts = Scale_Mesh_Verts(verts, adjusted_scale) mesh = bpy.data.meshes.new(name=sObjName) mesh.from_pydata(verts, edges, faces) diff --git a/source/presets/operator/mesh.bolt_add/_default.py b/source/presets/operator/mesh.bolt_add/_default.py index f0f29de..b9db29f 100644 --- a/source/presets/operator/mesh.bolt_add/_default.py +++ b/source/presets/operator/mesh.bolt_add/_default.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 3.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 1.1431535482406616 / 1000.0 -op.bf_Allen_Bit_Depth = 1.5 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 2.5 / 1000.0 -op.bf_Torx_Bit_Depth = 1.5 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 3.0 +op.bf_Phillips_Bit_Depth = 1.1431535482406616 +op.bf_Allen_Bit_Depth = 1.5 +op.bf_Allen_Bit_Flat_Distance = 2.5 +op.bf_Torx_Bit_Depth = 1.5 op.bf_Torx_Size_Type = 'bf_Torx_T10' -op.bf_Hex_Head_Height = 2.0 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 5.5 / 1000.0 -op.bf_12_Point_Head_Height = 3.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 3.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 5.72 / 1000.0 -op.bf_CounterSink_Head_Dia = 6.300000190734863 / 1000.0 -op.bf_Cap_Head_Height = 3.0 / 1000.0 -op.bf_Cap_Head_Dia = 5.5 / 1000.0 -op.bf_Dome_Head_Dia = 5.599999904632568 / 1000.0 -op.bf_Pan_Head_Dia = 5.599999904632568 / 1000.0 -op.bf_Philips_Bit_Dia = 1.8199999332427979 / 1000.0 -op.bf_Thread_Length = 6.0 / 1000.0 -op.bf_Major_Dia = 3.0 / 1000.0 -op.bf_Pitch = 0.3499999940395355 / 1000.0 -op.bf_Minor_Dia = 2.6211137771606445 / 1000.0 +op.bf_Hex_Head_Height = 2.0 +op.bf_Hex_Head_Flat_Distance = 5.5 +op.bf_12_Point_Head_Height = 3.0 +op.bf_12_Point_Head_Flat_Distance = 3.0 +op.bf_12_Point_Head_Flange_Dia = 5.72 +op.bf_CounterSink_Head_Dia = 6.300000190734863 +op.bf_Cap_Head_Height = 3.0 +op.bf_Cap_Head_Dia = 5.5 +op.bf_Dome_Head_Dia = 5.599999904632568 +op.bf_Pan_Head_Dia = 5.599999904632568 +op.bf_Philips_Bit_Dia = 1.8199999332427979 +op.bf_Thread_Length = 6.0 +op.bf_Major_Dia = 3.0 +op.bf_Pitch = 0.3499999940395355 +op.bf_Minor_Dia = 2.6211137771606445 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 2.4000000953674316 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 5.5 / 1000.0 -op.bf_12_Point_Nut_Height = 3.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 3.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 5.72 / 1000.0 +op.bf_Hex_Nut_Height = 2.4000000953674316 +op.bf_Hex_Nut_Flat_Distance = 5.5 +op.bf_12_Point_Nut_Height = 3.0 +op.bf_12_Point_Nut_Flat_Distance = 3.0 +op.bf_12_Point_Nut_Flange_Dia = 5.72 diff --git a/source/presets/operator/mesh.bolt_add/_m3.py b/source/presets/operator/mesh.bolt_add/_m3.py index f0f29de..b9db29f 100644 --- a/source/presets/operator/mesh.bolt_add/_m3.py +++ b/source/presets/operator/mesh.bolt_add/_m3.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 3.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 1.1431535482406616 / 1000.0 -op.bf_Allen_Bit_Depth = 1.5 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 2.5 / 1000.0 -op.bf_Torx_Bit_Depth = 1.5 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 3.0 +op.bf_Phillips_Bit_Depth = 1.1431535482406616 +op.bf_Allen_Bit_Depth = 1.5 +op.bf_Allen_Bit_Flat_Distance = 2.5 +op.bf_Torx_Bit_Depth = 1.5 op.bf_Torx_Size_Type = 'bf_Torx_T10' -op.bf_Hex_Head_Height = 2.0 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 5.5 / 1000.0 -op.bf_12_Point_Head_Height = 3.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 3.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 5.72 / 1000.0 -op.bf_CounterSink_Head_Dia = 6.300000190734863 / 1000.0 -op.bf_Cap_Head_Height = 3.0 / 1000.0 -op.bf_Cap_Head_Dia = 5.5 / 1000.0 -op.bf_Dome_Head_Dia = 5.599999904632568 / 1000.0 -op.bf_Pan_Head_Dia = 5.599999904632568 / 1000.0 -op.bf_Philips_Bit_Dia = 1.8199999332427979 / 1000.0 -op.bf_Thread_Length = 6.0 / 1000.0 -op.bf_Major_Dia = 3.0 / 1000.0 -op.bf_Pitch = 0.3499999940395355 / 1000.0 -op.bf_Minor_Dia = 2.6211137771606445 / 1000.0 +op.bf_Hex_Head_Height = 2.0 +op.bf_Hex_Head_Flat_Distance = 5.5 +op.bf_12_Point_Head_Height = 3.0 +op.bf_12_Point_Head_Flat_Distance = 3.0 +op.bf_12_Point_Head_Flange_Dia = 5.72 +op.bf_CounterSink_Head_Dia = 6.300000190734863 +op.bf_Cap_Head_Height = 3.0 +op.bf_Cap_Head_Dia = 5.5 +op.bf_Dome_Head_Dia = 5.599999904632568 +op.bf_Pan_Head_Dia = 5.599999904632568 +op.bf_Philips_Bit_Dia = 1.8199999332427979 +op.bf_Thread_Length = 6.0 +op.bf_Major_Dia = 3.0 +op.bf_Pitch = 0.3499999940395355 +op.bf_Minor_Dia = 2.6211137771606445 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 2.4000000953674316 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 5.5 / 1000.0 -op.bf_12_Point_Nut_Height = 3.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 3.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 5.72 / 1000.0 +op.bf_Hex_Nut_Height = 2.4000000953674316 +op.bf_Hex_Nut_Flat_Distance = 5.5 +op.bf_12_Point_Nut_Height = 3.0 +op.bf_12_Point_Nut_Flat_Distance = 3.0 +op.bf_12_Point_Nut_Flange_Dia = 5.72 diff --git a/source/presets/operator/mesh.bolt_add/_m4.py b/source/presets/operator/mesh.bolt_add/_m4.py index 8513f9f..9c757c4 100644 --- a/source/presets/operator/mesh.bolt_add/_m4.py +++ b/source/presets/operator/mesh.bolt_add/_m4.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 4.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 1.6330764293670654 / 1000.0 -op.bf_Allen_Bit_Depth = 2.0 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 3.0 / 1000.0 -op.bf_Torx_Bit_Depth = 2.0 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 4.0 +op.bf_Phillips_Bit_Depth = 1.6330764293670654 +op.bf_Allen_Bit_Depth = 2.0 +op.bf_Allen_Bit_Flat_Distance = 3.0 +op.bf_Torx_Bit_Depth = 2.0 op.bf_Torx_Size_Type = 'bf_Torx_T20' -op.bf_Hex_Head_Height = 2.799999952316284 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 7.0 / 1000.0 -op.bf_12_Point_Head_Height = 4.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 4.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 7.22 / 1000.0 -op.bf_CounterSink_Head_Dia = 9.399999618530273 / 1000.0 -op.bf_Cap_Head_Height = 4.0 / 1000.0 -op.bf_Cap_Head_Dia = 7.0 / 1000.0 -op.bf_Dome_Head_Dia = 8.0 / 1000.0 -op.bf_Pan_Head_Dia = 8.0 / 1000.0 -op.bf_Philips_Bit_Dia = 2.5999999046325684 / 1000.0 -op.bf_Thread_Length = 8.0 / 1000.0 -op.bf_Major_Dia = 4.0 / 1000.0 -op.bf_Pitch = 0.5 / 1000.0 -op.bf_Minor_Dia = 3.4587340354919434 / 1000.0 +op.bf_Hex_Head_Height = 2.799999952316284 +op.bf_Hex_Head_Flat_Distance = 7.0 +op.bf_12_Point_Head_Height = 4.0 +op.bf_12_Point_Head_Flat_Distance = 4.0 +op.bf_12_Point_Head_Flange_Dia = 7.22 +op.bf_CounterSink_Head_Dia = 9.399999618530273 +op.bf_Cap_Head_Height = 4.0 +op.bf_Cap_Head_Dia = 7.0 +op.bf_Dome_Head_Dia = 8.0 +op.bf_Pan_Head_Dia = 8.0 +op.bf_Philips_Bit_Dia = 2.5999999046325684 +op.bf_Thread_Length = 8.0 +op.bf_Major_Dia = 4.0 +op.bf_Pitch = 0.5 +op.bf_Minor_Dia = 3.4587340354919434 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 3.200000047683716 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 7.0 / 1000.0 -op.bf_12_Point_Nut_Height = 4.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 4.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 7.22 / 1000.0 +op.bf_Hex_Nut_Height = 3.200000047683716 +op.bf_Hex_Nut_Flat_Distance = 7.0 +op.bf_12_Point_Nut_Height = 4.0 +op.bf_12_Point_Nut_Flat_Distance = 4.0 +op.bf_12_Point_Nut_Flange_Dia = 7.22 diff --git a/source/presets/operator/mesh.bolt_add/_m5.py b/source/presets/operator/mesh.bolt_add/_m5.py index 1a43a52..ddb09fc 100644 --- a/source/presets/operator/mesh.bolt_add/_m5.py +++ b/source/presets/operator/mesh.bolt_add/_m5.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 5.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 1.9392783641815186 / 1000.0 -op.bf_Allen_Bit_Depth = 2.5 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 4.0 / 1000.0 -op.bf_Torx_Bit_Depth = 2.5 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 5.0 +op.bf_Phillips_Bit_Depth = 1.9392783641815186 +op.bf_Allen_Bit_Depth = 2.5 +op.bf_Allen_Bit_Flat_Distance = 4.0 +op.bf_Torx_Bit_Depth = 2.5 op.bf_Torx_Size_Type = 'bf_Torx_T25' -op.bf_Hex_Head_Height = 3.5 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 8.0 / 1000.0 -op.bf_12_Point_Head_Height = 5.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 5.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 8.72 / 1000.0 -op.bf_CounterSink_Head_Dia = 10.399999618530273 / 1000.0 -op.bf_Cap_Head_Height = 5.0 / 1000.0 -op.bf_Cap_Head_Dia = 8.5 / 1000.0 -op.bf_Dome_Head_Dia = 9.5 / 1000.0 -op.bf_Pan_Head_Dia = 9.5 / 1000.0 -op.bf_Philips_Bit_Dia = 3.0875000953674316 / 1000.0 -op.bf_Thread_Length = 10.0 / 1000.0 -op.bf_Major_Dia = 5.0 / 1000.0 -op.bf_Pitch = 0.5 / 1000.0 -op.bf_Minor_Dia = 4.458734035491943 / 1000.0 +op.bf_Hex_Head_Height = 3.5 +op.bf_Hex_Head_Flat_Distance = 8.0 +op.bf_12_Point_Head_Height = 5.0 +op.bf_12_Point_Head_Flat_Distance = 5.0 +op.bf_12_Point_Head_Flange_Dia = 8.72 +op.bf_CounterSink_Head_Dia = 10.399999618530273 +op.bf_Cap_Head_Height = 5.0 +op.bf_Cap_Head_Dia = 8.5 +op.bf_Dome_Head_Dia = 9.5 +op.bf_Pan_Head_Dia = 9.5 +op.bf_Philips_Bit_Dia = 3.0875000953674316 +op.bf_Thread_Length = 10.0 +op.bf_Major_Dia = 5.0 +op.bf_Pitch = 0.5 +op.bf_Minor_Dia = 4.458734035491943 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 4.0 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 8.0 / 1000.0 -op.bf_12_Point_Nut_Height = 5.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 5.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 8.72 / 1000.0 +op.bf_Hex_Nut_Height = 4.0 +op.bf_Hex_Nut_Flat_Distance = 8.0 +op.bf_12_Point_Nut_Height = 5.0 +op.bf_12_Point_Nut_Flat_Distance = 5.0 +op.bf_12_Point_Nut_Flange_Dia = 8.72 diff --git a/source/presets/operator/mesh.bolt_add/_m6.py b/source/presets/operator/mesh.bolt_add/_m6.py index 33d82d7..aeed7bf 100644 --- a/source/presets/operator/mesh.bolt_add/_m6.py +++ b/source/presets/operator/mesh.bolt_add/_m6.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 6.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 2.4496147632598877 / 1000.0 -op.bf_Allen_Bit_Depth = 3.0 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 5.0 / 1000.0 -op.bf_Torx_Bit_Depth = 3.0 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 6.0 +op.bf_Phillips_Bit_Depth = 2.4496147632598877 +op.bf_Allen_Bit_Depth = 3.0 +op.bf_Allen_Bit_Flat_Distance = 5.0 +op.bf_Torx_Bit_Depth = 3.0 op.bf_Torx_Size_Type = 'bf_Torx_T30' -op.bf_Hex_Head_Height = 4.0 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 10.0 / 1000.0 -op.bf_12_Point_Head_Height = 6.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 6.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 10.22 / 1000.0 -op.bf_CounterSink_Head_Dia = 12.600000381469727 / 1000.0 -op.bf_Cap_Head_Height = 6.0 / 1000.0 -op.bf_Cap_Head_Dia = 10.0 / 1000.0 -op.bf_Dome_Head_Dia = 12.0 / 1000.0 -op.bf_Pan_Head_Dia = 12.0 / 1000.0 -op.bf_Philips_Bit_Dia = 3.9000000953674316 / 1000.0 -op.bf_Thread_Length = 12.0 / 1000.0 -op.bf_Major_Dia = 6.0 / 1000.0 -op.bf_Pitch = 0.75 / 1000.0 -op.bf_Minor_Dia = 5.188100814819336 / 1000.0 +op.bf_Hex_Head_Height = 4.0 +op.bf_Hex_Head_Flat_Distance = 10.0 +op.bf_12_Point_Head_Height = 6.0 +op.bf_12_Point_Head_Flat_Distance = 6.0 +op.bf_12_Point_Head_Flange_Dia = 10.22 +op.bf_CounterSink_Head_Dia = 12.600000381469727 +op.bf_Cap_Head_Height = 6.0 +op.bf_Cap_Head_Dia = 10.0 +op.bf_Dome_Head_Dia = 12.0 +op.bf_Pan_Head_Dia = 12.0 +op.bf_Philips_Bit_Dia = 3.9000000953674316 +op.bf_Thread_Length = 12.0 +op.bf_Major_Dia = 6.0 +op.bf_Pitch = 0.75 +op.bf_Minor_Dia = 5.188100814819336 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 5.0 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 10.0 / 1000.0 -op.bf_12_Point_Nut_Height = 6.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 6.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 10.22 / 1000.0 +op.bf_Hex_Nut_Height = 5.0 +op.bf_Hex_Nut_Flat_Distance = 10.0 +op.bf_12_Point_Nut_Height = 6.0 +op.bf_12_Point_Nut_Flat_Distance = 6.0 +op.bf_12_Point_Nut_Flange_Dia = 10.22 diff --git a/source/presets/operator/mesh.bolt_add/_m8.py b/source/presets/operator/mesh.bolt_add/_m8.py index 8f7bb49..1386068 100644 --- a/source/presets/operator/mesh.bolt_add/_m8.py +++ b/source/presets/operator/mesh.bolt_add/_m8.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 8.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 3.266152858734131 / 1000.0 -op.bf_Allen_Bit_Depth = 4.0 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 6.0 / 1000.0 -op.bf_Torx_Bit_Depth = 4.0 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 8.0 +op.bf_Phillips_Bit_Depth = 3.266152858734131 +op.bf_Allen_Bit_Depth = 4.0 +op.bf_Allen_Bit_Flat_Distance = 6.0 +op.bf_Torx_Bit_Depth = 4.0 op.bf_Torx_Size_Type = 'bf_Torx_T40' -op.bf_Hex_Head_Height = 5.300000190734863 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 13.0 / 1000.0 -op.bf_12_Point_Head_Height = 8.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 8.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 13.27 / 1000.0 -op.bf_CounterSink_Head_Dia = 17.299999237060547 / 1000.0 -op.bf_Cap_Head_Height = 8.0 / 1000.0 -op.bf_Cap_Head_Dia = 13.5 / 1000.0 -op.bf_Dome_Head_Dia = 16.0 / 1000.0 -op.bf_Pan_Head_Dia = 16.0 / 1000.0 -op.bf_Philips_Bit_Dia = 5.199999809265137 / 1000.0 -op.bf_Thread_Length = 16.0 / 1000.0 -op.bf_Major_Dia = 8.0 / 1000.0 -op.bf_Pitch = 1.0 / 1000.0 -op.bf_Minor_Dia = 6.917468070983887 / 1000.0 +op.bf_Hex_Head_Height = 5.300000190734863 +op.bf_Hex_Head_Flat_Distance = 13.0 +op.bf_12_Point_Head_Height = 8.0 +op.bf_12_Point_Head_Flat_Distance = 8.0 +op.bf_12_Point_Head_Flange_Dia = 13.27 +op.bf_CounterSink_Head_Dia = 17.299999237060547 +op.bf_Cap_Head_Height = 8.0 +op.bf_Cap_Head_Dia = 13.5 +op.bf_Dome_Head_Dia = 16.0 +op.bf_Pan_Head_Dia = 16.0 +op.bf_Philips_Bit_Dia = 5.199999809265137 +op.bf_Thread_Length = 16.0 +op.bf_Major_Dia = 8.0 +op.bf_Pitch = 1.0 +op.bf_Minor_Dia = 6.917468070983887 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 6.5 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 13.0 / 1000.0 -op.bf_12_Point_Nut_Height = 8.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 8.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 13.27 / 1000.0 +op.bf_Hex_Nut_Height = 6.5 +op.bf_Hex_Nut_Flat_Distance = 13.0 +op.bf_12_Point_Nut_Height = 8.0 +op.bf_12_Point_Nut_Flat_Distance = 8.0 +op.bf_12_Point_Nut_Flange_Dia = 13.27 diff --git a/source/presets/operator/mesh.bolt_add/m10.py b/source/presets/operator/mesh.bolt_add/m10.py index faf892a..7efe6ec 100644 --- a/source/presets/operator/mesh.bolt_add/m10.py +++ b/source/presets/operator/mesh.bolt_add/m10.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 0.0 / 1000.0 -op.bf_Shank_Dia = 10.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 4.082691192626953 / 1000.0 -op.bf_Allen_Bit_Depth = 5.0 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 8.0 / 1000.0 -op.bf_Torx_Bit_Depth = 5.0 / 1000.0 +op.bf_Shank_Length = 0.0 +op.bf_Shank_Dia = 10.0 +op.bf_Phillips_Bit_Depth = 4.082691192626953 +op.bf_Allen_Bit_Depth = 5.0 +op.bf_Allen_Bit_Flat_Distance = 8.0 +op.bf_Torx_Bit_Depth = 5.0 op.bf_Torx_Size_Type = 'bf_Torx_T50' -op.bf_Hex_Head_Height = 6.400000095367432 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 17.0 / 1000.0 -op.bf_12_Point_Head_Height = 10.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 10.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 16.27 / 1000.0 -op.bf_CounterSink_Head_Dia = 20.0 / 1000.0 -op.bf_Cap_Head_Height = 10.0 / 1000.0 -op.bf_Cap_Head_Dia = 16.0 / 1000.0 -op.bf_Dome_Head_Dia = 20.0 / 1000.0 -op.bf_Pan_Head_Dia = 20.0 / 1000.0 -op.bf_Philips_Bit_Dia = 6.5 / 1000.0 -op.bf_Thread_Length = 20.0 / 1000.0 -op.bf_Major_Dia = 10.0 / 1000.0 -op.bf_Pitch = 1.25 / 1000.0 -op.bf_Minor_Dia = 8.646835327148438 / 1000.0 +op.bf_Hex_Head_Height = 6.400000095367432 +op.bf_Hex_Head_Flat_Distance = 17.0 +op.bf_12_Point_Head_Height = 10.0 +op.bf_12_Point_Head_Flat_Distance = 10.0 +op.bf_12_Point_Head_Flange_Dia = 16.27 +op.bf_CounterSink_Head_Dia = 20.0 +op.bf_Cap_Head_Height = 10.0 +op.bf_Cap_Head_Dia = 16.0 +op.bf_Dome_Head_Dia = 20.0 +op.bf_Pan_Head_Dia = 20.0 +op.bf_Philips_Bit_Dia = 6.5 +op.bf_Thread_Length = 20.0 +op.bf_Major_Dia = 10.0 +op.bf_Pitch = 1.25 +op.bf_Minor_Dia = 8.646835327148438 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 8.0 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 17.0 / 1000.0 -op.bf_12_Point_Nut_Height = 10.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 10.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 16.27 / 1000.0 +op.bf_Hex_Nut_Height = 8.0 +op.bf_Hex_Nut_Flat_Distance = 17.0 +op.bf_12_Point_Nut_Height = 10.0 +op.bf_12_Point_Nut_Flat_Distance = 10.0 +op.bf_12_Point_Nut_Flange_Dia = 16.27 diff --git a/source/presets/operator/mesh.bolt_add/m12.py b/source/presets/operator/mesh.bolt_add/m12.py index 8ffc693..8ede454 100644 --- a/source/presets/operator/mesh.bolt_add/m12.py +++ b/source/presets/operator/mesh.bolt_add/m12.py @@ -5,33 +5,33 @@ op.bf_Model_Type = 'bf_Model_Bolt' op.bf_Head_Type = 'bf_Head_Hex' op.bf_Bit_Type = 'bf_Bit_None' op.bf_Nut_Type = 'bf_Nut_Hex' -op.bf_Shank_Length = 33.0 / 1000.0 -op.bf_Shank_Dia = 12.0 / 1000.0 -op.bf_Phillips_Bit_Depth = 4.899229526519775 / 1000.0 -op.bf_Allen_Bit_Depth = 6.0 / 1000.0 -op.bf_Allen_Bit_Flat_Distance = 10.0 / 1000.0 -op.bf_Torx_Bit_Depth = 6.0 / 1000.0 +op.bf_Shank_Length = 33.0 +op.bf_Shank_Dia = 12.0 +op.bf_Phillips_Bit_Depth = 4.899229526519775 +op.bf_Allen_Bit_Depth = 6.0 +op.bf_Allen_Bit_Flat_Distance = 10.0 +op.bf_Torx_Bit_Depth = 6.0 op.bf_Torx_Size_Type = 'bf_Torx_T55' -op.bf_Hex_Head_Height = 7.5 / 1000.0 -op.bf_Hex_Head_Flat_Distance = 19.0 / 1000.0 -op.bf_12_Point_Head_Height = 12.0 / 1000.0 -op.bf_12_Point_Head_Flat_Distance = 12.0 / 1000.0 -op.bf_12_Point_Head_Flange_Dia = 18.27 / 1000.0 -op.bf_CounterSink_Head_Dia = 22.0 / 1000.0 -op.bf_Cap_Head_Height = 12.0 / 1000.0 -op.bf_Cap_Head_Dia = 18.5 / 1000.0 -op.bf_Dome_Head_Dia = 24.0 / 1000.0 -op.bf_Pan_Head_Dia = 24.0 / 1000.0 -op.bf_Philips_Bit_Dia = 7.800000190734863 / 1000.0 -op.bf_Thread_Length = 32.0 / 1000.0 -op.bf_Major_Dia = 12.0 / 1000.0 -op.bf_Pitch = 1.5 / 1000.0 -op.bf_Minor_Dia = 10.376201629638672 / 1000.0 +op.bf_Hex_Head_Height = 7.5 +op.bf_Hex_Head_Flat_Distance = 19.0 +op.bf_12_Point_Head_Height = 12.0 +op.bf_12_Point_Head_Flat_Distance = 12.0 +op.bf_12_Point_Head_Flange_Dia = 18.27 +op.bf_CounterSink_Head_Dia = 22.0 +op.bf_Cap_Head_Height = 12.0 +op.bf_Cap_Head_Dia = 18.5 +op.bf_Dome_Head_Dia = 24.0 +op.bf_Pan_Head_Dia = 24.0 +op.bf_Philips_Bit_Dia = 7.800000190734863 +op.bf_Thread_Length = 32.0 +op.bf_Major_Dia = 12.0 +op.bf_Pitch = 1.5 +op.bf_Minor_Dia = 10.376201629638672 op.bf_Crest_Percent = 12.5 op.bf_Root_Percent = 25 op.bf_Div_Count = 36 -op.bf_Hex_Nut_Height = 10.0 / 1000.0 -op.bf_Hex_Nut_Flat_Distance = 19.0 / 1000.0 -op.bf_12_Point_Nut_Height = 12.0 / 1000.0 -op.bf_12_Point_Nut_Flat_Distance = 12.0 / 1000.0 -op.bf_12_Point_Nut_Flange_Dia = 18.27 / 1000.0 +op.bf_Hex_Nut_Height = 10.0 +op.bf_Hex_Nut_Flat_Distance = 19.0 +op.bf_12_Point_Nut_Height = 12.0 +op.bf_12_Point_Nut_Flat_Distance = 12.0 +op.bf_12_Point_Nut_Flange_Dia = 18.27