Incorrect bolt sizes BoltFactory add-on #80648
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#80648
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-5.6.0-2-amd64-x86_64-with-debian-10.5 64 Bits
Graphics card: GeForce GTX 960/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100
Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash:
blender/blender@0330d1af29
Worked: (newest version of Blender that worked as expected)
Addon Information
Name: BoltFactory (0, 4, 0)
Author: Aaron Keith
Short description of error
The thread length is always less than the specified "Thread length".
Exact steps for others to reproduce the error
Go to side view, create a bolt. If you count on the grid, you will see that the length to the head is less than indicated in "Thread Length". In any preset. And in different presets this length will be different. And in the M12 preset it is generally difficult to use because of the "Shank Lenght" parameter, which spoils the overall length.
In the screenshot, I alternately chose the M * preset and set the length to 20mm.
Added subscriber: @Az3Dip
Added subscriber: @OmarEmaraDev
Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
I can confirm that. But the actual thread length is a discrete multiple of the number of turns that are derived from the thread length given to the operation. So this may just be an expected result.
The incorrect bolt length is indeed due to the blender modelling, so that might be considered "expected", however it's not expected for a mechanical fixing. The length of a bolt should be the distance from the underside of the head to the tip - in the real world threads have fractional revolutions.
The error comes from this slightly clumsy line:
Num = int((HEIGHT - ((NUM_OF_START_THREADS * PITCH) + (NUM_OF_END_THREADS * PITCH))) / PITCH)
in Create_Thread_Verts.
The fix is rather easy if applied in: Create_External_Thread
Where Create_Thread_End_Verts is called the returned value Lowest_Z_Vert is the tip of the thread, this will be too short by some fraction of a pitch.
Before the verts.extend block of code is the place figure to what has been lost in the model creation vs the requested input, something like:
Mini_adder = Lowest_Z_Vert + SHANK_LENGTH + LENGTH
if Mini_adder < LENGTH * 0.01:
Mini_adder = 0 # Catches a very thin shim and also negative situations, worst case error is 1%
print("Bolt length is already perfect, length modulo number of thread pitch rotations!")
Three of verts.extend can be shifted down using the function Move_Verts_Up_Z - this has the effect of increasing the shank.
verts.extend(Move_Verts_Up_Z(Thread_Start_Verts, -Mini_adder) ) # Needs moving down by the mini_adder
verts.extend(Move_Verts_Up_Z(Thread_Verts, -Mini_adder) ) # Needs moving down by the mini_adder
verts.extend(Move_Verts_Up_Z(Thread_End_Verts, -Mini_adder) ) # Needs moving down by the mini_adder
Finally don't forget to change the return to include the new Z value:
return verts, faces, 0.0 - Lowest_Z_Vert + Mini_adder