Remove-Doubles (modifier) #41748

Closed
opened 2014-09-08 03:59:39 +02:00 by Campbell Barton · 70 comments

Starting this design task because the possibility of a remove doubles modifier was suggested (in replies to D443).

The current design of the modifier stack creates an entire new mesh for each modifier, this means its not well suited to having small (fine-grained) editing operations as modifiers.

Which is why we don't already have many basic operations as modifiers.

So for this design task I like to gather some good use cases where a remove-doubles modifier would be used, to consider if its worth adding.

Findings...

  • Merging could use a boundary only option, since in many cases you want to zip up two boundaries (will be faster too).
  • Merging 2x solid edges (result of solidify modifier for example), will create internal faces, we could have an option to remove duplicate faces (which are likely to be internal).
  • ... Further, merging overlapping faces isn't likely to give useful results (it can pick first face but not make a useful choice).
Starting this design task because the possibility of a remove doubles modifier was suggested (in replies to [D443](https://archive.blender.org/developer/D443)). The current design of the modifier stack creates an entire new mesh for each modifier, this means its not well suited to having small (fine-grained) editing operations as modifiers. Which is why we don't already have many basic operations as modifiers. So for this design task I like to gather some good use cases where a remove-doubles modifier would be used, to consider if its worth adding. Findings... ---- - Merging could use a **boundary only** option, since in many cases you want to *zip up* two boundaries (will be faster too). - Merging 2x solid edges (result of solidify modifier for example), will create internal faces, we *could* have an option to remove duplicate faces (which are likely to be internal). - ... Further, merging overlapping faces isn't likely to give useful results (it can pick first face but not make a useful choice).
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Campbell Barton self-assigned this 2014-09-08 03:59:39 +02:00
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Author
Owner

Added subscribers: @karja, @PatriceBertrand

Added subscribers: @karja, @PatriceBertrand
Campbell Barton changed title from Remove doubles modifier to Remove-Doubles (modifier) 2014-09-08 04:02:14 +02:00

Added subscriber: @zeauro

Added subscriber: @zeauro

remove_doubles.blend
In this .blend, there is an animated grid with 2 shapekeys simulating a tearing of a transparent block.
On this grid, there is a solidify modifier and a bevel one.

Next to it, there is a non animated grid created by creation of a shapekey from mix at frame 60 and deletion of previous shapekey and basis.
For this mesh, I did a Remove Doubles in edit mode.

With a Remove Doubles modifier added before the others, animated grid could be rendered like non animated one.

[remove_doubles.blend](https://archive.blender.org/developer/F109493/remove_doubles.blend) In this .blend, there is an animated grid with 2 shapekeys simulating a tearing of a transparent block. On this grid, there is a solidify modifier and a bevel one. Next to it, there is a non animated grid created by creation of a shapekey from mix at frame 60 and deletion of previous shapekey and basis. For this mesh, I did a Remove Doubles in edit mode. With a Remove Doubles modifier added before the others, animated grid could be rendered like non animated one.

RD_simple_deform.blend
In this .blend, a simple deform modifier doing a bend is the starting point of modifier stack.
At the bottom, you see the result if we could add a Remove Doubles modifier just after it.

[RD_simple_deform.blend](https://archive.blender.org/developer/F109507/RD_simple_deform.blend) In this .blend, a simple deform modifier doing a bend is the starting point of modifier stack. At the bottom, you see the result if we could add a Remove Doubles modifier just after it.

RD_Sphere_Horn.blend
in this .blend, a simple sphere has a horn define by a curve modifier.
A shapekey was created to animate disappearing of the horn.
With a Remove Doubles modifier, result would be a perfectly smooth sphere

[RD_Sphere_Horn.blend](https://archive.blender.org/developer/F109511/RD_Sphere_Horn.blend) in this .blend, a simple sphere has a horn define by a curve modifier. A shapekey was created to animate disappearing of the horn. With a Remove Doubles modifier, result would be a perfectly smooth sphere

This comment was removed by @zeauro

*This comment was removed by @zeauro*

This comment was removed by @PatriceBertrand

*This comment was removed by @PatriceBertrand*

This comment was removed by @zeauro

*This comment was removed by @zeauro*
Author
Owner

Just removed discussion about a bisect modifier, @zeauro - please stay on topic.

Just removed discussion about a bisect modifier, @zeauro - please stay on topic.

Copied from D443, added a few comments. Hopefully it works just as i had imagined:


Have experimented with some ideas.
Main purpose i have found in operations where you want to

  • tear
  • pluck
  • peel
  • break
  • cut
  • (and so on)
    geometry, and of course the other way around.

Benefits i see are especially for animation and deform on smooth meshes. With a "merge"-modifier you could assign overlapping edges to 2 or more different vertexgroups and move them with bones or curves asunder.
TextileTear.png Rough example. The crack or whatever can be handled by Edge Split very good, but i dont know a good possibility to go any further.
My idea for a "merge"-modifier is to create two or more parts with overlapping verts and edges and hide the dividing line with the modifier.
Moving the parts beyond the merge limit splits the mesh.


EggMerge.png Fracture could have an extra layer when combined with Edge Split.

A merge option for meshobject + meshobject (like target object) could handle more - Linked Duplicates with Mask would be responsible for more fragments, so you have only one mesh to work on.
Also comes in place where two sets of modifiers should not affect eachother (Solidify/Array always take whole mesh) and 2 objects are needed, but result object shall appear as connected.
A little like Array cap settings without modifier dependencies. I dont know if this is feasible.


BananaMerge.png The banana shows no cuts/is not peeled when not deformed, providing the merge is activ.
This can also be done with Array merge, but it dont allows to animate seperate banana peels, or to texture it as a whole.
In theory you could display every fruit outside and inside with a single mesh (after cutting it, suitable for animations).


TreePluck.png Last one is Skin modifier (maybe not an ideal example). Skin should be generally not bad to use, because you can set higher merge limits and stick how you like.
Also its very organic - a bit like metaballs when combined with a "merge"-modifier + Subsurf. > same method as in @zeauro´s SphereHorn-File. You could collect connected vertices on one point and they merge to a single vertice with the modifier. Then move the vertices to different locations and you get a larger and still connected mesh. (for waterdrops, growing plants or something like that)
Only problem i see is the radius and root after merge operation.

Copied from [D443](https://archive.blender.org/developer/D443), added a few comments. Hopefully it works just as i had imagined: ---- Have experimented with some ideas. Main purpose i have found in operations where you want to - tear - pluck - peel - break - cut - (and so on) geometry, and of course the other way around. Benefits i see are especially for animation and deform on smooth meshes. With a "merge"-modifier you could assign overlapping edges to 2 or more different vertexgroups and move them with bones or curves asunder. ![TextileTear.png](https://archive.blender.org/developer/F109368/TextileTear.png) Rough example. The crack or whatever can be handled by Edge Split very good, but i dont know a good possibility to go any further. My idea for a "merge"-modifier is to create two or more parts with overlapping verts and edges and hide the dividing line with the modifier. Moving the parts beyond the merge limit splits the mesh. ---- ![EggMerge.png](https://archive.blender.org/developer/F109370/EggMerge.png) Fracture could have an extra layer when combined with Edge Split. A merge option for meshobject + meshobject (like target object) could handle more - Linked Duplicates with Mask would be responsible for more fragments, so you have only one mesh to work on. Also comes in place where two sets of modifiers should not affect eachother (Solidify/Array always take whole mesh) and 2 objects are needed, but result object shall appear as connected. A little like Array cap settings without modifier dependencies. I dont know if this is feasible. ---- ![BananaMerge.png](https://archive.blender.org/developer/F109372/BananaMerge.png) The banana shows no cuts/is not peeled when not deformed, providing the merge is activ. This can also be done with Array merge, but it dont allows to animate seperate banana peels, or to texture it as a whole. In theory you could display every fruit outside and inside with a single mesh (after cutting it, suitable for animations). ---- ![TreePluck.png](https://archive.blender.org/developer/F109374/TreePluck.png) Last one is Skin modifier (maybe not an ideal example). Skin should be generally not bad to use, because you can set higher merge limits and stick how you like. Also its very organic - a bit like metaballs when combined with a "merge"-modifier + Subsurf. > same method as in @zeauro´s SphereHorn-File. You could collect connected vertices on one point and they merge to a single vertice with the modifier. Then move the vertices to different locations and you get a larger and still connected mesh. (for waterdrops, growing plants or something like that) Only problem i see is the radius and root after merge operation.

It's interresting to see, in these examples that the effect of the "remove doubles" may be usefull not only after (after in terms of time not of stack order) other modifiers have acted, but also before, that is to say mesh parts are glued and merged to start with, then because of various modifiers they are torn appart, double vertices get separated and the "double modifier" ceases to operate.

Copied from D443 : We must keep in mind that although we call it "remove doubles", (as in "fix a problem"), the operation is really "remove near vertices". In that sense, even though few modifiers would actually create true doubles, many could generate very close vertices. The array modifier would do this simply if using scaling (through a scaled empty object), then each instance gets smaller and smaller, and vertices get nearer. Shrinkwrap modifier could also quite often yield vertices that are very close to each other and could be simplified by a "remove doubles".

It's interresting to see, in these examples that the effect of the "remove doubles" may be usefull not only **after** (after in terms of time not of stack order) other modifiers have acted, but also **before**, that is to say mesh parts are glued and merged to start with, then because of various modifiers they are torn appart, double vertices get separated and the "double modifier" ceases to operate. Copied from [D443](https://archive.blender.org/developer/D443) : We must keep in mind that although we call it "remove doubles", (as in "fix a problem"), the operation is really "remove near vertices". In that sense, even though few modifiers would actually create true doubles, many could generate very close vertices. The array modifier would do this simply if using scaling (through a scaled empty object), then each instance gets smaller and smaller, and vertices get nearer. Shrinkwrap modifier could also quite often yield vertices that are very close to each other and could be simplified by a "remove doubles".

A merge option for meshobject + meshobject (like target object) could handle more - Linked Duplicates (...), so you have only one mesh to work on.
Also comes in place where (...) 2 objects are needed or would be helpful, but result object shall appear as connected. (...)

An example:
You could duplicate (AltD-link) fingers and scale+place the objects in right position to the hand, before merging them to the character mesh with the modifier.
Thus you can edit finger & vertexgroups on a single mesh, without having to duplicateX5 and reassigning vertexgroups on every finger after changes.
The way is that linked fingers get the merge modifier with target "character mesh" and vertexgroups have to be renamed only one time for every duplicate.


For the Array: This could be used where you want to "skip" repeating parts of the mesh, for example on snake models.
WhatTheSnake.png

  • Add a linked duplicate of the head mesh.
  • Give it a mask modifier and mask the repeating part.
  • Mask the head mesh aswell (opposite).
  • Array the repeating object.
  • Use merge modifier and head mesh as target > mesh closed.

As mentioned above, its like Array merge in this example, but end & start of the arrayed mesh can be modified better.
Nevertheless, this is highly theoretical and maybe there are better methods to handle this specific example, but it should work for lot of models.


Would be nice if this gets considered.
I like to suggest not to see this as another function, rather than a main feature of the modifier in terms of possible use cases.

> A merge option for meshobject + meshobject (like target object) could handle more - Linked Duplicates (...), so you have only one mesh to work on. >Also comes in place where (...) 2 objects are needed or would be helpful, but result object shall appear as connected. (...) An example: You could duplicate (AltD-link) fingers and scale+place the objects in right position to the hand, before merging them to the character mesh with the modifier. Thus you can edit finger & vertexgroups on a single mesh, without having to duplicateX5 and reassigning vertexgroups on every finger after changes. The way is that linked fingers get the merge modifier with target "character mesh" and vertexgroups have to be renamed only one time for every duplicate. --- For the Array: This could be used where you want to "skip" repeating parts of the mesh, for example on snake models. ![WhatTheSnake.png](https://archive.blender.org/developer/F110009/WhatTheSnake.png) - Add a linked duplicate of the head mesh. - Give it a mask modifier and mask the repeating part. - Mask the head mesh aswell (opposite). - Array the repeating object. - Use merge modifier and head mesh as target > mesh closed. As mentioned above, its like Array merge in this example, but end & start of the arrayed mesh can be modified better. Nevertheless, this is highly theoretical and maybe there are better methods to handle this specific example, but it should work for lot of models. --- Would be nice if this gets considered. I like to suggest not to see this as another function, rather than a main feature of the modifier in terms of possible use cases.

BeltMerge.png
Here is an example where merge is not only handy, but even necessary.

The belt mesh got a curve modifier and follows a curve circle (white line) with Stretch & Bounds Clamp options enabled.
As you can see, the ends could use a good merger.
Or you apply the curve modifier instead, but this means you cant use curve any more for animation or pose corrections.

The idea is to place a Merge modifier after Curve modifier.
Therefore you dont have to apply the modifier and dont have to lose curve control, and of course, its still very easy to make changes on the mesh.

![BeltMerge.png](https://archive.blender.org/developer/F110765/BeltMerge.png) Here is an example where merge is not only handy, but even necessary. The belt mesh got a curve modifier and follows a curve circle (white line) with Stretch & Bounds Clamp options enabled. As you can see, the ends could use a good merger. Or you apply the curve modifier instead, but this means you cant use curve any more for animation or pose corrections. The idea is to place a Merge modifier after Curve modifier. Therefore you dont have to apply the modifier and dont have to lose curve control, and of course, its still very easy to make changes on the mesh.

Added subscriber: @MarcClintDion

Added subscriber: @MarcClintDion

Added subscriber: @RayMairlot

Added subscriber: @RayMairlot

This may be a similar situation to what @karja said above, but particularly when modelling wheels/tire tread it is necessary to merge the beginning and end of the tire to create a complete circle.

Currently, it is necessary to apply both the array and whatever deform modifier you have used to bend it into a circle (commonly curve or simple deform set to bend) and then remove doubles in edit mode. The obvious disadvantage is that should you want to later change, say, the design of the tire tread it is necessary to have access to the original un-modified mesh and then repeat the apply, remove doubles process.

A remove doubles modifier could simply sit at the end of the modifier stack and allow the underlying mesh to be altered at any point while still forming a seamless circle.

This may be a similar situation to what @karja said above, but particularly when modelling wheels/tire tread it is necessary to merge the beginning and end of the tire to create a complete circle. Currently, it is necessary to apply both the array and whatever deform modifier you have used to bend it into a circle (commonly curve or simple deform set to bend) and then remove doubles in edit mode. The obvious disadvantage is that should you want to later change, say, the design of the tire tread it is necessary to have access to the original un-modified mesh and then repeat the apply, remove doubles process. A remove doubles modifier could simply sit at the end of the modifier stack and allow the underlying mesh to be altered at any point while still forming a seamless circle.
Author
Owner

Updated task with findings section.

Updated task with **findings** section.

If there was a "remove double" modifier, then it would be simple to add settings based on vertex groups. (1) limit the merge to a vertex group, but also (2), limit with given source group onto given target group.
I believe in lightweight modifiers with limited features, used as legos. If and when some node based modifier scheme is introduced, then we would probably use more atomic feature nodes assembled at will. When this comes, it is likely the current modifiers will not be trashed, but simply ported to nodes. In that perspective, it does make sense to introduce such light or atomic modifiers, later to be turned into nodes.

That being said, I did mention earlier that when doubles removal is bundled with a modifier, it can be made more efficient, because it only acts on the vertices that were created. In order to split the work in (A) mesh generation, followed by (B) doubles removal, we would need the (A) node to output not just a mesh, but also vertex groups that identify the newly created vertices. This vertex group node-output would then be pluged into the remove doubles node inputs.

If there was a "remove double" modifier, then it would be simple to add settings based on vertex groups. (1) limit the merge to a vertex group, but also (2), limit with given source group onto given target group. I believe in lightweight modifiers with limited features, used as legos. If and when some node based modifier scheme is introduced, then we would probably use more atomic feature nodes assembled at will. When this comes, it is likely the current modifiers will not be trashed, but simply ported to nodes. In that perspective, it does make sense to introduce such light or atomic modifiers, later to be turned into nodes. That being said, I did mention earlier that when doubles removal is bundled with a modifier, it can be made more efficient, because it only acts on the vertices that were created. In order to split the work in (A) mesh generation, followed by (B) doubles removal, we would need the (A) node to output not just a mesh, but also vertex groups that identify the newly created vertices. This vertex group node-output would then be pluged into the remove doubles node inputs.
Member

Added subscriber: @ZhangYu

Added subscriber: @ZhangYu

Added subscriber: @RyukoReiakuma

Added subscriber: @RyukoReiakuma

Added subscriber: @AndyDavies-3

Added subscriber: @AndyDavies-3

+1 I think is a modifier that would be worth adding even if it were only for pure modeling purposes.
There are many occasions where I would rather work procedurally (via a curve) but then have to turn it into a mesh because there is a seam.

+1 I think is a modifier that would be worth adding even if it were only for pure modeling purposes. There are many occasions where I would rather work procedurally (via a curve) but then have to turn it into a mesh because there is a seam.

user:karja has me convinced this is a really good idea. Normally for some of the things shown in his(her) posts, people tend to use a stand-in object that is complete and seamless while the breakable object is invisible. Then the object is made to "brake" by reversing the visibility of everything at a certain keyframe, it works but this idea for a Remove Doubles modifier seems neater and would be very easy to setup and maintain.

I guess that's all obvious now from all the posts made but I just wanted to add to the use cases for this. -> Breaking glass. The broken mesh could be shown the whole time instead of replacing an unbroken one at the time of breakage.

The subtle tearing that would come from the merge threshold being broken by various vertices at different times may actually enhance the illusion.(if anyone's eyes can even track that fast :)

user:karja has me convinced this is a really good idea. Normally for some of the things shown in his(her) posts, people tend to use a stand-in object that is complete and seamless while the breakable object is invisible. Then the object is made to "brake" by reversing the visibility of everything at a certain keyframe, it works but this idea for a Remove Doubles modifier seems neater and would be very easy to setup and maintain. I guess that's all obvious now from all the posts made but I just wanted to add to the use cases for this. -> Breaking glass. The broken mesh could be shown the whole time instead of replacing an unbroken one at the time of breakage. The subtle tearing that would come from the merge threshold being broken by various vertices at different times may actually enhance the illusion.(if anyone's eyes can even track that fast :)

Added subscriber: @lowercase

Added subscriber: @lowercase

you need something like this to be able to use 'pointiness' on text and curve objects, as caps are disconected from bevel

you need something like this to be able to use 'pointiness' on text and curve objects, as caps are disconected from bevel

Added subscriber: @Zafio

Added subscriber: @Zafio

+1 Worth adding IMO, taking into account the cases already described.

Today I've found myself in the Array+Curve situation, at it was frustrating.

At first I was confused by the "first/last" merge options in the Array Modifier, it took me a while to realize it doesn't work with a curve modifier on top.
So, for that particular case, unless a merge first/last option is implemented for the Curve Modifier (which would be also nice), a Remove Doubles modifier really makes sense.

Regards.

+1 Worth adding IMO, taking into account the cases already described. Today I've found myself in the Array+Curve situation, at it was frustrating. At first I was confused by the "first/last" merge options in the Array Modifier, it took me a while to realize it doesn't work with a curve modifier on top. So, for that particular case, unless a merge first/last option is implemented for the Curve Modifier (which would be also nice), a Remove Doubles modifier really makes sense. Regards.
Member

Two more examples to show the importance of this feature:

A pac-man:
pacman.gif

A plane to sphere morphing:
rect-to-sphere.gif

As shown in the image, I have to subdivide the mesh a lot to have the closed seam less noticable, and of course, smooth shading is helpless in those cases.

Two more examples to show the importance of this feature: A pac-man: ![pacman.gif](https://archive.blender.org/developer/F211659/pacman.gif) A plane to sphere morphing: ![rect-to-sphere.gif](https://archive.blender.org/developer/F211660/rect-to-sphere.gif) As shown in the image, I have to subdivide the mesh a lot to have the closed seam less noticable, and of course, smooth shading is helpless in those cases.

Added subscriber: @AdmiralPotato

Added subscriber: @AdmiralPotato
Member

Added subscriber: @gandalf3

Added subscriber: @gandalf3

Added subscriber: @michaelknubben

Added subscriber: @michaelknubben

Added subscriber: @JonathanWilliamson

Added subscriber: @JonathanWilliamson

Added subscriber: @MatthewHeimlich

Added subscriber: @MatthewHeimlich

I'm sure it's already been covered above, but this would be really nice for keeping contiguous shading on characters that are split into multiple objects (arms, legs, torso, head, etc.) for the sake of external texturing tools that don't support Blender's UV sets.

I'm sure it's already been covered above, but this would be really nice for keeping contiguous shading on characters that are split into multiple objects (arms, legs, torso, head, etc.) for the sake of external texturing tools that don't support Blender's UV sets.

Added subscriber: @gwentiv

Added subscriber: @gwentiv

Added subscriber: @GottfriedHofmann

Added subscriber: @GottfriedHofmann

When modeling with the screw modifier, a remove doubles modifier would be awesome as well! I have been longing for this for a long time now.

When modeling with the screw modifier, a remove doubles modifier would be awesome as well! I have been longing for this for a long time now.

Added subscriber: @AnadinX

Added subscriber: @AnadinX

This would be a very good addition, I came across this causing me problems when doing a deformed torus made from bends/twists etc. In Cinema4D, there is the Connect object that takes the whole stack and has the weld/merge functionality in it. This is very similar concept and would be invaluable.

This would be a very good addition, I came across this causing me problems when doing a deformed torus made from bends/twists etc. In Cinema4D, there is the Connect object that takes the whole stack and has the weld/merge functionality in it. This is very similar concept and would be invaluable.
Campbell Barton removed their assignment 2016-08-11 06:37:59 +02:00
Author
Owner

Removed subscriber: @ideasman42

Removed subscriber: @ideasman42

Added subscriber: @BloodyRain

Added subscriber: @BloodyRain

I'd love this because I work a lot with the Mirror modifier and run not rarely into the problem that I want to merge some portions along the Mirror axis but not all of them.

So my first idea was to propose an addition to the Mirror modifier to supply it with a vertex group similar to how the Mask modifier uses one which then defines where merging would occur (or not). Optionally with the weight being used as a multiplier for the threshold.

This idea however is much more versatile if said vertex group selection for what can and can not be merged would be added.

I'd love this because I work a lot with the Mirror modifier and run not rarely into the problem that I want to merge some portions along the Mirror axis but not all of them. So my first idea was to propose an addition to the Mirror modifier to supply it with a vertex group similar to how the Mask modifier uses one which then defines where merging would occur (or not). Optionally with the weight being used as a multiplier for the threshold. This idea however is much more versatile if said vertex group selection for what can and can not be merged would be added.

Added subscriber: @thomasmouilleron

Added subscriber: @thomasmouilleron

This would be so useful for maxed out 100% Bevels to create a more controlled subdivision

This would be so useful for maxed out 100% Bevels to create a more controlled subdivision

Added subscriber: @NahuelBelich

Added subscriber: @NahuelBelich

Added subscriber: @cedriclepiller

Added subscriber: @cedriclepiller

Any news about this?

Any news about this?

Added subscriber: @Fiendari

Added subscriber: @Fiendari

This is one of the most needed modifiers for blender modelling, it would make life so much easier in so many cases and don't we all want easy life I bet you do.

This is one of the most needed modifiers for blender modelling, it would make life so much easier in so many cases and don't we all want easy life I bet you do.

Added subscriber: @RainerTrummer

Added subscriber: @RainerTrummer

Also from our side at the studio a very much longed for modifier! Are there plans to go ahead with this proposal?

Also from our side at the studio a very much longed for modifier! Are there plans to go ahead with this proposal?

@RainerTrummer
The dev who started this thread also unassigned and unsubscribed himself from the topic almost 3 years ago.

@RainerTrummer The dev who started this thread also unassigned and unsubscribed himself from the topic almost 3 years ago.

Removed subscriber: @MarcClintDion

Removed subscriber: @MarcClintDion

I'm the one who started this thread, and as @RainerTrummer says, I am not a blender developper anymore. Back in 2014, it seemed any work on new modifiers was prohibited because a change of paradigm towards node-based modifiers was envisaged. I had built a 'randomizer' modifier that was trashed for that reason.

In case anyone starts working on this again, I have some thoughts to share regarding the remove double algorithm, whether its part of a standalone modifier or embedded in other modifiers such as the array modifier. The current algorithm builds a list of all vertices, sorted on s = x+y+z, then scans this list. It looks like a 3 dimensional problem has been magically transformed into a one dimensional problem, but this is a total illusion: you might just as well sort all vertices on x, then scan the list. Working on the sum has merely changed the main axis through which vertices are compared for distance. In the end, for each value of s (or of x), you need to loop through all vertices that are within epsilon of s. It is not far from o(N^2).

The algorithm I had in mind back then was very different, and I believe it could be much faster when the number of vertices is large. It goes like this. You divide the whole space in little cubes of size epsilon. For each vertex, you determine to which little cube it belongs and you build a hashmap where the key is made of the coordinates of the cube, and the value is a list of vertices that are inside this cube. So for N vertices, this is o(N). Then you do another scan of vertices and for each vertex, you will retrieve the vertices that are in the same cube or in one of the 27-1 adjacent cubes. You will compare the distance for each of these candidate doubles.

If someone wants to start work on this, I hope this can help.

I'm the one who started this thread, and as @RainerTrummer says, I am not a blender developper anymore. Back in 2014, it seemed any work on new modifiers was prohibited because a change of paradigm towards node-based modifiers was envisaged. I had built a 'randomizer' modifier that was trashed for that reason. In case anyone starts working on this again, I have some thoughts to share regarding the remove double algorithm, whether its part of a standalone modifier or embedded in other modifiers such as the array modifier. The current algorithm builds a list of all vertices, sorted on s = x+y+z, then scans this list. It looks like a 3 dimensional problem has been magically transformed into a one dimensional problem, but this is a total illusion: you might just as well sort all vertices on x, then scan the list. Working on the sum has merely changed the main axis through which vertices are compared for distance. In the end, for each value of s (or of x), you need to loop through all vertices that are within epsilon of s. It is not far from o(N^2). The algorithm I had in mind back then was very different, and I believe it could be much faster when the number of vertices is large. It goes like this. You divide the whole space in little cubes of size epsilon. For each vertex, you determine to which little cube it belongs and you build a hashmap where the key is made of the coordinates of the cube, and the value is a list of vertices that are inside this cube. So for N vertices, this is o(N). Then you do another scan of vertices and for each vertex, you will retrieve the vertices that are in the same cube or in one of the 27-1 adjacent cubes. You will compare the distance for each of these candidate doubles. If someone wants to start work on this, I hope this can help.

Added subscriber: @softyoda

Added subscriber: @softyoda

Added subscriber: @FinbarrORiordan

Added subscriber: @FinbarrORiordan

Added subscriber: @Dspazio

Added subscriber: @Dspazio

Added subscriber: @Mantissa

Added subscriber: @Mantissa

Added subscriber: @NoahJamesBradleySmith-2

Added subscriber: @NoahJamesBradleySmith-2

Added subscriber: @lemenicier_julien

Added subscriber: @lemenicier_julien

Added subscriber: @Ariel-Tavori

Added subscriber: @Ariel-Tavori

Added subscriber: @Alesk

Added subscriber: @Alesk

Yo !
Any hope to see this done one day ?

Yo ! Any hope to see this done one day ?

Added subscriber: @item412

Added subscriber: @item412

Added subscriber: @joedanimation

Added subscriber: @joedanimation
Member

Added subscriber: @HDMaster84

Added subscriber: @HDMaster84
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Henrik D. self-assigned this 2020-01-11 15:27:48 +01:00
Member

This is now implemented in Blender with the new Weld Modifier.

This is now implemented in Blender with the new Weld Modifier.
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
36 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#41748
No description provided.