chunk-SFI4OJO6.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import {
  2. a,
  3. c
  4. } from "./chunk-UE4KC4K5.js";
  5. import {
  6. s as s2
  7. } from "./chunk-YEJL5NEF.js";
  8. import {
  9. e,
  10. l3 as l,
  11. n5 as n,
  12. y3 as y2
  13. } from "./chunk-2Z2TG5CU.js";
  14. import {
  15. v
  16. } from "./chunk-SQOPWYIT.js";
  17. import {
  18. s2 as s
  19. } from "./chunk-E5O6P5I2.js";
  20. import {
  21. y
  22. } from "./chunk-SPWQ3AWG.js";
  23. // node_modules/@arcgis/core/geometry/support/MeshVertexAttributes.js
  24. var i;
  25. var l2 = "esri.geometry.support.MeshVertexAttributes";
  26. var c2 = s.getLogger(l2);
  27. var p = i = class extends l {
  28. constructor(r) {
  29. super(r), this.color = null, this.position = new Float64Array(0), this.uv = null, this.normal = null, this.tangent = null;
  30. }
  31. castColor(r) {
  32. return g(r, Uint8Array, [Uint8ClampedArray], { loggerTag: ".color=", stride: 4 }, c2);
  33. }
  34. castPosition(r) {
  35. r && r instanceof Float32Array && c2.warn(".position=", "Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array");
  36. return g(r, Float64Array, [Float32Array], { loggerTag: ".position=", stride: 3 }, c2);
  37. }
  38. castUv(r) {
  39. return g(r, Float32Array, [Float64Array], { loggerTag: ".uv=", stride: 2 }, c2);
  40. }
  41. castNormal(r) {
  42. return g(r, Float32Array, [Float64Array], { loggerTag: ".normal=", stride: 3 }, c2);
  43. }
  44. castTangent(r) {
  45. return g(r, Float32Array, [Float64Array], { loggerTag: ".tangent=", stride: 4 }, c2);
  46. }
  47. clone() {
  48. const r = { position: y(this.position), uv: y(this.uv), normal: y(this.normal), tangent: y(this.tangent), color: y(this.color) };
  49. return new i(r);
  50. }
  51. clonePositional() {
  52. const r = { position: y(this.position), normal: y(this.normal), tangent: y(this.tangent), uv: this.uv, color: this.color };
  53. return new i(r);
  54. }
  55. };
  56. function u(r, o, t, n2) {
  57. const { loggerTag: e2, stride: a2 } = o;
  58. return r.length % a2 != 0 ? (n2.error(e2, `Invalid array length, expected a multiple of ${a2}`), new t([])) : r;
  59. }
  60. function g(r, o, t, n2, e2) {
  61. if (!r)
  62. return r;
  63. if (r instanceof o)
  64. return u(r, n2, o, e2);
  65. for (const a2 of t)
  66. if (r instanceof a2)
  67. return u(new o(r), n2, o, e2);
  68. if (Array.isArray(r))
  69. return u(new o(r), n2, o, e2);
  70. {
  71. const n3 = t.map((r2) => `'${r2.name}'`);
  72. return e2.error(`Failed to set property, expected one of ${n3}, but got ${r.constructor.name}`), new o([]);
  73. }
  74. }
  75. function m(r, o, t) {
  76. o[t] = y3(r);
  77. }
  78. function y3(r) {
  79. const o = new Array(r.length);
  80. for (let t = 0; t < r.length; t++)
  81. o[t] = r[t];
  82. return o;
  83. }
  84. e([y2({ json: { write: m } })], p.prototype, "color", void 0), e([s2("color")], p.prototype, "castColor", null), e([y2({ nonNullable: true, json: { write: m } })], p.prototype, "position", void 0), e([s2("position")], p.prototype, "castPosition", null), e([y2({ json: { write: m } })], p.prototype, "uv", void 0), e([s2("uv")], p.prototype, "castUv", null), e([y2({ json: { write: m } })], p.prototype, "normal", void 0), e([s2("normal")], p.prototype, "castNormal", null), e([y2({ json: { write: m } })], p.prototype, "tangent", void 0), e([s2("tangent")], p.prototype, "castTangent", null), p = i = e([n(l2)], p);
  85. // node_modules/@arcgis/core/geometry/support/MeshComponent.js
  86. var u2;
  87. var m2 = "esri.geometry.support.MeshComponent";
  88. var h = s.getLogger(m2);
  89. var f = u2 = class extends l {
  90. constructor(r) {
  91. super(r), this.faces = null, this.material = null, this.shading = "source", this.trustSourceNormals = false;
  92. }
  93. static from(r) {
  94. return v(u2, r);
  95. }
  96. castFaces(r) {
  97. return g(r, Uint32Array, [Uint16Array], { loggerTag: ".faces=", stride: 3 }, h);
  98. }
  99. castMaterial(r) {
  100. return v(r && "object" == typeof r && ("metallic" in r || "roughness" in r || "metallicRoughnessTexture" in r) ? c : a, r);
  101. }
  102. clone() {
  103. return new u2({ faces: y(this.faces), shading: this.shading, material: y(this.material), trustSourceNormals: this.trustSourceNormals });
  104. }
  105. cloneWithDeduplication(r, t) {
  106. const s3 = { faces: y(this.faces), shading: this.shading, material: this.material ? this.material.cloneWithDeduplication(r, t) : null, trustSourceNormals: this.trustSourceNormals };
  107. return new u2(s3);
  108. }
  109. };
  110. e([y2({ json: { write: true } })], f.prototype, "faces", void 0), e([s2("faces")], f.prototype, "castFaces", null), e([y2({ type: a, json: { write: true } })], f.prototype, "material", void 0), e([s2("material")], f.prototype, "castMaterial", null), e([y2({ type: String, json: { write: true } })], f.prototype, "shading", void 0), e([y2({ type: Boolean })], f.prototype, "trustSourceNormals", void 0), f = u2 = e([n(m2)], f);
  111. var g2 = f;
  112. export {
  113. p,
  114. g2 as g
  115. };
  116. //# sourceMappingURL=chunk-SFI4OJO6.js.map