improve polyhedron child alignment to face edge

This commit is contained in:
Adrian Mariano 2021-12-29 18:21:12 -05:00
parent 6e2929ff9b
commit 13096a8874

View file

@ -344,12 +344,12 @@ module regular_polyhedron(
$center = -mean(facepts); $center = -mean(facepts);
cfacepts = move($center, p=facepts); cfacepts = move($center, p=facepts);
$face = rotate_children $face = rotate_children
? path2d(rot(from=face_normals[i], to=[0,0,1], p=cfacepts)) ? path2d(frame_map(z=face_normals[i], x=facepts[0]-facepts[1], reverse=true, p=cfacepts))
: cfacepts; : cfacepts;
$faceindex = i; $faceindex = i;
translate(-$center) translate(-$center)
if (rotate_children) { if (rotate_children) {
rot(from=[0,0,1], to=face_normals[i]) frame_map(z=face_normals[i], x=facepts[0]-facepts[1])
children(i % $children); children(i % $children);
} else { } else {
children(i % $children); children(i % $children);