Welding points on mesh (not boundary)

Discussions regarding modelling with SOFTIMAGE©
Xsinode
Posts: 26
Joined: 06 Sep 2013, 17:08

Welding points on mesh (not boundary)

Post by Xsinode » 12 Feb 2015, 17:37

I want weld point on one single mesh (share the same position).
I find one old script (WeldMesh v1.1) but script dont work.
Please help

Code: Select all

'----------------------------------------------------------------------
'
'WeldMesh v1.1 / Andrй Adam
'
'Welds all points that share the same position on a polymesh object.
'
'----------------------------------------------------------------------
Set oSelection = Selection
If oSelection.Count = 1 Then
If oSelection(0).Type = "polymsh" Then
Do
Found = False
oVertices = oSelection(0).ActivePrimitive.Geometry.Points.PositionArray
i = 0
While (i < UBound(oVertices, 2)) And Not Found
Vertice1X = Round(oVertices(0, i), 3)
Vertice1Y = Round(oVertices(1, i), 3)
Vertice1Z = Round(oVertices(2, i), 3) j = i + 1 While (j < UBound(oVertices, 2)) And Not Found Vertice2X = Round(oVertices(0, j), 3)
Vertice2Y = Round(oVertices(1, j), 3)
Vertice2Z = Round(oVertices(2, j), 3)
If Vertice1X = Vertice2X And Vertice1Y = Vertice2Y And Vertice1Z 
Vertice2Z Then
ApplyTopoOp "WeldPoints", oSelection(0) & ".pnt[" & i & ", " & j &
"]"
Found = True
End If
j = j + 1
Wend
i = i + 1
Wend
Loop While Found
Else
LogMessage "Wrong Selection", siError
End If
Else
LogMessage "Wrong Selection", siError
End If

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Welding points on mesh (not boundary)

Post by Daniel Brassard » 12 Feb 2015, 18:11

You are missing the equality sign at the end of the if

It should be

Code: Select all

If Vertice1X = Vertice2X And Vertice1Y = Vertice2Y And Vertice1Z = Vertice2Z Then
This is an old visual basic script tested on XSI 1.5
Surely their is something better today. Did you try to select your object and execute the command modify>polygon >weld point > weld point closer than with a very low threshold like .001

There is even an ICE topo script.
Last edited by Daniel Brassard on 12 Feb 2015, 19:01, edited 7 times in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

julius
Posts: 248
Joined: 12 Jun 2009, 08:56

Re: Welding points on mesh (not boundary)

Post by julius » 12 Feb 2015, 18:11

did you tried the "filter points" option instead of scripting this ?

Xsinode
Posts: 26
Joined: 06 Sep 2013, 17:08

Re: Welding points on mesh (not boundary)

Post by Xsinode » 12 Feb 2015, 18:22

to Daniel Brassard
Ok. But i have error in 11 line

to julius
Which filter you mean? And what's next? I have mesh with around 10 similar places. If I select all needed pints and use Weild Boundary Points/Edges it's don't work. Sorry for bad english

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Welding points on mesh (not boundary)

Post by Daniel Brassard » 12 Feb 2015, 18:30

Copy and check the code I posted above.

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

Xsinode
Posts: 26
Joined: 06 Sep 2013, 17:08

Re: Welding points on mesh (not boundary)

Post by Xsinode » 12 Feb 2015, 18:41

Daniel Brassard
Ok. I dont know why, but when I use you code i have ERROR in - [line 18] but thanks for help anyway.

to julius
Thanks man i understand you. Just I dont know about Filter Points tool. I'm so stupid sorry... :(
Softimage great software but not intuitive in some places for me.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Welding points on mesh (not boundary)

Post by Daniel Brassard » 12 Feb 2015, 18:58

OK.

Just in case you want to try it again

Code: Select all

'----------------------------------------------------------------------
'
'WeldMesh v1.1 / André Adam
'
'Welds all points that share the same position on a polymesh object.
'
'----------------------------------------------------------------------
Set oSelection = Selection
If oSelection.Count = 1 Then
If oSelection(0).Type = "polymsh" Then
	Do
	Found = False
	oVertices = oSelection(0).ActivePrimitive.Geometry.Points.PositionArray
	i = 0
		While (i < UBound(oVertices, 2)) And Not Found
			Vertice1X = Round(oVertices(0, i), 3)
			Vertice1Y = Round(oVertices(1, i), 3)
			Vertice1Z = Round(oVertices(2, i), 3) 
			j = i + 1 
			While (j < UBound(oVertices, 2)) And Not Found
				Vertice2X = Round(oVertices(0, j), 3)
				Vertice2Y = Round(oVertices(1, j), 3)
				Vertice2Z = Round(oVertices(2, j), 3)
				If Vertice1X = Vertice2X And Vertice1Y = Vertice2Y And Vertice1Z = Vertice2Z Then
					ApplyTopoOp "WeldPoints", oSelection(0) & ".pnt[" & i & ", " & j & "]"
					Found = True
				End If
				j = j + 1
			Wend
			i = i + 1
			Wend
	Loop While Found
Else
LogMessage "Wrong Selection", siError
End If
Else
LogMessage "Wrong Selection", siError
End If
$ifndef "Softimage"
set "Softimage" "true"
$endif

Xsinode
Posts: 26
Joined: 06 Sep 2013, 17:08

Re: Welding points on mesh (not boundary)

Post by Xsinode » 12 Feb 2015, 19:02

BIG Thanks Daniel it working! \:D/

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Welding points on mesh (not boundary)

Post by Daniel Brassard » 12 Feb 2015, 19:09

Cheers! :D
$ifndef "Softimage"
set "Softimage" "true"
$endif

julius
Posts: 248
Joined: 12 Jun 2009, 08:56

Re: Welding points on mesh (not boundary)

Post by julius » 12 Feb 2015, 21:18

go to model menu-->modify-->poly mesh-->filter points

this filter weld all the points placed on top of each other.

Xsinode
Posts: 26
Joined: 06 Sep 2013, 17:08

Re: Welding points on mesh (not boundary)

Post by Xsinode » 12 Feb 2015, 22:11

julius
Big thanks to you, I'm already find this tool. (see my post above)

julius
Posts: 248
Joined: 12 Jun 2009, 08:56

Re: Welding points on mesh (not boundary)

Post by julius » 12 Feb 2015, 22:13

ok, sorry, didn't understand.
;)