PDA

View Full Version : about get uvw Index of Vertex


leeriver
08-14-2006, 01:39 PM
hi all!
I want get all equals Index of Vertex, and then use function $.unwrap_uvw.unwrap.selectVertices() select equals index of vertex , and use function $.unwrap_uvw.unwrap.weldSelected() weld equals index of vertex.

problem : I can't get uvw index of vertex ,i try use function $.unwrap_uvw.getVertexIndexFromFace and $.unwrap_uvw.getVertexGeomIndexFromFace unsucceed.
:( sorry for my bad english!!!
Any suggest would be greatly appreciated!

http://www.cgsir.com/temp/01.jpg

http://www.cgsir.com/temp/02.jpg

http://www.cgsir.com/temp/03.jpg

follow source
-----------------------------------------------

/*
* author: leeriver
* e_mail: liyingjiang@21cn.com
*/
debug=createFile "c:/temp/debug.log"
global array_ploys = #()
global array_points = #()
global array_geompoints = #()
function weld_point weldPoint =
(
weldPoint = weldPoint as bitArray
$.unwrap_uvw.unwrap.selectVertices weldPoint
$.unwrap_uvw.unwrap.weldSelected()
)
function fn_string str_src str_des =
(
src_nums = str_src.count
des_nums = str_des.count
abc = 0
for i=1 to src_nums do
(
local weld_nums=#()
if str_des[i]==abc then
continue
local tmp = str_des[i]
for j=1 to des_nums do
(
if i!=j then
(
if tmp==str_des[j] then
(
if str_des[j]!=abc then
(
append weld_nums str_src[j]
str_des[j]=abc
)
)
)
)
print weld_nums to:debug
print "=====================" to:debug
if weld_nums.count >1 then
weld_point weld_nums
)
)

rollout weldDlg "weld_e" width:162 height:300
(
button btn_weld "weld_vertex" pos:[32,28] width:83 height:20
on btn_weld pressed do
(
$.unwrap_uvw.setTVSubObjectMode(3)
$.unwrap_uvw.selectElement()
array_ploys = $.unwrap_uvw.unwrap.getSelectedPolygons()
for props in array_ploys do
(
local nPoints
nPoints = $.unwrap_uvw.numberPointsInFace(props)

for i=1 to nPoints do
(
local strp
local strg
strp = $.unwrap_uvw.getVertexIndexFromFace props i
strg = $.unwrap_uvw.getVertexGeomIndexFromFace props i
append array_points strp
append array_geompoints strg
)
)
fn_string array_points array_geompoints
)
)
createDialog weldDlg 200 100

CGTalk Moderation
08-14-2006, 01:39 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.