Weld Modifier Proposal #70240

Closed
opened 2019-09-25 14:50:23 +02:00 by Campbell Barton · 39 comments

Motivation

While modifiers such as spin, mirror & array can merge duplicates, there are times when
Some modifier setups don't can't as easily predict duplicate geometry.

Examples include:

  • Curve modifier deforming an object that loops back on it's self.
  • Bend modifier causing opposite edges touching when bending 360 degrees.
  • Beveled curves which taper to a point (although this could be supported without a modifier)

Lots of comments from users on
this thread .

Proposal

  • Seams: restrict welding to vertices along boundary edges.
  • Edge Collapse: collapse edges below the length threshold.
  • Vertex Group: option to limit welding to vertex groups.

There will be two methods available:

  • Simple (default)
This would be a fast weld operation that would support common welding operations - weld-seams/collapse-edges
although other cases could be supported in the future.
Merging geometry that would cause degenerate faces will be skipped
(this requires much more complex operation to properly handle).

(internally this will manipulate the Mesh structure without requiring it to be converted into BMesh).

  • Full
This would perform a full merge-by-distance,
with support for resolving degenerate cases, documented to be much slower
then the Simple operation.

(this can use the existing merge-by-distance code)


Pros

  • Fast by default, for merging boundaries of disconnected surfaces.
  • The ability only to merge a small subset of vertices should speed up the operation in most real world uses.

Cons

  • The Full merge-by-distance code uses a method that depends on vertex order
(picking all vertices closest to vertices at the start of the mesh). This means changing the vertex order of the input may cause the result
to *jitter*.
  • The Simple method will have limitations which might be hard to understand. Ideally we wouldn't have to select between two methods.
**Motivation** While modifiers such as spin, mirror & array can merge duplicates, there are times when Some modifier setups don't can't as easily predict duplicate geometry. Examples include: - Curve modifier deforming an object that loops back on it's self. - Bend modifier causing opposite edges touching when bending 360 degrees. - Beveled curves which taper to a point *(although this could be supported without a modifier)* Lots of comments from users on [this thread ](https://devtalk.blender.org/t/hurdles-to-implementing-merge-modifier/9718). **Proposal** - Seams: restrict welding to vertices along boundary edges. - Edge Collapse: collapse edges below the length threshold. - Vertex Group: option to limit welding to vertex groups. There will be two methods available: - **Simple** (default) ``` This would be a fast weld operation that would support common welding operations - weld-seams/collapse-edges although other cases could be supported in the future. ``` ``` Merging geometry that would cause degenerate faces will be skipped (this requires much more complex operation to properly handle). ``` *(internally this will manipulate the `Mesh` structure without requiring it to be converted into `BMesh`).* - **Full** ``` This would perform a full merge-by-distance, with support for resolving degenerate cases, documented to be much slower then the Simple operation. ``` *(this can use the existing merge-by-distance code)* ---- **Pros** - Fast by default, for merging boundaries of disconnected surfaces. - The ability only to merge a small subset of vertices should speed up the operation in most real world uses. **Cons** - The **Full** merge-by-distance code uses a method that depends on vertex order ``` (picking all vertices closest to vertices at the start of the mesh). This means changing the vertex order of the input may cause the result to *jitter*. ``` - The **Simple** method will have limitations which might be hard to understand. Ideally we wouldn't have to select between two methods.
Campbell Barton self-assigned this 2019-09-25 14:50:23 +02:00
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Added subscriber: @howardt

Added subscriber: @howardt
Member

Pointing out that some of the desire for this comes from the fact that the Bevel modifier can, as a result of clamping, put vertices on top of each other, and users would like them merged. As Campbell points out, the Bevel modifier itself could be changed to detect and merge in such cases. I would have done so if it were easy, but it is not so easy (the current code that merges nearby vertices gets quite complicated), so was delaying -- especially as my eventual goal is to get rid of clamping completely and continue beveling after such collisions cause merges.

All this is to say: restricting this to only happen at boundaries (seams) may not accomplish everything people want, so if possible that should be an option rather than a requirement,

Pointing out that some of the desire for this comes from the fact that the Bevel modifier can, as a result of clamping, put vertices on top of each other, and users would like them merged. As Campbell points out, the Bevel modifier itself could be changed to detect and merge in such cases. I would have done so if it were easy, but it is not so easy (the current code that merges nearby vertices gets quite complicated), so was delaying -- especially as my eventual goal is to get rid of clamping completely and continue beveling after such collisions cause merges. All this is to say: restricting this to only happen at boundaries (seams) may not accomplish everything people want, so if possible that should be an option rather than a requirement,

Added subscriber: @Dspazio

Added subscriber: @Dspazio
Author
Owner

@howardt wouldn't collapsing edges handle this case?

We should be able to support this as long as it doesn't result in faces using the same edge/vertex twice.

@howardt wouldn't collapsing edges handle this case? We should be able to support this as long as it doesn't result in faces using the same edge/vertex twice.
Member

Collapsing edges would mostly handle that case, yes. I wasn't sure whether you intended to support that everywhere or just as part of handling merges across boundaries, but thinking about it, you must have meant the former, because the latter wouldn't come up in most cases, if ever.

One case that your Simple solution would rule out: cases where bevel acts as an inset into a particular face (because all edges around that face are beveled). At some point, the inner face of the inset disappears (always, for triangles; for regular polygons otherwise). Users would probably like that face to go away and all the points of the inner face to weld together. And a variant on this: sometimes the inner face degenerates into a line (e.g., insetting a rectangle).

Collapsing edges would mostly handle that case, yes. I wasn't sure whether you intended to support that everywhere or just as part of handling merges across boundaries, but thinking about it, you must have meant the former, because the latter wouldn't come up in most cases, if ever. One case that your Simple solution would rule out: cases where bevel acts as an inset into a particular face (because all edges around that face are beveled). At some point, the inner face of the inset disappears (always, for triangles; for regular polygons otherwise). Users would probably like that face to go away and all the points of the inner face to weld together. And a variant on this: sometimes the inner face degenerates into a line (e.g., insetting a rectangle).

Added subscriber: @cedriclepiller

Added subscriber: @cedriclepiller

I can add some others examples we talked about in the Bevel modifier thread.

image.png
image.png
image.png

One more from fiendish55
https://i.imgur.com/PfjPJ8K.gifv

Maybe it could be possible with modifiers (bevel, merge, triangulate on ngons) to achieve this kind of non-destructive beveling.
c043c82a09.gif

I can add some others examples we talked about in the Bevel modifier thread. ![image.png](https://archive.blender.org/developer/F7774581/image.png) ![image.png](https://archive.blender.org/developer/F7774586/image.png) ![image.png](https://archive.blender.org/developer/F7774589/image.png) One more from fiendish55 https://i.imgur.com/PfjPJ8K.gifv Maybe it could be possible with modifiers (bevel, merge, triangulate on ngons) to achieve this kind of non-destructive beveling. https://devtalk.blender.org/uploads/default/original/1X/c043c82a09a5ea04bc1b1bd4c8962e9f2d9b3d72.gif

Added subscriber: @Helo

Added subscriber: @Helo

Added subscriber: @Spatz

Added subscriber: @Spatz

Added subscriber: @MatthewHeimlich

Added subscriber: @MatthewHeimlich

Please keep things like multires in mind during the design process. One of the best use cases that I can imagine for this kind of modifier is for sculptors who wish to split objects that should visibly be contiguous into multiple pieces so that they can really crank up the level of subdivision on each individual part for multires sculpting while still having them act like a single mesh for animation, edit mode, etc.

Please keep things like multires in mind during the design process. One of the best use cases that I can imagine for this kind of modifier is for sculptors who wish to split objects that should visibly be contiguous into multiple pieces so that they can really crank up the level of subdivision on each individual part for multires sculpting while still having them act like a single mesh for animation, edit mode, etc.

Added subscriber: @Josephbburg

Added subscriber: @Josephbburg

I'm curious if this is planned to support joining objects, or only work on a single object? Sometimes in animation it would be nice to merge edges of objects together (hand/sleeve for example).

I'm curious if this is planned to support joining objects, or only work on a single object? Sometimes in animation it would be nice to merge edges of objects together (hand/sleeve for example).

Added subscriber: @0rAngE

Added subscriber: @0rAngE
Author
Owner

@Josephbburg it's possible although it wouldn't be a target for the first version of this patch.

Also, this feature seems better suited to a grouping than a single objects modifier - where all objects in the group have their seams welded.

@Josephbburg it's possible although it wouldn't be a target for the first version of this patch. Also, this feature seems better suited to a grouping than a single objects modifier - where all objects in the group have their seams welded.

Added subscriber: @ErickNyanduKabongo

Added subscriber: @ErickNyanduKabongo

In #70240#783915, @MatthewHeimlich wrote:
Please keep things like multires in mind during the design process. One of the best use cases that I can imagine for this kind of modifier is for sculptors who wish to split objects that should visibly be contiguous into multiple pieces so that they can really crank up the level of subdivision on each individual part for multires sculpting while still having them act like a single mesh for animation, edit mode, etc.

I second this, If you guys can make it work, we will have a very powerful multires.

> In #70240#783915, @MatthewHeimlich wrote: > Please keep things like multires in mind during the design process. One of the best use cases that I can imagine for this kind of modifier is for sculptors who wish to split objects that should visibly be contiguous into multiple pieces so that they can really crank up the level of subdivision on each individual part for multires sculpting while still having them act like a single mesh for animation, edit mode, etc. I second this, If you guys can make it work, we will have a very powerful multires.

Added subscriber: @Ariel-Tavori

Added subscriber: @Ariel-Tavori

Added subscriber: @Tosky

Added subscriber: @Tosky

The "full method" use the existing merge-by-distance code; it's right to say that will give us options like 'merge at first/last/3dcursor' and peraphs Empty? Because that could open new scenarios.

The "full method" use the existing merge-by-distance code; it's right to say that will give us options like 'merge at first/last/3dcursor' and peraphs Empty? Because that could open new scenarios.
Author
Owner

@Tosky, these don't make sense for modifiers since defining operations on individual vertices doesn't fit well with the current modifier stack.

@Tosky, these don't make sense for modifiers since defining operations on individual vertices doesn't fit well with the current modifier stack.

Added subscriber: @BartekMoniewski

Added subscriber: @BartekMoniewski

Added subscriber: @AnadinX

Added subscriber: @AnadinX

Added subscriber: @darrelljuk

Added subscriber: @darrelljuk

Added subscriber: @MarcelLegindi

Added subscriber: @MarcelLegindi

Hi,
Any update about this modifier for 2.82?

Hi, Any update about this modifier for 2.82?
Author
Owner

@cedriclepiller after 2.81 release.

@cedriclepiller after 2.81 release.

Ok, thank you for your answer ;)

Ok, thank you for your answer ;)

Added subscriber: @lemenicier_julien

Added subscriber: @lemenicier_julien

Added subscriber: @item412

Added subscriber: @item412

Added subscriber: @LapisSea

Added subscriber: @LapisSea
Contributor

Added subscriber: @dupoxy

Added subscriber: @dupoxy

Added subscriber: @FrancoisRimasson

Added subscriber: @FrancoisRimasson

I wish to be able to collapse edge with no faces around (ie : edges used for sewing garments in the cloth modifier)
image.png

I wish to be able to collapse edge with no faces around (ie : edges used for sewing garments in the cloth modifier) ![image.png](https://archive.blender.org/developer/F8191971/image.png)

Added subscribers: @mano-wii, @brecht

Added subscribers: @mano-wii, @brecht

@mano-wii, can you close this task and create a follow-up task for remaining improvements to the weld modifier, so we can consider this one finished for the release?

If there are still things to improve for 2.82, please create another task for that and tag it with the Blender 2.82 milestone.

@mano-wii, can you close this task and create a follow-up task for remaining improvements to the weld modifier, so we can consider this one finished for the release? If there are still things to improve for 2.82, please create another task for that and tag it with the Blender 2.82 milestone.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

As the main goal of this task (Weld Modifier Implementation) has already been resolved, closing.
Remaining proposals moved to #73139 (Weld Modifier Improvements).

As the main goal of this task (Weld Modifier Implementation) has already been resolved, closing. Remaining proposals moved to #73139 (Weld Modifier Improvements).
Thomas Dinges added this to the 2.82 milestone 2023-02-08 16:41:47 +01:00
Sign in to join this conversation.
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
23 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#70240
No description provided.