Я хочу получить положения краев многоугольника 3Ds Max с помощью maxscript
. Я пробовал следующее:
tmesh = snapshotAsMesh selection[1]
out_name = ((GetDir #export)+"/testmesh.dat")
out_file = createfile out_name
num_verts = tmesh.numverts
num_faces = tmesh.numfaces
format "% % %\n" num_verts num_faces to:out_file
for v = 1 to num_verts do
(
vert = getVert tmesh v
format "%," vert to:out_file
)
format "\n" to:out_file
for f = 1 to num_faces do
(
face = getFace tmesh f
format "%," face to:out_file
)
close out_file
delete tmesh
edit out_name
Вывод должен быть чем-то вроде формата файла OBJ, но я хочу, чтобы в каркасе отображались только краевые соединения.
Пример вывода:
[0,0,0],[1,0,0],[0,1,0],[1,1,0]
[1,2],[2,3],[3,4],[4,1]
РЕДАКТИРОВАТЬ: с помощью этого кода я мог найти невидимые края.
for f = 1 to num_faces do
(
face = getFace tmesh f
edge1 = getEdgeVis tmesh f 1
edge2 = getEdgeVis tmesh f 2
edge3 = getEdgeVis tmesh f 3
format "%,[%,%,%]" face edge1 edge2 edge3 to:out_file
format "\n" to:out_file
)