Bolt Factory Addon: RemoveDoubles() improvements #105066
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#105066
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 Mint 21.2 Victoria base: Ubuntu 22.04 jammy
Graphics card: OpenGL: renderer: Mesa Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 23.3.0
Blender Version
Broken: 3.0.1
Worked: Probably never? It has been 6 years since the last main branch edit to this function, assuming I looked in the right place.
Addon Information
Name: BoltFactory (0, 4, 0)
Author: Aaron Keith
Short description of error
While looking to clean up the non-manifold parts of the Bolt Factory library I have found a couple of things which should be addressed within the RemoveDoubles() function inside createMesh.py :
Please note that I'm not a software engineer :)
Exact steps for others to reproduce the error
Towards the end of createMesh.py, just before "verts = Scale_Mesh_Verts(verts, GLOBAL_SCALE)" add the following lines:
In a new project, enable the Bolt Factory addon if not already setup.
Add -> Mesh -> BoltFactory
OperatorPresent -> m6
Model -> Nut
Type -> Hex
Observe the Info Log window, as see that Verts length of "RemovedDoubles 5DP" is less than RemovedDoubles 4DP.
For me this gives the following:
length of verts after RemoveDoubles 4DP: 1342
length of verts after RemoveDoubles 5DP: 1339
Insert just before the return of RemoveDoubles()
That removed the exact duplicates, but cyclic shift of the tuple is also the same and may still exist!
I don't know how to do a check for [0,1,2] = [1,2,0] = [2,0,1] as for a face these are all equal.
I've made other changes in my copy of the file to not generate those in the first place => Needs another ticket to explain.
A subtle bug in RemoveDoubles() where the rounded list is created. Using the following two numbers and round to different precision, see the result:
When data is rounded to fewer decimal places one might assume it collects more of the same rather than missing some!
For the purpose of the physical world those two values are the same, and both need collection.
My solution has been to call, RemoveDoubles twice, but it would be good to have this work inside the function.
With luck this is a 'simple' loop to add code for Decimal_places+1 ...
Please consider adding something like - "Verts without an associated face of size 3 or 4 get silently expunged."
Is there a way to check for faces that don't meet that criteria rather than silently removing them?
The source file I've been looking at:
https://projects.blender.org/blender/blender-addons/src/branch/main/add_mesh_BoltFactory/createMesh.py
Thanks
sw-tya referenced this issue2024-07-30 01:39:44 +02:00
I've done some more testing and the solution I have to address the rounding is to add 4 lines of code at the beginning of RemoveDoubles()
verts, faces = RemoveDoubles_core(verts, faces, Decimal_Places+1)
verts, faces = RemoveDoubles_core(verts, faces, Decimal_Places)
return verts, faces
def RemoveDoubles_core(verts, faces, Decimal_Places=4):