@anov/3d-ability 0.0.140 → 0.0.142
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/business/Animation/motion/index.js +35 -56
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +146 -187
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +120 -112
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +218 -130
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +140 -130
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +87 -126
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +72 -98
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +66 -94
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +267 -483
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +14 -26
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +21 -46
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +189 -234
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +52 -81
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +51 -79
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +1 -9
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +7 -21
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +96 -162
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +208 -291
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +8 -22
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +380 -467
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +405 -525
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +69 -3
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +201 -242
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +55 -88
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +145 -176
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +196 -294
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +36 -3
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +377 -551
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +92 -58
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +74 -2
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +95 -16
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +9 -3
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +48 -9
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +51 -78
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.d.ts +5 -0
- package/dist/business/Poi/index.js +256 -295
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +56 -89
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +104 -165
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +54 -114
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.d.ts +124 -0
- package/dist/business/Poi/panel/index.js +474 -0
- package/dist/business/Poi/panel/index.js.map +1 -0
- package/dist/business/Poi/panel/interfaces.d.ts +67 -0
- package/dist/business/Poi/panel/interfaces.js +2 -0
- package/dist/business/Poi/panel/interfaces.js.map +1 -0
- package/dist/business/Poi/panel/utils.d.ts +72 -0
- package/dist/business/Poi/panel/utils.js +126 -0
- package/dist/business/Poi/panel/utils.js.map +1 -0
- package/dist/business/Poi/particle/DoubleCircle.js +71 -107
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +75 -111
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +62 -98
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +49 -117
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +31 -3
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +37 -3
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +55 -3
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +67 -3
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +7 -27
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +7 -27
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +208 -292
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +22 -19
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Poi/types.d.ts +3 -0
- package/dist/business/Poi/types.js.map +1 -1
- package/dist/business/Sphere/index.js +47 -72
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +190 -245
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +327 -536
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +218 -275
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +132 -177
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +51 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +6 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +32 -55
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.d.ts +1 -1
- package/dist/business/TrafficComponents/utils.js +26 -25
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +40 -56
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +13 -14
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +127 -153
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +258 -319
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +78 -108
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +383 -449
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +107 -142
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +84 -96
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +77 -98
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +19 -28
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +126 -155
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +47 -63
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +39 -49
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +66 -91
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +14 -30
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +92 -131
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +22 -47
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +4 -21
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +37 -57
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +116 -153
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +95 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +26 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +76 -172
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +6 -11
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +16 -12
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +17 -13
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +17 -10
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +60 -43
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +17 -13
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +28 -22
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +37 -50
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +14 -12
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +15 -10
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +22 -3
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +27 -3
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +66 -3
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +28 -3
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +85 -101
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +60 -77
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +64 -81
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +51 -76
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +69 -105
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +77 -124
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +52 -80
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +72 -84
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +88 -118
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +116 -146
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +100 -148
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +71 -104
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +66 -84
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +25 -45
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +74 -3
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +103 -3
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +206 -7
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +87 -3
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +104 -135
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +44 -38
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +18 -25
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +96 -141
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,113 +1,87 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
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
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
1
|
import { Color, ExtrudeGeometry, Mesh, MeshBasicMaterial, Shape, Vector2 } from '@anov/3d-core';
|
|
15
2
|
import { createRoundedClosedCurve } from "../../Utils/round-curve";
|
|
16
3
|
import FillAreaBase from "./FillAreaBase";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _this;
|
|
22
|
-
_classCallCheck(this, FillArea_Face_01);
|
|
23
|
-
_this = _super.call(this, option, areaInstance);
|
|
24
|
-
_this.create();
|
|
25
|
-
return _this;
|
|
4
|
+
class FillArea_Face_01 extends FillAreaBase {
|
|
5
|
+
constructor(option, areaInstance) {
|
|
6
|
+
super(option, areaInstance);
|
|
7
|
+
this.create();
|
|
26
8
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, {
|
|
34
|
-
key: "createMesh",
|
|
35
|
-
value: function createMesh(points, color, alpha) {
|
|
36
|
-
if (!points) return;
|
|
9
|
+
create() {
|
|
10
|
+
this._mesh = this.createMesh(this._points, this._color, this._alpha);
|
|
11
|
+
this._mesh && this.add(this._mesh);
|
|
12
|
+
}
|
|
13
|
+
createMesh(points, color, alpha) {
|
|
14
|
+
if (!points) return;
|
|
37
15
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
16
|
+
// 创建材质
|
|
17
|
+
const material = new MeshBasicMaterial({
|
|
18
|
+
color: new Color(color),
|
|
19
|
+
transparent: true,
|
|
20
|
+
opacity: alpha,
|
|
21
|
+
side: 2
|
|
22
|
+
});
|
|
23
|
+
// // 创建一个Shape对象,用于定义填充区域的平面形状
|
|
24
|
+
// const shape = new Shape()
|
|
25
|
+
// // 将第一个点的x、z坐标作为Shape的起始位置
|
|
26
|
+
// shape.moveTo(points[0].x, points[0].z)
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
extrudePath: undefined
|
|
71
|
-
};
|
|
28
|
+
// // 遍历剩余的点,依次将它们的x、z坐标连接起来,构成封闭的平面形状
|
|
29
|
+
// for (let i = 1; i < points.length; i++)
|
|
30
|
+
// shape.lineTo(points[i].x, points[i].z)
|
|
31
|
+
// // 闭合形状路径,确保形状是封闭的,以便后续挤出操作生成正确的几何体
|
|
32
|
+
// shape.closePath()
|
|
33
|
+
// const roundLineGeometry = new RoundLineGeometry(points, { radius: this._corner, close: this._close })
|
|
34
|
+
// const curve = roundLineGeometry.curve
|
|
35
|
+
const curvePath = createRoundedClosedCurve(points, this._corner, this._close);
|
|
36
|
+
const pathPoints = curvePath.getPoints(1000);
|
|
37
|
+
// const currentPoints = curve.getPoints(1000)
|
|
38
|
+
const points2D = pathPoints.map(p => new Vector2(p.x, p.z));
|
|
39
|
+
// 创建一个Shape并添加封闭路径
|
|
40
|
+
const shape = new Shape(points2D);
|
|
41
|
+
// 定义挤出几何体的基本设置,包括步数、是否启用斜角、挤出深度以及挤出路径等
|
|
42
|
+
const extrudeSettings = {
|
|
43
|
+
steps: 100,
|
|
44
|
+
bevelEnabled: false,
|
|
45
|
+
depth: 1,
|
|
46
|
+
extrudePath: undefined
|
|
47
|
+
};
|
|
72
48
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
49
|
+
// 生成填充区域的几何体
|
|
50
|
+
const geometry = new ExtrudeGeometry(shape, extrudeSettings);
|
|
51
|
+
// 生成填充区域的网格物体
|
|
52
|
+
const mesh = new Mesh(geometry, material);
|
|
53
|
+
// 将填充区域的网格物体绕x轴旋转90度
|
|
54
|
+
mesh.rotateX(Math.PI / 2);
|
|
55
|
+
return mesh;
|
|
56
|
+
}
|
|
81
57
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
58
|
+
// Getter and Setter for fenceColor property
|
|
59
|
+
// get color(): string {
|
|
60
|
+
// return this._color
|
|
61
|
+
// }
|
|
86
62
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
63
|
+
// set color(newValue: string) {
|
|
64
|
+
// if (this._color === newValue)
|
|
65
|
+
// return
|
|
90
66
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
67
|
+
// this._color = newValue
|
|
68
|
+
// if (this.mesh)
|
|
69
|
+
// (this.mesh.material as MeshBasicMaterial).color = new Color(newValue)
|
|
70
|
+
// }
|
|
95
71
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
// // Getter and Setter for fenceAlpha property
|
|
73
|
+
// get alpha(): number {
|
|
74
|
+
// return this._alpha
|
|
75
|
+
// }
|
|
100
76
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
77
|
+
// set alpha(newValue: number) {
|
|
78
|
+
// if (this._alpha === newValue)
|
|
79
|
+
// return
|
|
104
80
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return FillArea_Face_01;
|
|
111
|
-
}(FillAreaBase);
|
|
81
|
+
// this._alpha = newValue
|
|
82
|
+
// if (this.mesh)
|
|
83
|
+
// (this.mesh.material as MeshBasicMaterial).opacity = newValue
|
|
84
|
+
// }
|
|
85
|
+
}
|
|
112
86
|
export default FillArea_Face_01;
|
|
113
87
|
//# sourceMappingURL=fillArea_face_01.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","ExtrudeGeometry","Mesh","MeshBasicMaterial","Shape","Vector2","createRoundedClosedCurve","FillAreaBase","FillArea_Face_01","
|
|
1
|
+
{"version":3,"names":["Color","ExtrudeGeometry","Mesh","MeshBasicMaterial","Shape","Vector2","createRoundedClosedCurve","FillAreaBase","FillArea_Face_01","constructor","option","areaInstance","create","_mesh","createMesh","_points","_color","_alpha","add","points","color","alpha","material","transparent","opacity","side","curvePath","_corner","_close","pathPoints","getPoints","points2D","map","p","x","z","shape","extrudeSettings","steps","bevelEnabled","depth","extrudePath","undefined","geometry","mesh","rotateX","Math","PI"],"sources":["../../../../src/business/Area/FillArea/fillArea_face_01.ts"],"sourcesContent":["import type { Object3D, Vector3 } from '@anov/3d-core'\nimport { Color, ExtrudeGeometry, Mesh, MeshBasicMaterial, Shape, Vector2 } from '@anov/3d-core'\nimport * as THREE from '@anov/3d-core'\nimport type { FillAreaOption } from '../type'\nimport { RoundLineGeometry, createRoundedClosedCurve } from '../../Utils/round-curve'\nimport FillAreaBase from './FillAreaBase'\n\nclass FillArea_Face_01 extends FillAreaBase {\n constructor(option: FillAreaOption, areaInstance: 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\n // 创建材质\n const material = new MeshBasicMaterial({ color: new Color(color), transparent: true, opacity: alpha, side: 2 })\n // // 创建一个Shape对象,用于定义填充区域的平面形状\n // const shape = new Shape()\n // // 将第一个点的x、z坐标作为Shape的起始位置\n // shape.moveTo(points[0].x, points[0].z)\n\n // // 遍历剩余的点,依次将它们的x、z坐标连接起来,构成封闭的平面形状\n // for (let i = 1; i < points.length; i++)\n // shape.lineTo(points[i].x, points[i].z)\n // // 闭合形状路径,确保形状是封闭的,以便后续挤出操作生成正确的几何体\n // shape.closePath()\n // const roundLineGeometry = new RoundLineGeometry(points, { radius: this._corner, close: this._close })\n // const curve = roundLineGeometry.curve\n const curvePath = createRoundedClosedCurve(points, this._corner, this._close)\n const pathPoints = curvePath.getPoints(1000)\n // const currentPoints = curve.getPoints(1000)\n const points2D = pathPoints.map((p: any) => new Vector2(p.x, p.z))\n // 创建一个Shape并添加封闭路径\n const shape = new Shape(points2D)\n // 定义挤出几何体的基本设置,包括步数、是否启用斜角、挤出深度以及挤出路径等\n const extrudeSettings = {\n steps: 100,\n bevelEnabled: false,\n depth: 1,\n extrudePath: undefined,\n }\n\n // 生成填充区域的几何体\n const geometry = new ExtrudeGeometry(shape, extrudeSettings)\n // 生成填充区域的网格物体\n const mesh = new Mesh(geometry, material)\n // 将填充区域的网格物体绕x轴旋转90度\n mesh.rotateX(Math.PI / 2)\n\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 as MeshBasicMaterial).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 as MeshBasicMaterial).opacity = newValue\n // }\n}\n\nexport default FillArea_Face_01"],"mappings":"AACA,SAASA,KAAK,EAAEC,eAAe,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,KAAK,EAAEC,OAAO,QAAQ,eAAe;AAG/F,SAA4BC,wBAAwB;AACpD,OAAOC,YAAY;AAEnB,MAAMC,gBAAgB,SAASD,YAAY,CAAC;EAC1CE,WAAWA,CAACC,MAAsB,EAAEC,YAAsB,EAAE;IAC1D,KAAK,CAACD,MAAM,EAAEC,YAAY,CAAC;IAC3B,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;EAEAA,MAAMA,CAAA,EAAG;IACP,IAAI,CAACC,KAAK,GAAG,IAAI,CAACC,UAAU,CAAC,IAAI,CAACC,OAAO,EAAE,IAAI,CAACC,MAAM,EAAE,IAAI,CAACC,MAAM,CAAC;IACpE,IAAI,CAACJ,KAAK,IAAI,IAAI,CAACK,GAAG,CAAC,IAAI,CAACL,KAAK,CAAC;EACpC;EAEAC,UAAUA,CAACK,MAAiB,EAAEC,KAAa,EAAEC,KAAa,EAAE;IAC1D,IAAI,CAACF,MAAM,EACT;;IAEF;IACA,MAAMG,QAAQ,GAAG,IAAInB,iBAAiB,CAAC;MAAEiB,KAAK,EAAE,IAAIpB,KAAK,CAACoB,KAAK,CAAC;MAAEG,WAAW,EAAE,IAAI;MAAEC,OAAO,EAAEH,KAAK;MAAEI,IAAI,EAAE;IAAE,CAAC,CAAC;IAC/G;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,SAAS,GAAGpB,wBAAwB,CAACa,MAAM,EAAE,IAAI,CAACQ,OAAO,EAAE,IAAI,CAACC,MAAM,CAAC;IAC7E,MAAMC,UAAU,GAAGH,SAAS,CAACI,SAAS,CAAC,IAAI,CAAC;IAC5C;IACA,MAAMC,QAAQ,GAAGF,UAAU,CAACG,GAAG,CAAEC,CAAM,IAAK,IAAI5B,OAAO,CAAC4B,CAAC,CAACC,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC,CAAC;IAClE;IACA,MAAMC,KAAK,GAAG,IAAIhC,KAAK,CAAC2B,QAAQ,CAAC;IACjC;IACA,MAAMM,eAAe,GAAG;MACtBC,KAAK,EAAE,GAAG;MACVC,YAAY,EAAE,KAAK;MACnBC,KAAK,EAAE,CAAC;MACRC,WAAW,EAAEC;IACf,CAAC;;IAED;IACA,MAAMC,QAAQ,GAAG,IAAI1C,eAAe,CAACmC,KAAK,EAAEC,eAAe,CAAC;IAC5D;IACA,MAAMO,IAAI,GAAG,IAAI1C,IAAI,CAACyC,QAAQ,EAAErB,QAAQ,CAAC;IACzC;IACAsB,IAAI,CAACC,OAAO,CAACC,IAAI,CAACC,EAAE,GAAG,CAAC,CAAC;IAEzB,OAAOH,IAAI;EACb;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;EACA;AACF;AAEA,eAAepC,gBAAgB"}
|
|
@@ -1,108 +1,80 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
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
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
1
|
import { Color, Line2, LineGeometry, LineMaterial, Vector2, Vector3 } from '@anov/3d-core';
|
|
15
2
|
import * as THREE from '@anov/3d-core';
|
|
16
3
|
import { createRoundedClosedCurve } from "../../Utils/round-curve";
|
|
17
4
|
import FillAreaBase from "./FillAreaBase";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _this;
|
|
23
|
-
_classCallCheck(this, FillArea_Line_01);
|
|
24
|
-
_this = _super.call(this, option, areaInstance);
|
|
25
|
-
_this.create();
|
|
26
|
-
return _this;
|
|
5
|
+
class FillArea_Line_01 extends FillAreaBase {
|
|
6
|
+
constructor(option, areaInstance) {
|
|
7
|
+
super(option, areaInstance);
|
|
8
|
+
this.create();
|
|
27
9
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// const geometry = new LineGeometry()
|
|
56
|
-
// geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组
|
|
57
|
-
// // 创建一个线的网格物体(区别于原来的面的网格物体)
|
|
58
|
-
// const mesh = new Line2(geometry, material)
|
|
10
|
+
create() {
|
|
11
|
+
this._mesh = this.createMesh(this._points, this._color, this._alpha);
|
|
12
|
+
this._mesh && this.add(this._mesh);
|
|
13
|
+
}
|
|
14
|
+
createMesh(points, color, alpha) {
|
|
15
|
+
if (!points) return;
|
|
16
|
+
// 创建材质,这里设置为线的材质,比如LineMaterial
|
|
17
|
+
const material = new LineMaterial({
|
|
18
|
+
color: new Color(color).getHex(),
|
|
19
|
+
transparent: true,
|
|
20
|
+
opacity: alpha,
|
|
21
|
+
blending: THREE.NormalBlending,
|
|
22
|
+
// 启用混合模式以使透明度生效
|
|
23
|
+
depthTest: false,
|
|
24
|
+
alphaTest: 0.01,
|
|
25
|
+
linewidth: 15,
|
|
26
|
+
resolution: new Vector2(window.innerWidth, window.innerHeight)
|
|
27
|
+
});
|
|
28
|
+
// const roundLineGeometry = new RoundLineGeometry(points, { radius: this._corner, close: this._close })
|
|
29
|
+
// const curve = roundLineGeometry.curve
|
|
30
|
+
// const currentPoints = curve.getPoints(1000)
|
|
31
|
+
// // 将点转换为二维坐标(只保留x和y)
|
|
32
|
+
// const points3D = currentPoints.map((p: Point) => new Vector3(p.x, 0, p.z))
|
|
33
|
+
// const geometry = new LineGeometry()
|
|
34
|
+
// geometry.setPositions(points3D.flatMap((p: Point) => [p.x, 0, p.z])) // 将二维坐标转换为一维数组
|
|
35
|
+
// // 创建一个线的网格物体(区别于原来的面的网格物体)
|
|
36
|
+
// const mesh = new Line2(geometry, material)
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// 创建一个线的网格物体(区别于原来的面的网格物体)
|
|
73
|
-
var mesh = new Line2(geometry, material);
|
|
74
|
-
return mesh;
|
|
75
|
-
}
|
|
38
|
+
const curvePath = createRoundedClosedCurve(points, this._corner, this._close);
|
|
39
|
+
const pathPoints = curvePath.getPoints(1000);
|
|
40
|
+
// const geometry = new THREE.BufferGeometry().setFromPoints(pathPoints)
|
|
41
|
+
// const mesh = new Line2(geometry, material)
|
|
42
|
+
// 将点转换为二维坐标(只保留x和y)
|
|
43
|
+
const points3D = pathPoints.map(p => new Vector3(p.x, 0, p.z));
|
|
44
|
+
const geometry = new LineGeometry();
|
|
45
|
+
geometry.setPositions(points3D.flatMap(p => [p.x, 0, p.z])); // 将二维坐标转换为一维数组
|
|
46
|
+
// 创建一个线的网格物体(区别于原来的面的网格物体)
|
|
47
|
+
const mesh = new Line2(geometry, material);
|
|
48
|
+
return mesh;
|
|
49
|
+
}
|
|
76
50
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
51
|
+
// Getter and Setter for fenceColor property
|
|
52
|
+
// get color(): string {
|
|
53
|
+
// return this._color
|
|
54
|
+
// }
|
|
81
55
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
56
|
+
// set color(newValue: string) {
|
|
57
|
+
// if (this._color === newValue)
|
|
58
|
+
// return
|
|
85
59
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
60
|
+
// this._color = newValue
|
|
61
|
+
// if (this.mesh)
|
|
62
|
+
// this.mesh.material.color = new Color(newValue)
|
|
63
|
+
// }
|
|
90
64
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
// Getter and Setter for fenceAlpha property
|
|
66
|
+
// get alpha(): number {
|
|
67
|
+
// return this._alpha
|
|
68
|
+
// }
|
|
95
69
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
70
|
+
// set alpha(newValue: number) {
|
|
71
|
+
// if (this._alpha === newValue)
|
|
72
|
+
// return
|
|
99
73
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return FillArea_Line_01;
|
|
106
|
-
}(FillAreaBase);
|
|
74
|
+
// this._alpha = newValue
|
|
75
|
+
// if (this.mesh)
|
|
76
|
+
// this.mesh.material.opacity = newValue
|
|
77
|
+
// }
|
|
78
|
+
}
|
|
107
79
|
export default FillArea_Line_01;
|
|
108
80
|
//# sourceMappingURL=fillArea_line_01.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","Line2","LineGeometry","LineMaterial","Vector2","Vector3","THREE","createRoundedClosedCurve","FillAreaBase","FillArea_Line_01","
|
|
1
|
+
{"version":3,"names":["Color","Line2","LineGeometry","LineMaterial","Vector2","Vector3","THREE","createRoundedClosedCurve","FillAreaBase","FillArea_Line_01","constructor","option","areaInstance","create","_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;AAOnB,MAAMC,gBAAgB,SAASD,YAAY,CAAC;EAC1CE,WAAWA,CAACC,MAAsB,EAAEC,YAA4B,EAAE;IAChE,KAAK,CAACD,MAAM,EAAEC,YAAY,CAAC;IAC3B,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;EAEAA,MAAMA,CAAA,EAAG;IACP,IAAI,CAACC,KAAK,GAAG,IAAI,CAACC,UAAU,CAAC,IAAI,CAACC,OAAO,EAAE,IAAI,CAACC,MAAM,EAAE,IAAI,CAACC,MAAM,CAAC;IACpE,IAAI,CAACJ,KAAK,IAAI,IAAI,CAACK,GAAG,CAAC,IAAI,CAACL,KAAK,CAAC;EACpC;EAEAC,UAAUA,CAACK,MAAiB,EAAEC,KAAa,EAAEC,KAAa,EAAE;IAC1D,IAAI,CAACF,MAAM,EACT;IACF;IACA,MAAMG,QAAQ,GAAG,IAAIpB,YAAY,CAAC;MAChCkB,KAAK,EAAE,IAAIrB,KAAK,CAACqB,KAAK,CAAC,CAACG,MAAM,CAAC,CAAC;MAChCC,WAAW,EAAE,IAAI;MACjBC,OAAO,EAAEJ,KAAK;MACdK,QAAQ,EAAErB,KAAK,CAACsB,cAAc;MAAE;MAChCC,SAAS,EAAE,KAAK;MAChBC,SAAS,EAAE,IAAI;MACfC,SAAS,EAAE,EAAE;MACbC,UAAU,EAAE,IAAI5B,OAAO,CAAC6B,MAAM,CAACC,UAAU,EAAED,MAAM,CAACE,WAAW;IAC/D,CAAC,CAAC;IACF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;IAEA,MAAMC,SAAS,GAAG7B,wBAAwB,CAACa,MAAM,EAAE,IAAI,CAACiB,OAAO,EAAE,IAAI,CAACC,MAAM,CAAC;IAC7E,MAAMC,UAAU,GAAGH,SAAS,CAACI,SAAS,CAAC,IAAI,CAAC;IAC5C;IACA;IACA;IACA,MAAMC,QAAQ,GAAGF,UAAU,CAACG,GAAG,CAAEC,CAAQ,IAAK,IAAItC,OAAO,CAACsC,CAAC,CAACC,CAAC,EAAE,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC,CAAC;IACvE,MAAMC,QAAQ,GAAG,IAAI5C,YAAY,CAAC,CAAC;IACnC4C,QAAQ,CAACC,YAAY,CAACN,QAAQ,CAACO,OAAO,CAAEL,CAAQ,IAAK,CAACA,CAAC,CAACC,CAAC,EAAE,CAAC,EAAED,CAAC,CAACE,CAAC,CAAC,CAAC,CAAC,EAAC;IACrE;IACA,MAAMI,IAAI,GAAG,IAAIhD,KAAK,CAAC6C,QAAQ,EAAEvB,QAAQ,CAAC;IAC1C,OAAO0B,IAAI;EACb;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EACA;EACA;EACA;AACF;AAEA,eAAexC,gBAAgB"}
|