[ opposite-n edge-pts set-nth-unsafe ] bi
] when
] each-index
-
+
edge-pts ; inline
:: vertex-points ( vertices edge-indices face-indices edge-pts face-points -- vertex-pts )
] map ; inline
TYPED:: subdivide ( brep: b-rep -- brep': b-rep )
- brep vertices>> :> vertices
+ brep vertices>> :> vertices
brep edges>> :> edges
brep faces>> :> faces
face new
dup >>base-face :> fac
-
+
b-edge new
fac >>face
point-a >>vertex :> edg-a
point-d [ edg-d or ] change-edge drop
] each-vertex-edge
] each
-
+
b-rep new
sub-faces { } like >>faces
sub-edges { } like >>edges