Skip to content
Snippets Groups Projects
Commit dae2e76f authored by Jakob Yanagibashi's avatar Jakob Yanagibashi :nail_care_tone4:
Browse files

Merge branch 'dev' into 'main'

Implement "Jump to" shortcut

See merge request !1
parents 7e81177c c21a4d96
No related branches found
No related tags found
1 merge request!1Implement "Jump to" shortcut
Pipeline #260490 passed
......@@ -4,8 +4,12 @@ before_script:
- export COMMIT_TIME=$(git show -s --format=%ct $CI_COMMIT_SHA)
- npm ci
deploy:
production:
script:
# Switch to main branch
- git fetch origin main
- git checkout main
# Build for production
- npm run build
- cp -a dist/. public/
......@@ -34,6 +38,10 @@ deploy:
pages:
script:
# Switch to dev branch
- git fetch origin dev
- git checkout dev
# Build for GitLab Pages
- npm run build-gitlab
- cp -a dist/. public/
......@@ -45,5 +53,5 @@ pages:
paths:
- public
expire_in: "500"
except:
- main
only:
- dev
# Tailorbird
Easy but powerful tool to aid with manual G-code creation for 3D printers. Including 6-axis robot arm support. Please note that this currently is not yet finished and actively being worked on.
# Installation
Just clone the repository and open the index.htm file in a web browser.
# Dependencies
Currently some dependencies are loaded automatically from CDN. We aim to change this before 1.0 release.
# Tailorbird
Easy but powerful tool to aid with manual G-code creation for 3D printers. Including 6-axis robot arm support. Please note that this currently is not yet finished and actively being worked on.
## Testing Environment
https://kg.pages.git-ce.rwth-aachen.de/tailorbird
If you commit and push to `dev` branch, the CI will build from the newest commit belonging to that branch and upload the output to above GitLab Pages server. This should be considered public, but the URL is not advertised to students so there's no risk of breaking anybody's projects.
## Production
https://tailorbird3d.rwth-aachen.de/
If you commit and push to `main` branch, the CI will build from the newest commit belonging to that branch and upload the output to FH Aachen administered web server with vanity URL from RWTH Aachen. This should be considered public.
\ No newline at end of file
......@@ -16,7 +16,7 @@ var aboutText = `
`;
if (import.meta.env.VITE_APP_BRANCH == "dev") {
aboutText = `
<i class="fa-solid fa-kiwi-bird fa-bounce"></i> BETA</h1>
<i class="fa-solid fa-kiwi-bird fa-bounce"></i> TESTING</h1>
<p>Version: ${ import.meta.env.VITE_APP_DATE }
(${ import.meta.env.VITE_APP_BRANCH }
${ import.meta.env.VITE_APP_HASH })</p>
......@@ -128,6 +128,7 @@ document.querySelector("#app").innerHTML = `
<li><i class="fa-solid fa-left-right"></i> <span class="helpControlText">Rotate horizontally: Drag</span></li>
<li><i class="fa-solid fa-up-down"></i> <span class="helpControlText">Rotate vertically: Shift+Drag</span></li>
<li><i class="fa-solid fa-up-down-left-right"></i> <span class="helpControlText">Move: Opt/Alt+Drag</span></li>
<li><i class="fa-solid fa-share fa-rotate-90"></i> <span class="helpControlText">Jump to: O</span></li>
</ul>
</p>
<form method="dialog">
......@@ -513,14 +514,14 @@ function removeSelectedCommand() {
/* 3D & UI */
function initIllo() {
window.illo = new Zdog.Illustration({
element: ".zdog-canvas",
scale: 10,
centered: false,
translate: { x: 400, y: 400 },
resize: true,
rotate: { x: Zdog.TAU * 0.2 },
});
// Wheel (zoom)
window.illo.element.addEventListener("wheel", (e) => {
e.preventDefault();
......@@ -535,6 +536,7 @@ function initIllo() {
1 - Math.max(Math.min(e.deltaY / 40, 0.9), -0.9)
);
});
// Drag (move)
window.viewRotation = new Zdog.Vector();
new Zdog.Dragger({
......@@ -569,6 +571,25 @@ function initIllo() {
},
});
// O button (jump to)
window.addEventListener("keydown", (event) => {
if (event.isComposing || event.key !== "o" || !window.selectedListEntries[0]) {
return;
}
const jumpCmd = window.selectedListEntries[0];
if (!"goalx" in jumpCmd || !"goaly" in jumpCmd) {
return;
}
var illoTrans = new Zdog.Vector({
x: -jumpCmd.goaly.value * window.illo.scale.x,
y: -jumpCmd.goalx.value * window.illo.scale.y,
z: -jumpCmd.goalz.value * window.illo.scale.z,
});
illoTrans.rotate(window.illo.rotate);
console.log("jump to X: " + illoTrans.x + ", Y: " + illoTrans.y);
window.illo.translate = illoTrans;
});
window.currentProject.renderAll();
animateIllo();
......@@ -740,7 +761,7 @@ function initEditEventListeners() {
}
// Add selection
if (e.target && e.target.matches("li")) {
window.selectedListEntry = e.target;
//window.selectedListEntry = e.target; TEST for removal
e.target.command.addSelection();
window.selectedListEntries.push(e.target.command);
}
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment