Fix #113111: Connect Vertex Pair precision issue on large models #113246

Open
Philipp Oeser wants to merge 1 commits from lichtwerk/blender:113111_b into blender-v4.0-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

Make the threshold epsilon proportional to the max vertex coord to
compensate.

Make the threshold epsilon proportional to the max vertex coord to compensate.
Philipp Oeser added 1 commit 2023-10-04 13:56:49 +02:00
93ff78c3b6 Fix #113111: Connect Vertex Pair precission issue on large models
Make the threshold epsilon proportional to the max vertex coord to
compensate.
Philipp Oeser requested review from Campbell Barton 2023-10-04 13:57:06 +02:00
Philipp Oeser added this to the Modeling project 2023-10-04 13:57:11 +02:00
Campbell Barton approved these changes 2023-10-04 14:06:52 +02:00
Campbell Barton left a comment
Owner

Generally seems fine, should include some additional comments.

Generally seems fine, should include some additional comments.
@ -41,3 +41,3 @@
*/
#define CONNECT_EPS 0.0001f
#define CONNECT_EPS 0.00001f

Better call this CONNECT_EPS_BASIS since it's potentially scaled up.

Better call this `CONNECT_EPS_BASIS` since it's potentially scaled up.
@ -82,6 +82,7 @@ struct PathContext {
HeapSimple *states;
float matrix[3][3];
float axis_sep;
float connect_eps;

Worth adding a doc-string (CONNECT_EPS_BASIS scaled by geometry).

Worth adding a doc-string (CONNECT_EPS_BASIS scaled by geometry).
@ -617,6 +618,8 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op)
{
pc.states = BLI_heapsimple_new();
pc.link_pool = BLI_mempool_create(sizeof(PathLink), 0, 512, BLI_MEMPOOL_NOP);
pc.connect_eps = CONNECT_EPS *

The logic behind this scaling should be mentioned, with a reference to #113111.

The logic behind this scaling should be mentioned, with a reference to #113111.
@ -618,2 +619,4 @@
pc.states = BLI_heapsimple_new();
pc.link_pool = BLI_mempool_create(sizeof(PathLink), 0, 512, BLI_MEMPOOL_NOP);
pc.connect_eps = CONNECT_EPS *
std::max(1.0f, std::max(len_v3(pc.v_pair[0]->co), len_v3(pc.v_pair[1]->co)));

Can sqrtf the max: sqrtf(std::max(len_squared_v3(pc.v_pair[0]->co), len_squared_v3(pc.v_pair[1]->co)))

Can sqrtf the max: `sqrtf(std::max(len_squared_v3(pc.v_pair[0]->co), len_squared_v3(pc.v_pair[1]->co)))`
Campbell Barton changed title from Fix #113111: Connect Vertex Pair precission issue on large models to Fix #113111: Connect Vertex Pair precision issue on large models 2023-10-04 14:08:06 +02:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 113111_b:lichtwerk-113111_b
git checkout lichtwerk-113111_b
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113246
No description provided.