Notifications
Clear all

[Closed] Exporting the visible edges

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
(@bobo)
Joined: 11 months ago

Posts: 0

EditablePoly or EditableMesh?
(BIG difference…)

(@magictoy)
Joined: 11 months ago

Posts: 0

EditableMesh

Thanks in advance!

(@bobo)
Joined: 11 months ago

Posts: 0

  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…

(@magictoy)
Joined: 11 months ago

Posts: 0

Bobo, is there something in the world that you can not do with MaxScript?!

Thank you very much!

Of course there are things, but you keep on asking the simple questions