added polybool library

This commit is contained in:
GColoy
2023-09-16 21:06:34 +02:00
parent a937b5d70a
commit 0d7a76310c
3 changed files with 13 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
"gl-matrix": "^3.4.3",
"lz-string": "^1.5.0",
"monkey-around": "^2.3.0",
"polybooljs": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"roughjs": "^4.5.2",

View File

@@ -77,6 +77,7 @@ import { ROUNDNESS } from "src/constants";
import { ClipboardData } from "@zsviczian/excalidraw/types/clipboard";
import { emulateKeysForLinkClick, KeyEvent, PaneTarget } from "src/utils/ModifierkeyHelper";
import { Mutable } from "@zsviczian/excalidraw/types/utility-types";
import { Polybool } from "polybooljs";
extendPlugins([
HarmonyPlugin,
@@ -2261,6 +2262,16 @@ export class ExcalidrawAutomate {
return CM(color);
}
/**
* Gets the class Polybool from https://github.com/velipso/polybooljs
* @returns
*/
getPolybool() {
const defaultEpsilon = 0.0000000001;
Polybool.epsilon(defaultEpsilon);
return Polybool;
}
importSVG(svgString:string):boolean {
const res:ConversionResult = svgToExcalidraw(svgString);
if(res.hasErrors) {

1
src/polybooljs.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module "polybooljs";