game.models.half-edge: additional vertex-diagonals word

db4
Joe Groff 2010-04-28 18:52:40 -07:00
parent 84c79879df
commit 0aff35bfee
2 changed files with 6 additions and 0 deletions

View File

@ -62,5 +62,8 @@ connect-cube-edges
[ { 1 4 2 } ] [ { 1 4 2 } ]
[ cube-edges first vertex-neighbors ] unit-test [ cube-edges first vertex-neighbors ] unit-test
[ { 3 5 6 } ]
[ cube-edges first vertex-diagonals ] unit-test
[ { 1 4 3 5 } ] [ { 1 4 3 5 } ]
[ cube-edges first face-neighbors ] unit-test [ cube-edges first face-neighbors ] unit-test

View File

@ -37,6 +37,9 @@ TUPLE: edge < identity-tuple face vertex opposite-edge next-edge ;
: vertex-neighbors ( edge -- edges ) : vertex-neighbors ( edge -- edges )
[ opposite-edge>> vertex>> ] [ each-vertex-edge ] (collect) ; [ opposite-edge>> vertex>> ] [ each-vertex-edge ] (collect) ;
: vertex-diagonals ( edge -- edges )
[ next-edge>> opposite-edge>> vertex>> ] [ each-vertex-edge ] (collect) ;
: vertex-valence ( edge -- count ) : vertex-valence ( edge -- count )
[ each-vertex-edge ] (count) ; [ each-vertex-edge ] (count) ;