@anov/3d-ability 0.0.156 → 0.0.157

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.
@@ -1,5 +1,5 @@
1
1
  import { Line2, Vector3 } from '@anov/3d-core';
2
- import * as THREE from '@anov/3d-core';
2
+ import type * as THREE from '@anov/3d-core';
3
3
  import type { FillAreaOption } from '../type';
4
4
  import FillAreaBase from './FillAreaBase';
5
5
  declare class FillArea_Line_01 extends FillAreaBase {
@@ -12,7 +12,6 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
12
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
14
  import { Color, Line2, LineGeometry, LineMaterial, Vector2, Vector3 } from '@anov/3d-core';
15
- import * as THREE from '@anov/3d-core';
16
15
  import { createRoundedClosedCurve } from "../../Utils/round-curve";
17
16
  import FillAreaBase from "./FillAreaBase";
18
17
  var FillArea_Line_01 = /*#__PURE__*/function (_FillAreaBase) {
@@ -40,8 +39,7 @@ var FillArea_Line_01 = /*#__PURE__*/function (_FillAreaBase) {
40
39
  color: new Color(color).getHex(),
41
40
  transparent: true,
42
41
  opacity: alpha,
43
- blending: THREE.NormalBlending,
44
- // 启用混合模式以使透明度生效
42
+ // blending: THREE.NormalBlending, // 启用混合模式以使透明度生效
45
43
  depthTest: false,
46
44
  alphaTest: 0.01,
47
45
  linewidth: 15,
@@ -1 +1 @@
1
- {"version":3,"names":["Color","Line2","LineGeometry","LineMaterial","Vector2","Vector3","THREE","createRoundedClosedCurve","FillAreaBase","FillArea_Line_01","_FillAreaBase","_inherits","_super","_createSuper","option","areaInstance","_this","_classCallCheck","call","create","_createClass","key","value","_mesh","createMesh","_points","_color","_alpha","add","points","color","alpha","material","getHex","transparent","opacity","blending","NormalBlending","depthTest","alphaTest","linewidth","resolution","window","innerWidth","innerHeight","curvePath","_corner","_close","pathPoints","getPoints","points3D","map","p","x","z","geometry","setPositions","flatMap","mesh"],"sources":["../../../../src/business/Area/FillArea/fillArea_line_01.ts"],"sourcesContent":["import { Color, Line, Line2, LineGeometry, LineMaterial, Mesh, Vector2, Vector3 } from '@anov/3d-core'\n\nimport * as THREE from '@anov/3d-core'\nimport type { FillAreaOption } from '../type'\nimport { RoundLineGeometry, createRoundedClosedCurve } from '../../Utils/round-curve'\nimport FillAreaBase from './FillAreaBase'\n\ninterface Point {\n x: number\n y: number\n z: number\n}\nclass FillArea_Line_01 extends FillAreaBase {\n constructor(option: FillAreaOption, areaInstance: THREE.Object3D) {\n super(option, areaInstance)\n this.create()\n }\n\n create() {\n this._mesh = this.createMesh(this._points, this._color, this._alpha)\n this._mesh && this.add(this._mesh)\n }\n\n createMesh(points: Vector3[], color: string, alpha: number) {\n if (!points)\n return\n // 创建材质,这里设置为线的材质,比如LineMaterial\n const material = new LineMaterial({\n color: new Color(color).getHex(),\n transparent: true,\n opacity: alpha,\n blending: THREE.NormalBlending, // 启用混合模式以使透明度生效\n depthTest: false,\n alphaTest: 0.01,\n linewidth: 15,\n resolution: new Vector2(window.innerWidth, window.innerHeight),\n })\n // const roundLineGeometry = new RoundLineGeometry(points, { radius: this._corner, close: this._close })\n // const curve = roundLineGeometry.curve\n // const currentPoints = curve.getPoints(1000)\n // // 将点转换为二维坐标(只保留x和y)\n // const points3D = currentPoints.map((p: Point) => new Vector3(p.x, 0, p.z))\n // const geometry = new LineGeometry()\n // geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组\n // // 创建一个线的网格物体(区别于原来的面的网格物体)\n // const mesh = new Line2(geometry, material)\n\n const curvePath = createRoundedClosedCurve(points, this._corner, this._close)\n const pathPoints = curvePath.getPoints(1000)\n // const geometry = new THREE.BufferGeometry().setFromPoints(pathPoints)\n // const mesh = new Line2(geometry, material)\n // 将点转换为二维坐标(只保留x和y)\n const points3D = pathPoints.map((p: Point) => new Vector3(p.x, 0, p.z))\n const geometry = new LineGeometry()\n geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组\n // 创建一个线的网格物体(区别于原来的面的网格物体)\n const mesh = new Line2(geometry, material)\n return mesh\n }\n\n // Getter and Setter for fenceColor property\n // get color(): string {\n // return this._color\n // }\n\n // set color(newValue: string) {\n // if (this._color === newValue)\n // return\n\n // this._color = newValue\n // if (this.mesh)\n // this.mesh.material.color = new Color(newValue)\n // }\n\n // Getter and Setter for fenceAlpha property\n // get alpha(): number {\n // return this._alpha\n // }\n\n // set alpha(newValue: number) {\n // if (this._alpha === newValue)\n // return\n\n // this._alpha = newValue\n // if (this.mesh)\n // this.mesh.material.opacity = newValue\n // }\n}\n\nexport default FillArea_Line_01"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,KAAK,EAAQC,KAAK,EAAEC,YAAY,EAAEC,YAAY,EAAQC,OAAO,EAAEC,OAAO,QAAQ,eAAe;AAEtG,OAAO,KAAKC,KAAK,MAAM,eAAe;AAEtC,SAA4BC,wBAAwB;AACpD,OAAOC,YAAY;AAAsB,IAOnCC,gBAAgB,0BAAAC,aAAA;EAAAC,SAAA,CAAAF,gBAAA,EAAAC,aAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,gBAAA;EACpB,SAAAA,iBAAYK,MAAsB,EAAEC,YAA4B,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAR,gBAAA;IAChEO,KAAA,GAAAJ,MAAA,CAAAM,IAAA,OAAMJ,MAAM,EAAEC,YAAY;IAC1BC,KAAA,CAAKG,MAAM,CAAC,CAAC;IAAA,OAAAH,KAAA;EACf;EAACI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GAAG,IAAIrD,YAAY,CAAC,CAAC;MACnCqD,QAAQ,CAACC,YAAY,CAACN,QAAQ,CAACO,OAAO,CAAC,UAACL,CAAQ;QAAA,OAAK,CAACA,CAAC,CAACC,CAAC,EAAE,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC;MAAA,EAAC,CAAC,EAAC;MACrE;MACA,IAAMI,IAAI,GAAG,IAAIzD,KAAK,CAACsD,QAAQ,EAAEvB,QAAQ,CAAC;MAC1C,OAAO0B,IAAI;IACb;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;;IAEA;IACA;IACA;IACA;EAAA;EAAA,OAAAjD,gBAAA;AAAA,EA1E6BD,YAAY;AA6E3C,eAAeC,gBAAgB"}
1
+ {"version":3,"names":["Color","Line2","LineGeometry","LineMaterial","Vector2","Vector3","createRoundedClosedCurve","FillAreaBase","FillArea_Line_01","_FillAreaBase","_inherits","_super","_createSuper","option","areaInstance","_this","_classCallCheck","call","create","_createClass","key","value","_mesh","createMesh","_points","_color","_alpha","add","points","color","alpha","material","getHex","transparent","opacity","depthTest","alphaTest","linewidth","resolution","window","innerWidth","innerHeight","curvePath","_corner","_close","pathPoints","getPoints","points3D","map","p","x","z","geometry","setPositions","flatMap","mesh"],"sources":["../../../../src/business/Area/FillArea/fillArea_line_01.ts"],"sourcesContent":["import { Color, Line, Line2, LineGeometry, LineMaterial, Mesh, Vector2, Vector3 } from '@anov/3d-core'\n\nimport type * as THREE from '@anov/3d-core'\nimport type { FillAreaOption } from '../type'\nimport { RoundLineGeometry, createRoundedClosedCurve } from '../../Utils/round-curve'\nimport FillAreaBase from './FillAreaBase'\n\ninterface Point {\n x: number\n y: number\n z: number\n}\nclass FillArea_Line_01 extends FillAreaBase {\n constructor(option: FillAreaOption, areaInstance: THREE.Object3D) {\n super(option, areaInstance)\n this.create()\n }\n\n create() {\n this._mesh = this.createMesh(this._points, this._color, this._alpha)\n this._mesh && this.add(this._mesh)\n }\n\n createMesh(points: Vector3[], color: string, alpha: number) {\n if (!points)\n return\n // 创建材质,这里设置为线的材质,比如LineMaterial\n const material = new LineMaterial({\n color: new Color(color).getHex(),\n transparent: true,\n opacity: alpha,\n // blending: THREE.NormalBlending, // 启用混合模式以使透明度生效\n depthTest: false,\n alphaTest: 0.01,\n linewidth: 15,\n resolution: new Vector2(window.innerWidth, window.innerHeight),\n })\n // const roundLineGeometry = new RoundLineGeometry(points, { radius: this._corner, close: this._close })\n // const curve = roundLineGeometry.curve\n // const currentPoints = curve.getPoints(1000)\n // // 将点转换为二维坐标(只保留x和y)\n // const points3D = currentPoints.map((p: Point) => new Vector3(p.x, 0, p.z))\n // const geometry = new LineGeometry()\n // geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组\n // // 创建一个线的网格物体(区别于原来的面的网格物体)\n // const mesh = new Line2(geometry, material)\n\n const curvePath = createRoundedClosedCurve(points, this._corner, this._close)\n const pathPoints = curvePath.getPoints(1000)\n // const geometry = new THREE.BufferGeometry().setFromPoints(pathPoints)\n // const mesh = new Line2(geometry, material)\n // 将点转换为二维坐标(只保留x和y)\n const points3D = pathPoints.map((p: Point) => new Vector3(p.x, 0, p.z))\n const geometry = new LineGeometry()\n geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组\n // 创建一个线的网格物体(区别于原来的面的网格物体)\n const mesh = new Line2(geometry, material)\n return mesh\n }\n\n // Getter and Setter for fenceColor property\n // get color(): string {\n // return this._color\n // }\n\n // set color(newValue: string) {\n // if (this._color === newValue)\n // return\n\n // this._color = newValue\n // if (this.mesh)\n // this.mesh.material.color = new Color(newValue)\n // }\n\n // Getter and Setter for fenceAlpha property\n // get alpha(): number {\n // return this._alpha\n // }\n\n // set alpha(newValue: number) {\n // if (this._alpha === newValue)\n // return\n\n // this._alpha = newValue\n // if (this.mesh)\n // this.mesh.material.opacity = new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EAAE,IAAIlC,OAAO,CAACmC,MAAM,CAACC,UAAU,EAAED,MAAM,CAACE,WAAW;MAC/D,CAAC,CAAC;MACF;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;;MAEA,IAAMC,SAAS,GAAGpC,wBAAwB,CAACsB,MAAM,EAAE,IAAI,CAACe,OAAO,EAAE,IAAI,CAACC,MAAM,CAAC;MAC7E,IAAMC,UAAU,GAAGH,SAAS,CAACI,SAAS,CAAC,IAAI,CAAC;MAC5C;MACA;MACA;MACA,IAAMC,QAAQ,GAAGF,UAAU,CAACG,GAAG,CAAC,UAACC,CAAQ;QAAA,OAAK,IAAI5C,OAAO,CAAC4C,CAAC,CAACC,CAAC,EAAE,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC;MAAA,EAAC;MACvE,IAAMC,QAAQ,GAAG,IAAIlD,YAAY,CAAC,CAAC;MACnCkD,QAAQ,CAACC,YAAY,CAACN,QAAQ,CAACO,OAAO,CAAC,UAACL,CAAQ;QAAA,OAAK,CAACA,CAAC,CAACC,CAAC,EAAE,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC;MAAA,EAAC,CAAC,EAAC;MACrE;MACA,IAAMI,IAAI,GAAG,IAAItD,KAAK,CAACmD,QAAQ,EAAErB,QAAQ,CAAC;MAC1C,OAAOwB,IAAI;IACb;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;;IAEA;IACA;IACA;IACA;EAAA;EAAA,OAAA/C,gBAAA;AAAA,EA1E6BD,YAAY;AA6E3C,eAAeC,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anov/3d-ability",
3
- "version": "0.0.156",
3
+ "version": "0.0.157",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",