Handbook
Glossary
vertex-points ( vertices edge-indices face-indices edge-pts face-points -- vertex-pts )
Vocabulary
euler
.
b-rep
.
subdivision
Inputs
vertices
an
object
edge-indices
an
object
face-indices
an
object
edge-pts
an
object
face-points
an
object
Outputs
vertex-pts
an
object
Definition
USING:
accessors
assocs
game.models.half-edge
math
math.vectors
math.vectors.simd.cords
sequences
;
IN:
euler.b-rep.subdivision
::
vertex-points
( vertices edge-indices face-indices edge-pts face-points -- vertex-pts )
vertices
[|
vertex |
0
double-4{
0.0 0.0 0.0 0.0
}
double-4{
0.0 0.0 0.0 0.0
}
vertex
edge>>
[|
valence face-sum edge-sum edge |
valence 1
+
face-sum edge
face>>
face-indices
at
face-points
nth
position>>
v+
edge-sum edge
next-edge>>
vertex>>
position>>
v+
]
each-vertex-edge
:>
( valence face-sum edge-sum ) valence
>float
:>
fvalence face-sum fvalence
v/n
:>
face-avg edge-sum fvalence
v/n
:>
edge-avg face-avg edge-avg
v+
vertex
position>>
fvalence 2.0
-
v*n
v+
fvalence
v/n
<vertex>
]
map
;
inline