[Closed] Display Open Edges
I want to display open edges in the viewport but I cannot figure out the best way to do it. I have been messing with the viewport drawing methods but I cannot get anything to display. I am also having problems getting the 3d coords to work on the 2d screen coordsys. Any ideas on how to do this? Here is a shot of what i want taken from a xsi screenshot
Made alittle head way but having problems with the vert order and I dont even know where to start on how to get it to cull out the lines if a poly is infront of it. Heres my code and a pic
(
OpenEdges=polyop.getopenedges $ as array
PolyLinePos=#()
gw.setTransform $.transform
for i in 1 to OpenEdges.count do
(
EdgeVerts=polyop.getvertsusingedge $ OpenEdges[i] as array
for v in 1 to EdgeVerts.count do
(
VertPos=polyop.getvert $ EdgeVerts[v]
thePos= VertPos
append PolyLinePos thePos
)
)
gw.setcolor #line (color 2 228 240)
gw.polyline PolyLinePos false
--print PolyLinePos[3]
gw.enlargeUpdateRect #whole
gw.updateScreen()
)
Hey, instead of trying to get the vertex order correct, how about take each one that you do know, and make it a two point line. The end result will look the same, without having to worry about the vertex order.
(
OpenEdges=polyop.getopenedges $ as array
gw.setTransform $.transform
gw.setcolor #line (color 2 228 240)
for i in 1 to OpenEdges.count do
(
PolyLinePos=#() -- clear array for every vertex pair
EdgeVerts=polyop.getvertsusingedge $ OpenEdges[i] as array
for v in 1 to EdgeVerts.count do
(
VertPos=polyop.getvert $ EdgeVerts[v]
append PolyLinePos VertPos
)
gw.polyline PolyLinePos false -- make each set of verts it's own polyline
)
gw.enlargeUpdateRect #whole
gw.updateScreen()
)
ahh thanks… Didnt think of that. Im not a very advanced scripter… i just kinda punch stuff and see if it works… I need to think it out a bit more. Thanks for the help.