Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dimensions in svg export [WIP] #210

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions modules/gems/exportTextData.js

This file was deleted.

5 changes: 5 additions & 0 deletions modules/gems/exportTextData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { saveAs } from "file-saver";

export default function (data: string, fileName: string) {
saveAs(new File([data], fileName, { type: "text/plain;charset=utf-8" }));
}
154 changes: 150 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@babel/preset-stage-2": "^7.8.3",
"@babel/preset-typescript": "^7.22.15",
"@tauri-apps/cli": "^1.4.0",
"@types/file-saver": "^2.0.7",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -70,6 +71,7 @@
"less-loader": "^11.1.3",
"raw-loader": "^4.0.2",
"style-loader": "^3.3.3",
"ts-loader": "^9.5.1",
"typescript": "^4.9.5",
"url-loader": "^4.1.1",
"wait-on": "^6.0.1",
Expand All @@ -80,14 +82,15 @@
"dependencies": {
"@dxfjs/parser": "^0.2.0",
"@react-icons/all-files": "^4.1.0",
"@tarikjabiri/dxf": "^2.8.9",
"@tarikjabiri/dxf": "^3.0.0-alpha.11",
"@tauri-apps/api": "^1.4.0",
"@types/three": "^0.146.0",
"browser-xml2js": "^0.4.19",
"classnames": "^2.3.2",
"clipper-lib": "^6.4.2",
"core-js": "^3.32.2",
"earcut": "^2.2.4",
"file-saver": "^2.0.5",
"font-awesome": "4.7.0",
"immer": "^9.0.21",
"jsketcher-occ-engine": "1.0.1-f505cdcb9f37685cdadb937bc3b11b9b75f9267c",
Expand Down
10 changes: 5 additions & 5 deletions web/app/cad/actions/usabilityActions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vector, {AXIS, ORIGIN} from 'math/vector';
import {RiCamera2Line} from "react-icons/ri";
import {ViewMode} from "cad/scene/viewer";
import {GiCube, HiCube, HiOutlineCube} from "react-icons/all";
import {GiCube, HiCube, HiOutlineCube} from "react-icons";

const NEG_X = AXIS.X.negate();
const NEG_Y = AXIS.Y.negate();
Expand All @@ -21,7 +21,7 @@ function faceAt(shells, shell, pos) {
let i = shellIndex;
do {
i = (i + 1) % shells.length;
shell = shells[i];
shell = shells[i];
} while(shellIndex !== i && shell.faces.length === 0);
return shell.faces[0];
} else if (pos < 0) {
Expand All @@ -32,7 +32,7 @@ function faceAt(shells, shell, pos) {
} while(shellIndex !== i && shell.faces.length === 0);
return shell.faces[shell.faces.length - 1];
} else {
return shell.faces[pos];
return shell.faces[pos];
}
}

Expand All @@ -41,7 +41,7 @@ function getCurrentSelectedOrFirstFace(ctx) {
if (!face) {
for (const shell of ctx.services.cadRegistry.shells) {
if (shell.faces.length !== 0) {
return shell.faces[0];
return shell.faces[0];
}
}
}
Expand All @@ -62,7 +62,7 @@ export default [
ctx.services.viewer.zoomOut();
ctx.services.viewer.requestRender();
}
},
},
{
id: 'LookAtFace',
appearance: {
Expand Down
Loading