experimental attach sketch to face

This commit is contained in:
Stewart Allen 2024-07-27 00:51:31 -04:00
commit 96b111e463

View file

@ -373,6 +373,18 @@ function space_init(data) {
const normal = shiftKey ? int.face.normal.applyQuaternion(q) : undefined; const normal = shiftKey ? int.face.normal.applyQuaternion(q) : undefined;
// y,z swap due to world rotation for orbit controls // 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});
let one = api.sketch.selection.one;
if (one && confirm('attach sketch to face?')) {
one.center = {
x, y: -z, z: y
};
one.normal = {
x: normal.x,
y: normal.y,
z: normal.z
};
one.render();
}
} else if (ctrlKey) { } else if (ctrlKey) {
// rotate selected face towawrd z "floor" // rotate selected face towawrd z "floor"
group.faceDown(int.face.normal); group.faceDown(int.face.normal);