Weld large complicated meshes

I need a script that can incrementally weld through large complicated meshes without crashing. Is this possible?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

try this too

fn WeldMesh obj split: thresh: = (
	if thresh == unsupplied or thresh <= 0 do thresh = .01
	if split  == unsupplied or split < 1 do split = 1
 
	if not isKindOf obj Editable_Mesh do
		if canConvertTo obj Editable_Mesh do
			convertToMesh obj
 
	if isKindOf obj Editable_Mesh do (
		local _openEdges = meshop.getOpenEdges
		local _EdgeVerts = meshop.getVertsUsingEdge
		local _weldVerts = meshop.weldVertsByThreshold
 
		local vList = _EdgeVerts obj (_openEdges obj)
 
		if split == 1 then _weldVerts obj vList thresh
		else (
			-- your own implementation does here...
		)
	)
)

my recent MAXScripts RSS (archive here)

barigazy's picture

Hi Anubis, Maybe i'm wrong

Hi Anubis,
Maybe i'm wrong but converting hires objects to mesh in this case can slow down the process.What do you think?

barigazy

Anubis's picture

Yes, sure

But as the question was about meshes,
I just make the function user friendly.

my recent MAXScripts RSS (archive here)

barigazy's picture

Do you mean attach hi-res

Do you mean attach hi-res meshes?

barigazy

jininjin's picture

no not attaching meshes. I

no not attaching meshes. I need to weld one large triangulated mesh. Welding as it is takes forever or crashes since there is a lot of vertices to weld.

barigazy's picture

weldByThreshold

This is the simple function that works on editable poly and mesh objects. Maybe this can help but not sure.

fn weldByThreshold thresh: = if selection.count != 0 do
(
	local polyWeld = polyop.weldVertsByThreshold
	local meshWeld = meshop.weldVertsByThreshold
	for i = 1 to selection.count where isKindOf selection[i] Editable_Poly or isKindOf selection[i] Editable_Mesh do
	(
		vertslist = #{1..(selection[i].Verts.count)}
		if not isKindOf selection[i] Editable_Poly then meshWeld selection[i] vertslist thresh else
		(
			selection[i].weldThreshold = thresh
			polyWeld selection[i] vertslist
		)
	)
)
weldByThreshold thresh:0.01

barigazy

barigazy's picture

Another recommended method is

Another recommended method is to detach your mesh in several parts, use this function on individual parts, then attach piece by piece select open edges and convert selection to vertex and then use weld operation from command panel. This is better then do it all at once.

barigazy

jininjin's picture

Thanks I think this is what I

Thanks I think this is what I will have to do. Make selections by a grid and weld small groups at a time. Although this may still take a long time....

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.