Notifications
Clear all
[Closed] Exporting the visible edges
Jan 17, 2006 6:14 pm
Hi.
I would like to export the visible edges (its vertex positions) with MaxScript.
Please, would anybody know how to select the vertex positions of all visible edges and print them in the Listener?
Thank you much in advance
5 Replies
4 Replies
fn printVisibleEdges theObj =
(
theVisibleEdges = #()
theMesh = snapshotAsMesh theObj
theCount = theMesh.numfaces
format "% Faces, % Edges Total " theCount (theCount*3)
for f = 1 to theCount do
(
theFace = getFace theMesh f
theVert1 = getVert theMesh theFace.x
theVert2 = getVert theMesh theFace.y
theVert3 = getVert theMesh theFace.z
if getEdgeVis theMesh f 1 do append theVisibleEdges #(theVert1, theVert2)
if getEdgeVis theMesh f 2 do append theVisibleEdges #(theVert2, theVert3)
if getEdgeVis theMesh f 3 do append theVisibleEdges #(theVert3, theVert1)
)
delete theMesh
format "% Visible Edges
" theVisibleEdges.count
theVisibleEdges
)
print (printVisibleEdges $)
This prints the visible edges as arrays of 2 vertex positions. You can change the output as you want or write to a file…
Bobo, is there something in the world that you can not do with MaxScript?!
Thank you very much!