fix sketch normal, extrude to match sketch normal

This commit is contained in:
Stewart Allen 2024-07-27 00:39:23 -04:00
commit f36808c160
2 changed files with 14 additions and 12 deletions

View file

@ -408,9 +408,11 @@ function space_init(data) {
// set focus on intersected face
const { x, y, z } = int.point;
// rotate normal using group's matrix
const normal = shiftKey ? int.face.normal : undefined;
const normal = shiftKey ? int.face.normal.clone(): undefined;
// ransform the normal to align with sketch group
normal?.transformDirection(int.object.sketch.group.matrix);
// y,z swap due to world rotation for orbit controls
api.focus({center: { x, y:-z, z:y }, normal});
api.focus({ center: { x, y:-z, z:y }, normal });
} else {
selection.toggle(sketch);
}