@labelbee/lb-annotation 1.28.0-alpha.1 → 1.28.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/constant/tool.js +1 -1
  2. package/dist/core/pointCloud/annotation.js +1 -1
  3. package/dist/core/pointCloud/index.js +4 -4
  4. package/dist/core/scheduler.js +1 -1
  5. package/dist/core/toolOperation/basicToolOperation.js +1 -1
  6. package/dist/core/toolOperation/pointCloud2dOperation.js +1 -1
  7. package/dist/core/toolOperation/pointOperation.js +1 -1
  8. package/dist/core/toolOperation/polygonOperation.js +1 -1
  9. package/dist/core/toolOperation/rectOperation.js +2 -2
  10. package/dist/index.js +1 -1
  11. package/dist/types/constant/tool.d.ts +7 -0
  12. package/dist/types/core/pointCloud/annotation.d.ts +2 -2
  13. package/dist/types/core/pointCloud/index.d.ts +1 -2
  14. package/dist/types/core/scheduler.d.ts +1 -1
  15. package/dist/types/core/toolOperation/ScribbleTool.d.ts +1 -9
  16. package/dist/types/core/toolOperation/basicToolOperation.d.ts +10 -1
  17. package/dist/types/core/toolOperation/pointOperation.d.ts +1 -0
  18. package/dist/types/core/toolOperation/polygonOperation.d.ts +17 -13
  19. package/dist/types/core/toolOperation/rectOperation.d.ts +7 -4
  20. package/dist/types/utils/tool/AxisUtils.d.ts +3 -27
  21. package/dist/utils/tool/AxisUtils.js +1 -1
  22. package/dist/utils/tool/DrawUtils.js +1 -1
  23. package/dist/utils/tool/PolygonUtils.js +1 -1
  24. package/dist/utils/tool/polygonTool.js +1 -1
  25. package/es/constant/tool.js +1 -1
  26. package/es/core/pointCloud/annotation.js +1 -1
  27. package/es/core/pointCloud/index.js +4 -4
  28. package/es/core/scheduler.js +1 -1
  29. package/es/core/toolOperation/basicToolOperation.js +1 -1
  30. package/es/core/toolOperation/pointCloud2dOperation.js +1 -1
  31. package/es/core/toolOperation/pointOperation.js +1 -1
  32. package/es/core/toolOperation/polygonOperation.js +1 -1
  33. package/es/core/toolOperation/rectOperation.js +2 -2
  34. package/es/index.js +1 -1
  35. package/es/utils/tool/AxisUtils.js +1 -1
  36. package/es/utils/tool/DrawUtils.js +3 -3
  37. package/es/utils/tool/PolygonUtils.js +1 -1
  38. package/es/utils/tool/polygonTool.js +1 -1
  39. package/package.json +2 -2
@@ -1 +1 @@
1
- import{ELineTypes as g,SEGMENT_NUMBER as E}from"../../constant/tool.js";var C=Object.defineProperty,I=Object.defineProperties,L=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,P=(e,t,l)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,b=(e,t)=>{for(var l in t||(t={}))N.call(t,l)&&P(e,l,t[l]);if(O)for(var l of O(t))S.call(t,l)&&P(e,l,t[l]);return e},D=(e,t)=>I(e,L(t));function v(e,t=.5,l=!1,s=16){if(e.length<4)return e;const h=[],r=e.slice(0);let f,u,n,y,p,d,w,i,M,m,o,c,a;for(l?(r.unshift(e[e.length-1]),r.unshift(e[e.length-2]),r.unshift(e[e.length-1]),r.unshift(e[e.length-2]),r.push(e[0]),r.push(e[1])):(r.unshift(e[1]),r.unshift(e[0]),r.push(e[e.length-2]),r.push(e[e.length-1])),a=2;a<r.length-4;a+=2)for(n=(r[a+2]-r[a-2])*t,y=(r[a+4]-r[a-0])*t,p=(r[a+3]-r[a-1])*t,d=(r[a+5]-r[a+1])*t,c=0;c<=s;c++)o=c/s,w=2*Math.pow(o,3)-3*Math.pow(o,2)+1,i=-(2*Math.pow(o,3))+3*Math.pow(o,2),M=Math.pow(o,3)-2*Math.pow(o,2)+o,m=Math.pow(o,3)-Math.pow(o,2),f=w*r[a]+i*r[a+2]+M*n+m*y,u=w*r[a+1]+i*r[a+3]+M*p+m*d,h.push(f),h.push(u);const _=[];for(let x=0;x<h.length-1;x+=2)_.push({x:h[x],y:h[x+1]});if(l)for(let x=0;x<s+1;x++){const j=_.shift();_.push(j)}return _}const R=(e,t=16)=>v(e.reduce((l,s)=>[...l,s.x,s.y],[]),.5,!1,t);function T(e,t,l=g.Line){let s=0,h,r,f,u;t=[...t],l===g.Curve&&(t=v(t.reduce((y,p)=>[...y,p.x,p.y],[]),.5,!0,E)),[f]=t;const n=t.length;for(h=1;h<=n;h++)u=t[h%n],e.x>Math.min(f.x,u.x)&&e.x<=Math.max(f.x,u.x)&&e.y<=Math.max(f.y,u.y)&&f.x!==u.x&&(r=(e.x-f.x)*(u.y-f.y)/(u.x-f.x)+f.y,(f.y===u.y||e.y<=r)&&s++),f=u;return s%2!=0}function U(e,t=1){return e.map(l=>D(b({},l),{x:l.x*t,y:l.y*t}))}export{v as createSmoothCurvePoints,R as createSmoothCurvePointsFromPointList,U as getPolygonPointUnderZoom,T as isInPolygon};
1
+ import{ELineTypes as d,SEGMENT_NUMBER as E}from"../../constant/tool.js";var b=Object.defineProperty,C=Object.defineProperties,L=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,j=(t,e,a)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,S=(t,e)=>{for(var a in e||(e={}))N.call(e,a)&&j(t,a,e[a]);if(O)for(var a of O(e))P.call(e,a)&&j(t,a,e[a]);return t},D=(t,e)=>C(t,L(e));function v(t,e=.5,a=!1,u=16){if(t.length<4)return t;const l=[],r=t.slice(0);let _,M,o,w,h,x,i,p,s,m,n,c,f;for(a?(r.unshift(t[t.length-1]),r.unshift(t[t.length-2]),r.unshift(t[t.length-1]),r.unshift(t[t.length-2]),r.push(t[0]),r.push(t[1])):(r.unshift(t[1]),r.unshift(t[0]),r.push(t[t.length-2]),r.push(t[t.length-1])),f=2;f<r.length-4;f+=2)for(o=(r[f+2]-r[f-2])*e,w=(r[f+4]-r[f-0])*e,h=(r[f+3]-r[f-1])*e,x=(r[f+5]-r[f+1])*e,c=0;c<=u;c++)n=c/u,i=2*Math.pow(n,3)-3*Math.pow(n,2)+1,p=-(2*Math.pow(n,3))+3*Math.pow(n,2),s=Math.pow(n,3)-2*Math.pow(n,2)+n,m=Math.pow(n,3)-Math.pow(n,2),_=i*r[f]+p*r[f+2]+s*o+m*w,M=i*r[f+1]+p*r[f+3]+s*h+m*x,l.push(_),l.push(M);const g=[];for(let y=0;y<l.length-1;y+=2)g.push({x:l[y],y:l[y+1]});if(a)for(let y=0;y<u+1;y++){const I=g.shift();g.push(I)}return g}const R=(t,e=16)=>v(t.reduce((a,u)=>[...a,u.x,u.y],[]),.5,!1,e);function T(t,e,a=d.Line){let u=0,l,r;a===d.Curve&&(e=v(e.flatMap(h=>[h.x,h.y]),.5,!0,E));const[_,M,o,w]=e.reduce(([h,x,i,p],{x:s,y:m})=>[Math.min(h,s),Math.max(x,s),Math.min(i,m),Math.max(p,m)],[Infinity,-Infinity,Infinity,-Infinity]);if(t.x<_||t.x>M||t.y<o||t.y>w)return!1;l=e[e.length-1];for(let h=0;h<e.length;h++){if(r=e[h],t.y>Math.min(l.y,r.y)&&t.y<=Math.max(l.y,r.y)&&t.x<=Math.max(l.x,r.x)){const x=l.y!==r.y?(t.y-l.y)*(r.x-l.x)/(r.y-l.y)+l.x:l.x;t.x<=x&&u++}if(l=r,u%2!=0&&h>e.length/2)break}return u%2!=0}function U(t,e=1){return t.map(a=>D(S({},a),{x:a.x*e,y:a.y*e}))}export{v as createSmoothCurvePoints,R as createSmoothCurvePointsFromPointList,U as getPolygonPointUnderZoom,T as isInPolygon};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-annotation",
3
- "version": "1.28.0-alpha.1",
3
+ "version": "1.28.0-alpha.11",
4
4
  "description": "Annotation tool collection",
5
5
  "keywords": [
6
6
  "annotation",
@@ -94,7 +94,7 @@
94
94
  "typescript": "^4.2.3"
95
95
  },
96
96
  "dependencies": {
97
- "@labelbee/lb-utils": "1.19.0",
97
+ "@labelbee/lb-utils": "1.20.0-alpha.1",
98
98
  "@turf/turf": "5.1.6",
99
99
  "color-rgba": "^2.3.0",
100
100
  "lodash": "^4.17.20",