bill 2 місяців тому
батько
коміт
76f7fe8b5b

+ 3 - 0
public/styles/style-1.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M22.4142 6.41421C21.1543 5.15428 19 6.04662 19 7.82843V11H3C1.89543 11 1 11.8954 1 13V19C1 20.1046 1.89543 21 3 21H19V24.1716C19 25.9534 21.1543 26.8457 22.4142 25.5858L30.5858 17.4142C31.3668 16.6332 31.3668 15.3668 30.5858 14.5858L22.4142 6.41421Z" stroke="white"/>
+</svg>

Різницю між файлами не показано, бо вона завелика
+ 4 - 0
public/styles/style-10.svg


Різницю між файлами не показано, бо вона завелика
+ 3 - 0
public/styles/style-11.svg


+ 8 - 0
public/styles/style-12.svg

@@ -0,0 +1,8 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="7" cy="16" r="6" stroke="white" stroke-linecap="round"/>
+<path d="M13 16H22" stroke="white" stroke-linecap="round"/>
+<path d="M15 16L19.5 9" stroke="white" stroke-linecap="round"/>
+<path d="M22 16L30 10" stroke="white" stroke-linecap="round"/>
+<path d="M22 16L30 22" stroke="white" stroke-linecap="round"/>
+<path d="M15 16L19.5 23" stroke="white" stroke-linecap="round"/>
+</svg>

+ 3 - 0
public/styles/style-13.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M31 14.5L23.5 12L1 12V14.5L15.75 14.5V17H23.5L31 20.125V14.5Z" stroke="white"/>
+</svg>

+ 3 - 0
public/styles/style-14.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M1 7H31V24.7273H25.5455V17.9091H17.3636V11.0909H1V7Z" stroke="white"/>
+</svg>

+ 5 - 0
public/styles/style-15.svg

@@ -0,0 +1,5 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M5.99951 24.4H25.5995V25.8H5.99951V24.4Z" stroke="white"/>
+<path d="M5.99951 27.2H25.5995V30H5.99951V27.2Z" stroke="white"/>
+<path d="M25.6 23C18.25 23 11.5125 23 6 23C6 11.402 10.3876 2 15.8 2C21.2124 2 25.6 11.402 25.6 23Z" stroke="white"/>
+</svg>

+ 4 - 0
public/styles/style-16.svg

@@ -0,0 +1,4 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.99951 28.4444C4.99951 27.5853 5.69596 26.8889 6.55507 26.8889H25.2217C26.0808 26.8889 26.7773 27.5853 26.7773 28.4444V28.4444C26.7773 29.3036 26.0808 30 25.2217 30H6.55507C5.69596 30 4.99951 29.3036 4.99951 28.4444V28.4444Z" stroke="white"/>
+<path d="M5 2H26.7778V23.3333C26.7778 24.4379 25.8823 25.3333 24.7778 25.3333H7C5.89543 25.3333 5 24.4379 5 23.3333V2Z" stroke="white"/>
+</svg>

+ 6 - 0
public/styles/style-17.svg

@@ -0,0 +1,6 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2 21.8C2 21.8 6.66667 26 16 26C25.3333 26 30 21.8 30 21.8" stroke="white" stroke-linecap="round"/>
+<path d="M6.2002 5C6.2002 5 9.46686 7.8 16.0002 7.8C22.5335 7.8 25.8002 5 25.8002 5" stroke="white" stroke-linecap="round"/>
+<path d="M24.3998 15.0406C24.3998 15.0406 21.3476 18.3 15.9998 18.3C10.652 18.3 4.8999 13.63 4.8999 13.63" stroke="white" stroke-linecap="round"/>
+<path d="M9.67806 12.35L4.89697 13.6311L6.17806 18.4122" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
+</svg>

+ 3 - 0
public/styles/style-18.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M21.3332 25.3333L15.9998 30.6667L10.6665 25.3333H13.3333V12C13.3333 11.2644 12.7376 10.6679 12.0023 10.6667H6.66683V13.3333L1.3335 7.99999L6.66683 2.66666V5.33332H25.3332V2.66666L30.6665 7.99999L25.3332 13.3333V10.6667H19.9968C19.2689 10.6684 18.678 11.2534 18.6668 11.979V25.3333L21.3332 25.3333Z" stroke="white"/>
+</svg>

Різницю між файлами не показано, бо вона завелика
+ 10 - 0
public/styles/style-19.svg


+ 3 - 0
public/styles/style-2.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M1 7H24L31 16L24 25H1V7Z" stroke="white"/>
+</svg>

+ 3 - 0
public/styles/style-3.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.36788 4.15752C3.09055 2.96002 1 3.86571 1 5.61659V26.3837C1 28.1345 3.09055 29.0402 4.36788 27.8427L15.4437 17.4592C15.7192 17.2009 15.9046 17.8841 16 17.547V26.3837C16 28.1345 18.0906 29.0402 19.3679 27.8427L30.4437 17.4592C31.2865 16.6691 31.2865 15.3312 30.4437 14.5411L19.3679 4.15752C18.0906 2.96002 16 3.86571 16 5.61659V14.4532C15.9046 14.1162 15.7192 14.7993 15.4437 14.5411L4.36788 4.15752Z" stroke="white" stroke-linejoin="round"/>
+</svg>

+ 7 - 0
public/styles/style-4.svg

@@ -0,0 +1,7 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M16 1C9.92487 1 5 5.88417 5 11.9091V20.0909C5 26.1158 9.92487 31 16 31C22.0751 31 27 26.1158 27 20.0909V11.9091C27 5.88417 22.0751 1 16 1Z" stroke="white"/>
+<path d="M22.589 24C23.0056 23.586 23.3494 22.8634 23.5892 22.0724C23.8363 21.2575 24 20.2809 24 19.2872V11.9493C24 7.55904 20.4183 4 16 4C11.5817 4 8 7.55904 8 11.9493V19.2872" stroke="white" stroke-linecap="round"/>
+<path d="M19.158 25C19.3691 24.7787 19.5773 24.4084 19.7655 23.9954C19.9621 23.5636 20.1637 23.0242 20.3452 22.4156C20.7074 21.201 21 19.6756 21 18.1375V12.2757C21 9.36199 18.7459 7 15.9654 7C13.1849 7 10.9309 9.36199 10.9309 12.2757V19.3099C10.9309 19.7121 10.7309 20.1697 10.4312 20.5466C10.2856 20.7297 10.1325 20.8728 10 20.9654" stroke="white" stroke-linecap="round"/>
+<path d="M11 23.6387C11.8688 23.1095 12.4076 22.3455 12.731 21.6359C13.0614 20.9111 13.1546 20.271 13.1546 20.0347V12.9514C13.1546 11.3214 14.2393 10 15.5773 10C16.9153 10 18 11.3214 18 12.9514V20.0347C18 20.7546 17.8693 22.0023 17.4873 23.3048C17.1054 24.607 16.4554 26.0208 15.3837 27" stroke="white" stroke-linecap="round"/>
+<path d="M11.6499 26.4546C14.3052 24.4795 15.4999 22.613 15.4999 20.1818L15.5 13" stroke="white" stroke-linecap="round"/>
+</svg>

+ 8 - 0
public/styles/style-5.svg

@@ -0,0 +1,8 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M17.355 6.46922C12.6081 8.02312 9.72177 13.15 11.842 17.325C13.9622 21.5 13.9973 21.9165 13.9626 24.5139C13.9464 25.7285 13.9307 26.9029 14.6644 28.6261C16.4571 32.3235 22.6443 31.5404 23.2449 27.3977C23.2904 25.7346 22.7251 24.9238 22.1631 24.1177C20.1423 21.2191 21.2162 17.3854 22.5147 14.4016C23.0893 13.0812 23.6648 11.7586 23.8486 10.3755C24.1305 6.68419 20.7688 5.04431 17.355 6.46922Z" stroke="white"/>
+<path d="M10.0853 8.37411C11.7665 8.22761 12.251 10.9588 10.4408 11.0581C8.81045 11.1476 8.38974 8.52039 10.0853 8.37411Z" stroke="white"/>
+<path d="M11.6454 5.35831C9.75754 5.44325 10.203 8.41993 11.9518 8.35555C13.8029 8.28451 13.4293 5.28354 11.6454 5.35831Z" stroke="white"/>
+<path d="M14.7253 3.01308C12.6211 2.28966 11.8417 5.74147 13.7784 6.42183C15.8329 7.13965 16.7048 3.69243 14.7253 3.01308Z" stroke="white"/>
+<path d="M15.9476 2.99217C15.8956 3.98435 16.4747 5.0927 17.3787 5.27695C19.6047 5.74037 20.035 2.03484 17.8843 1.61332C17.1655 1.4673 15.9996 1.99999 15.9476 2.99217Z" stroke="white"/>
+<path d="M22.239 5.42914C24.8984 5.30336 24.2528 0.93033 21.7548 1.00084C19.1707 1.07359 19.7911 5.53551 22.239 5.42914Z" stroke="white"/>
+</svg>

+ 8 - 0
public/styles/style-6.svg

@@ -0,0 +1,8 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.5976 6.46922C20.3445 8.02312 23.2309 13.15 21.1106 17.325C18.9904 21.5 18.9553 21.9165 18.99 24.5139C19.0063 25.7285 19.022 26.9029 18.2883 28.6261C16.4955 32.3235 10.3084 31.5404 9.70774 27.3977C9.66227 25.7346 10.2275 24.9238 10.7895 24.1177C12.8104 21.2191 11.7364 17.3854 10.4379 14.4016C9.86337 13.0812 9.28781 11.7586 9.10404 10.3755C8.82211 6.68419 12.1838 5.04431 15.5976 6.46922Z" stroke="white"/>
+<path d="M22.8673 8.37411C21.1862 8.22761 20.7016 10.9588 22.5119 11.0581C24.1422 11.1476 24.5629 8.52039 22.8673 8.37411Z" stroke="white"/>
+<path d="M21.3073 5.35831C23.1951 5.44325 22.7497 8.41993 21.0008 8.35555C19.1497 8.28451 19.5233 5.28354 21.3073 5.35831Z" stroke="white"/>
+<path d="M18.2273 3.01308C20.3316 2.28966 21.111 5.74147 19.1743 6.42183C17.1198 7.13965 16.2478 3.69243 18.2273 3.01308Z" stroke="white"/>
+<path d="M17.0051 2.99217C17.0571 3.98435 16.478 5.0927 15.574 5.27695C13.348 5.74037 12.9176 2.03484 15.0683 1.61332C15.7872 1.4673 16.9531 1.99999 17.0051 2.99217Z" stroke="white"/>
+<path d="M10.7136 5.42914C8.05421 5.30336 8.69984 0.93033 11.1978 1.00084C13.782 1.07359 13.1615 5.53551 10.7136 5.42914Z" stroke="white"/>
+</svg>

+ 4 - 0
public/styles/style-7.svg

@@ -0,0 +1,4 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11.6461 21.4545H20.3585C20.463 22.0609 20.6519 22.6914 20.8437 23.3319C21.323 24.9319 21.8209 26.594 21.0688 28.0955C20.257 29.7318 18.8219 31 16.0386 31H15.9516C13.1683 31 11.7331 29.7455 10.9213 28.0955C10.1679 26.5599 10.6984 24.787 11.1968 23.1213C11.3682 22.5483 11.5359 21.9881 11.6461 21.4545Z" stroke="white"/>
+<path d="M9.5209 7.18095C8.70385 9.78901 9.502 12.5224 10.4421 15.0904L11.7736 18.7273H20.1322L21.6681 14.5947C22.4526 12.4838 23.1577 10.2625 22.6416 8.07382C21.8555 4.74035 19.5021 1 15.9531 1C12.6773 1 10.4776 4.12722 9.5209 7.18095Z" stroke="white"/>
+</svg>

+ 3 - 0
public/styles/style-8.svg

@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M9.37324 26.8375C10.1316 28.5454 16.515 28.5278 18.0606 28.5454C19.6062 28.5629 25.5526 26.6655 25.4143 24.5131C25.2761 22.3607 22.8222 23.1666 23.1616 20.5372C23.5011 17.9078 31.0014 15.5439 31 12.3107C30.9965 4.34316 12.5915 1.86663 8.39621 5.91796C4.20096 9.96928 10.0672 9.177 9.9129 10.5667C9.53774 13.9463 0.357382 13.6868 1.03581 17.3564C1.71425 21.026 11.3213 20.2557 12.5915 22.636C13.5931 24.5131 8.6149 25.1297 9.37324 26.8375Z" stroke="#FA3D46"/>
+</svg>

Різницю між файлами не показано, бо вона завелика
+ 8 - 0
public/styles/style-9.svg


+ 1 - 0
src/core/components/icon/temp-icon.vue

@@ -36,6 +36,7 @@ watch(
     svg.value = parseSvgContent(svgContent);
     if (svg.value.paths.length === 0) {
       svg.value = null;
+      console.error(props.data, "路径数据不正确不是svg");
     }
   },
   { immediate: true }

+ 11 - 1
src/core/components/line/use-draw.ts

@@ -65,10 +65,20 @@ export const useDraw = () => {
       if (!drawItems[0]) return;
 
       if (isTempDraw) {
+        console.log(drawItems[0].points)
         drawItems[0].lines.pop();
         drawItems[0].points.pop();
         drawItems[0].polygon.pop();
       }
+      const lastP = drawItems[0].points[drawItems[0].points.length - 1]
+      if (lastP) {
+        console.log(lastP)
+        const ctx = getInitCtx()
+        ctx.add.points[lastP.id] = lastP
+        normalLineData(drawItems[0], ctx)
+      }
+      
+
       snapInfos?.forEach(customSnapInfos.remove);
       drawSnapInfos?.forEach(customSnapInfos.remove);
       initData = hInitData.value = void 0;
@@ -374,8 +384,8 @@ export const normalLineData = (data: LineData, ctx: NLineDataCtx) => {
   }
 
   const pointIds = Object.values(ctx.del.lines).flatMap(item => [item.a, item.b])
+  pointIds.push(...Object.keys(ctx.add.points))
   const linePointIds = data.lines.flatMap(item => [item.a, item.b])
-
   for (let id of pointIds) {
     if (!linePointIds.includes(id)) {
       const ndx = data.points.findIndex(p => p.id === id)

+ 0 - 1
src/core/components/rectangle/index.ts

@@ -24,7 +24,6 @@ export const getMouseStyle = (data: RectangleData) => {
   const strokeStatus = data.stroke && getMouseColors(data.stroke);
   const strokeWidth = data.strokeWidth;
 
-  console.log(data)
   return {
     default: {
       fill: data.fill,

+ 1 - 0
src/core/components/share/size-line.vue

@@ -72,6 +72,7 @@ const lines = computed(() => {
     const baseLineVV = lineVerticalVector(baseLine);
     const sizeMargin = isClockwise.value ? margin.value : -margin.value;
     const sizeOffset = baseLineVV.clone().multiplyScalar(sizeMargin);
+
     const sizeTextStr = getWidthText(lineLen(baseLine[0], baseLine[1]));
     const sizeTextW = (fontSize.value * sizeTextStr.length) / 1.5;
     const baseLineW = lineLen(baseLine[0], baseLine[1]);

+ 0 - 1
src/core/helper/compass.vue

@@ -56,7 +56,6 @@ watch(
       data.value.height = maxWidth;
       data.value.width = (svg.width / svg.height) * maxWidth;
     }
-    console.log(data.value);
   },
   { immediate: true }
 );

+ 1 - 1
src/core/helper/split-line.vue

@@ -171,7 +171,7 @@ const rectAxisSteps = computed(() => {
 });
 
 const { transform } = useProportion();
-const getWidthText = (val: number) => Math.floor(transform(val)).toString();
+const getWidthText = (val: number) => Math.round(transform(val)).toString();
 const invConfig = useViewerInvertTransformConfig();
 const axissInfo = computed(() => {
   if (!rang.value) return;

+ 14 - 1
src/core/hook/use-dxf.ts

@@ -78,6 +78,7 @@ export const useGetDXF = () => {
       if (!pl.content) return;
       const $text = $stage.findOne<Group>(`#${pl.id}`)?.findOne<Text>(".text");
       if ($text) {
+        console.error('写入文字')
         writeText($text);
       }
     };
@@ -85,7 +86,8 @@ export const useGetDXF = () => {
     const writeText = ($text: Text, sp = true) => {
       const mat = $text.getTransform();
       const fontSize = $text.fontSize() * 0.8;
-      const text = $text.text();
+      let text = $text.text();
+      text = text.replace(/(\n|\r|\t)/ig, '')
       const pad = $text.padding();
       const align = $text.align();
       const textArr: {content: string, charCount: number}[] = [];
@@ -93,6 +95,7 @@ export const useGetDXF = () => {
       const width = $text.width();
       const charWidth = fontSize * 0.9;
 
+      console.log(text)
       const lineCharCount = sp ? Math.max(Math.floor(width / charWidth), 2) : Number.MAX_VALUE;
       let ndx = 0;
       let prevNdx = 0;
@@ -123,6 +126,7 @@ export const useGetDXF = () => {
         }
       }
 
+      console.log(textArr)
       textArr.forEach((item) => {
         const lineWidth = charWidth * item.charCount;
         let p = { x: pad, y: pad + lineNum * fontSize * 1.2 };
@@ -132,6 +136,15 @@ export const useGetDXF = () => {
           p.x = width - lineWidth;
         }
         const start = mat.point(p);
+        console.log(point3d(start.x, -start.y), fontSize, item.content, {
+          rotation: $text.rotation(),
+          // horizontalAlignment:
+          //   align === "center"
+          //     ? TextHorizontalAlignment.Center
+          //     : align === "right"
+          //     ? TextHorizontalAlignment.Right
+          //     : TextHorizontalAlignment.Left,
+        })
         const text = writer.addText(point3d(start.x, -start.y), fontSize, item.content, {
           rotation: $text.rotation(),
           // horizontalAlignment:

+ 19 - 11
src/core/hook/use-event.ts

@@ -1,6 +1,6 @@
 import { Size } from "@/utils/math.ts";
 import { listener } from "../../utils/event.ts";
-import { installGlobalVar, useStage } from "./use-global-vars.ts";
+import { globalWatch, installGlobalVar, useStage } from "./use-global-vars.ts";
 import { nextTick, reactive, ref, watch, watchEffect } from "vue";
 import { KonvaEventObject } from "konva/lib/Node";
 import { debounce } from "@/utils/shared.ts";
@@ -154,12 +154,12 @@ export const useGlobalOnlyRightClickShape = installGlobalVar(() => {
   const stage = useStage();
   const checkShapes = reactive([]) as EntityShape[];
   const events = [] as Array<((ev: MouseEvent) => void)[]>;
-  const cancels = [] as Array<(((ev: MouseEvent) => void) | undefined)[]>;
+  const cancels = [] as Array<(((ev?: MouseEvent) => void) | undefined)[]>;
 
   const addShape = (
     shape: EntityShape,
     fn: (ev: MouseEvent) => void,
-    cancel?: (ev: MouseEvent) => void
+    cancel?: (ev?: MouseEvent) => void
   ) => {
     const ndx = checkShapes.indexOf(shape);
     if (~ndx) {
@@ -173,6 +173,9 @@ export const useGlobalOnlyRightClickShape = installGlobalVar(() => {
     return () => delShape(shape, fn);
   };
   const delShape = (shape: EntityShape, fn: (ev: MouseEvent) => void) => {
+    if (shape === prevShape) {
+      cancel()
+    }
     const ndx = checkShapes.indexOf(shape);
     if (!~ndx) return;
     const evNdx = events[ndx].indexOf(fn);
@@ -185,12 +188,20 @@ export const useGlobalOnlyRightClickShape = installGlobalVar(() => {
       events.splice(ndx, 1);
     }
   };
+
+  let prevShape: EntityShape | null = null;
+  const cancel = () => {
+    if (prevShape) {
+      const prevNdx = checkShapes.indexOf(prevShape!);
+      ~prevNdx && cancels[prevNdx].forEach((fn) => fn && fn());
+      prevShape = null
+    }
+  }
+
   const init = (dom: HTMLDivElement) => {
-    let prevShape: EntityShape;
     const hasRClick = (ev: MouseEvent) => {
       let clickShape: any
       let ndx = -1
-
       if (ev.button === 2) {
         const pos = stage.value?.getNode().pointerPos;
         if (!pos) return false;
@@ -202,10 +213,7 @@ export const useGlobalOnlyRightClickShape = installGlobalVar(() => {
           }
         } while ((clickShape = clickShape?.parent));
       }
-      if (prevShape) {
-        const prevNdx = checkShapes.indexOf(prevShape!);
-        ~prevNdx && cancels[prevNdx].forEach((fn) => fn && fn(ev));
-      }
+      cancel()
       prevShape = clickShape;
       return ~ndx && events[ndx].forEach((fn) => fn(ev));
     };
@@ -213,15 +221,15 @@ export const useGlobalOnlyRightClickShape = installGlobalVar(() => {
     dom.addEventListener("contextmenu", hasRClick);
     dom.addEventListener("pointerdown", hasRClick);
     return () => {
+      cancel()
       dom.removeEventListener("contextmenu", hasRClick);
       dom.removeEventListener("pointerdown", hasRClick);
     };
   };
 
-  watch(
+  globalWatch(
     () => stage.value?.getNode().container(),
     (dom, _, onCleanup) => {
-      console.log(dom);
       if (dom) {
         onCleanup(init(dom));
       }

+ 5 - 4
src/core/hook/use-transformer.ts

@@ -14,6 +14,7 @@ import { Pos, vector } from "@/utils/math.ts";
 import { useConversionPosition } from "./use-coversion-position.ts";
 import { getOffset, listener } from "@/utils/event.ts";
 import {
+  debounce,
   flatPositions,
   frameEebounce,
   mergeFuns,
@@ -471,9 +472,7 @@ export const useShapeTransformer = <T extends EntityShape>(
 
         const stopLeaveUpdate = watch(
           data,
-          () => {
-            rep.update && rep.update();
-          },
+          debounce(() => rep.update && rep.update(), 16),
           { flush: "post", deep: true }
         );
 
@@ -624,7 +623,7 @@ export const useCustomTransformer = <T extends BaseItem, S extends EntityShape>(
         return {
           tempShape: repResult.shape,
           update: () => {
-            repResult.update && repResult.update(data.value, repResult.shape);
+              repResult.update && repResult.update(data.value, repResult.shape);
           },
           init: () => {
             repResult.init && repResult.init(data.value, repResult.shape);
@@ -686,6 +685,7 @@ export const useLineTransformer = <T extends LineTransformerData>(
   let inverAttitude: Transform;
   let stableVs = data.value.points;
   let tempVs = data.value.points;
+  const transformer = useTransformer()
 
   useCustomTransformer(shape, data, {
     openSnap: true,
@@ -727,6 +727,7 @@ export const useLineTransformer = <T extends LineTransformerData>(
         repShape.points(flatPositions(initVs));
         repShape.closed(true);
         inverAttitude = inverMat;
+        transformer.forceUpdate()
       };
       update(data.value);
 

+ 1 - 1
src/example/components/container/container.vue

@@ -13,7 +13,7 @@
           @click="draw.quitDrawShape()"
           circle
           class="h-bottom"
-          v-if="draw?.drawType === 'single-dots'"
+          v-if="draw?.drawType === 'single-dots' || draw?.drawType === 'dots'"
         >
           <template #icon>
             <icon name="pic_yes" size="32px" color="#41c732" />

+ 2 - 1
src/example/constant.ts

@@ -39,6 +39,7 @@ export const iconGroups = [
           { icon: "CombinationSofa", name: "组合沙发" },
           { icon: "ThreeSofa", name: "三人沙发" },
           { icon: "SingleSofa", name: "单人沙发" },
+          { icon: "Chair", name: "椅子" },
           { icon: "TeaTable", name: "茶几" },
           { icon: "Carpet", name: "地毯" },
           { icon: "Plant", name: "植物" },
@@ -119,5 +120,5 @@ export const aiIconMap = {
   SingleWindow: "cad-chuang",
   BayWindow: "cad-piaochuang",
   FrenchWindow: "cad-luodichuang",
-  Chair: "BalconyChair",
+  Chair: "Chair",
 };

+ 15 - 5
src/example/fuse/views/tabulation/index.vue

@@ -37,6 +37,8 @@ import { IconData } from "@/core/components/icon";
 import { Transform } from "konva/lib/Util";
 import { MathUtils } from "three";
 import { useStage } from "@/core/hook/use-global-vars";
+import { components } from "@/core/components";
+import { ShapeType } from "@/index";
 
 const uploadResourse = window.platform.uploadResourse;
 const full = ref(false);
@@ -70,14 +72,24 @@ const init = async (draw: Draw) => {
   defaultTableStyle.colHeight = getRealPixel(8, p);
   defaultTableStyle.repColCount = 2;
 };
-watch(draw, (draw) => draw && init(draw));
+watch(draw, (draw) => {
+  if (draw) {
+    init(draw);
+    for (const type in components) {
+      draw.menusFilter.setMenusFilter(type as ShapeType, (items) => {
+        return items.filter((item) => item.label !== "隐藏");
+      });
+    }
+  }
+});
 
 const cover = computed(
   () => draw.value?.store.items.find((item) => item.key === tableCoverKey) as ImageData
 );
 const coverScale = computed({
   get: () =>
-    cover.value && getCoverPaperScale(cover.value, tabulationData.value.paperKey),
+    cover.value &&
+    Math.round(getCoverPaperScale(cover.value, tabulationData.value.paperKey)),
   set: (val) => {
     setCoverPaperScale(cover.value, tabulationData.value.paperKey, val);
   },
@@ -88,9 +100,7 @@ watch(cover, (cover, _, onCleanup) => {
   const mountMenus = draw.value.mountFilter;
   const menusFilter = draw.value.menusFilter;
 
-  menusFilter.setShapeMenusFilter(cover.id, (menus) => {
-    return menus.filter((item) => item.label !== "对齐");
-  });
+  menusFilter.setShapeMenusFilter(cover.id, () => []);
   mountMenus.setShapeMenusFilter(cover.id, (des) => ({
     ...des,
     scale: {

+ 4 - 5
src/example/platform/platform-draw.ts

@@ -68,6 +68,7 @@ const scaleResource = (info: AIExposeData, scale: number) => {
       }
     })
     .filter((item) => !!item);
+
   return {
     ...info,
     taggings,
@@ -105,6 +106,7 @@ const getResourceLayers = (data: AIExposeData) => {
         box = floor.box;
       }
 
+      console.error('data.taggings', data.taggings)
       return {
         ...floor,
         box,
@@ -112,7 +114,7 @@ const getResourceLayers = (data: AIExposeData) => {
           .filter((item) => {
             return (
               item.position.z === undefined ||
-              (item.position.z > box.bound.z_min &&
+              (item.position.z >= box.bound.z_min &&
                 item.position.z <= box.bound.z_max)
             );
           })
@@ -211,15 +213,13 @@ const drawLayerResource = (
         ...getBaseItem(),
         ...iconDefaultStyle,
         name: item.name,
-        fill: item.url.includes(".svg") ? "#000000" : undefined,
+        stroke: item.url.includes(".svg") ? "#000000" : undefined,
         createTime: createTime + layerResource.geos.length + ndx,
         url: item.url,
         lock: import.meta.env.DEV ? false : true,
         mat: tf.m,
         width: item.size ? item.size.width : 100,
         height: item.size ? item.size.height : 100,
-        // width: 30,
-        // height: 30,
         cornerRadius: 0,
       };
     })
@@ -258,7 +258,6 @@ export const drawPlatformResource = (data: AIExposeData, draw: Draw) => {
       // draw.store.setCurrentLayer(layer.name);
       layerBounds.push(drawLayerResource(layer, draw)!);
     }
-    console.log(data.compass);
     if (typeof data.compass === "number") {
       draw.store.setConfig({
         compass: {

+ 19 - 14
src/example/platform/platform-resource.ts

@@ -1,6 +1,6 @@
 import { Pos, Size } from "@/utils/math";
 import { extractConnectedSegments } from "@/utils/polygon";
-import { round, validNum } from "@/utils/shared";
+import { validNum } from "@/utils/shared";
 import { aiIconMap, iconGroups } from "../constant";
 import { Euler, Quaternion } from "three";
 
@@ -54,11 +54,11 @@ export const SceneTypeNames = {
   [SCENE_TYPE.cloud]: "点云场景",
 };
 
-export const getSceneApi = async (type: string, url: string) => {
+export const getSceneApi = async (type: string | undefined, url: string) => {
   if (url[0] === "/") {
     url = url.substring(1, url.length);
   }
-  let origin = window.platform.resourceURLS[type];
+  let origin = type ? window.platform.resourceURLS[type] : '';
   if (origin[origin.length - 1] !== "/") {
     origin = origin + "/";
   }
@@ -207,13 +207,20 @@ export const taggingGets = {
 
       const reqs = signages.map((signage: any) => {
         if (!validNum(signage.pos[0]) || !validNum(signage.pos[2])) return;
+        console.error(signage)
         const getIcon =
           signage.icon.indexOf("style-") === 0
-            ? getSceneApi(
-                "ossRoot",
-                `/sdk/images/billboard/${signage.icon}.png`
-              )
+            ? getSceneApi(undefined, `/styles/${signage.icon}.svg`).catch((e) => {
+              console.error(e)
+                return getSceneApi(
+                  "ossRoot",
+                  `/sdk/images/billboard/${signage.icon}.png`
+                )
+              })
             : getSceneApi("oss", `${prev}/user/${signage.icon}`);
+        const q = new Quaternion(...signage.qua)
+        const yRotate = new Euler().setFromQuaternion(q, 'XYZ').y + Math.PI
+        
         return getIcon
           .then((url) => {
             tags.push({
@@ -223,10 +230,10 @@ export const taggingGets = {
                 y: signage.pos[2],
                 z:
                   signage.pos[1] < 0
-                    ? (Math.ceil(signage.pos[1] * 10)) / 10
-                    : (Math.floor(signage.pos[1] * 10)) / 10,
+                    ? Math.ceil(signage.pos[1] * 10) / 10
+                    : Math.floor(signage.pos[1] * 10) / 10,
               },
-              rotate: 0,
+              rotate: yRotate,
               size: {
                 width: signage.width * (signage.scaleRatio / 100),
                 height: signage.height * (signage.scaleRatio / 100),
@@ -246,7 +253,6 @@ export const taggingGets = {
       .then((url) => fetch(url))
       .then((res) => res.json())
       .then((datas) => {
-        datas = [datas[1]]
         for (const data of datas) {
           const reg = data.imagePath.match(/floor_(\d)\.png/);
           const subgroup = reg ? Number(reg[1]) : undefined;
@@ -265,7 +271,6 @@ export const taggingGets = {
                 ? (aiIconMap as any)[shape.category]
                 : shape.category;
             let name = "";
-            console.log(shape.category);
             for (const group of iconGroups) {
               for (const itemGroup of group.children) {
                 for (const item of itemGroup.children) {
@@ -285,7 +290,7 @@ export const taggingGets = {
                 subgroup,
               } as any);
             } else {
-              console.error("找不到ai家具", name, pos);
+              console.error("找不到ai家具", icon, name, pos);
             }
           }
         }
@@ -294,7 +299,7 @@ export const taggingGets = {
         console.error(e);
       });
 
-    console.log('tags', tags);
+    console.log("tags", tags);
     return tags;
   },
 };