@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.
- package/dist/constant/tool.js +1 -1
- package/dist/core/pointCloud/annotation.js +1 -1
- package/dist/core/pointCloud/index.js +4 -4
- package/dist/core/scheduler.js +1 -1
- package/dist/core/toolOperation/basicToolOperation.js +1 -1
- package/dist/core/toolOperation/pointCloud2dOperation.js +1 -1
- package/dist/core/toolOperation/pointOperation.js +1 -1
- package/dist/core/toolOperation/polygonOperation.js +1 -1
- package/dist/core/toolOperation/rectOperation.js +2 -2
- package/dist/index.js +1 -1
- package/dist/types/constant/tool.d.ts +7 -0
- package/dist/types/core/pointCloud/annotation.d.ts +2 -2
- package/dist/types/core/pointCloud/index.d.ts +1 -2
- package/dist/types/core/scheduler.d.ts +1 -1
- package/dist/types/core/toolOperation/ScribbleTool.d.ts +1 -9
- package/dist/types/core/toolOperation/basicToolOperation.d.ts +10 -1
- package/dist/types/core/toolOperation/pointOperation.d.ts +1 -0
- package/dist/types/core/toolOperation/polygonOperation.d.ts +17 -13
- package/dist/types/core/toolOperation/rectOperation.d.ts +7 -4
- package/dist/types/utils/tool/AxisUtils.d.ts +3 -27
- package/dist/utils/tool/AxisUtils.js +1 -1
- package/dist/utils/tool/DrawUtils.js +1 -1
- package/dist/utils/tool/PolygonUtils.js +1 -1
- package/dist/utils/tool/polygonTool.js +1 -1
- package/es/constant/tool.js +1 -1
- package/es/core/pointCloud/annotation.js +1 -1
- package/es/core/pointCloud/index.js +4 -4
- package/es/core/scheduler.js +1 -1
- package/es/core/toolOperation/basicToolOperation.js +1 -1
- package/es/core/toolOperation/pointCloud2dOperation.js +1 -1
- package/es/core/toolOperation/pointOperation.js +1 -1
- package/es/core/toolOperation/polygonOperation.js +1 -1
- package/es/core/toolOperation/rectOperation.js +2 -2
- package/es/index.js +1 -1
- package/es/utils/tool/AxisUtils.js +1 -1
- package/es/utils/tool/DrawUtils.js +3 -3
- package/es/utils/tool/PolygonUtils.js +1 -1
- package/es/utils/tool/polygonTool.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ELineTypes as
|
|
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.
|
|
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.
|
|
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",
|