@thatopen/components 3.2.4 → 3.2.6

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/index.mjs CHANGED
@@ -3540,8 +3540,8 @@ const _IfcLoader = class _IfcLoader extends Component {
3540
3540
  * Loads an IFC file and processes it for 3D visualization.
3541
3541
  *
3542
3542
  * @param data - The Uint8Array containing the IFC file data.
3543
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
3544
- * @param name - Optional name for the fragments model.
3543
+ * @param coordinate - Boolean indicating whether to coordinate the loaded IFC data. Default is true.
3544
+ * @param name - Name for the fragments model.
3545
3545
  * @param config - Optional extra data for loading the IFC.
3546
3546
  *
3547
3547
  * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data.
@@ -4636,24 +4636,19 @@ class SimpleRaycaster {
4636
4636
  }
4637
4637
  return fragResult;
4638
4638
  }
4639
- // /**
4640
- // * Casts a ray from a given origin in a given direction and returns the first item found.
4641
- // * This method also takes into account the clipping planes used by the renderer.
4642
- // *
4643
- // * @param origin - The origin of the ray.
4644
- // * @param direction - The direction of the ray.
4645
- // * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
4646
- // * @returns The first intersection found or `null` if no intersection was found.
4647
- // */
4648
- // castRayFromVector(
4649
- // origin: THREE.Vector3,
4650
- // direction: THREE.Vector3,
4651
- // items = Array.from(this.world.meshes),
4652
- // ) {
4653
- // // TODO: Implement for fragmentsmodel
4654
- // this.three.set(origin, direction);
4655
- // return this.intersect(items);
4656
- // }
4639
+ /**
4640
+ * Casts a ray from a given origin in a given direction and returns the first item found.
4641
+ * This method also takes into account the clipping planes used by the renderer.
4642
+ *
4643
+ * @param origin - The origin of the ray.
4644
+ * @param direction - The direction of the ray.
4645
+ * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
4646
+ * @returns The first intersection found or `null` if no intersection was found.
4647
+ */
4648
+ castRayFromVector(origin, direction, items = Array.from(this.world.meshes)) {
4649
+ this.three.set(origin, direction);
4650
+ return this.intersect(items);
4651
+ }
4657
4652
  intersect(items = Array.from(this.world.meshes)) {
4658
4653
  const result = this.three.intersectObjects(items);
4659
4654
  const filtered = this.filterClippingPlanes(result);
@@ -17629,6 +17624,7 @@ const _Clipper = class _Clipper extends Component {
17629
17624
  plane.world.renderer.setPlane(false, plane.three);
17630
17625
  plane.dispose();
17631
17626
  this.updateMaterialsAndPlanes();
17627
+ this.onAfterDelete.trigger(plane);
17632
17628
  });
17633
17629
  }
17634
17630
  /** {@link Disposable.dispose} */
@@ -20807,7 +20803,7 @@ class IDSSpecification {
20807
20803
  return xml;
20808
20804
  }
20809
20805
  }
20810
- const getParameterValue = (property, parseNumericString = true) => {
20806
+ const getParameterValue = (property) => {
20811
20807
  if (!property)
20812
20808
  return void 0;
20813
20809
  const result = {};
@@ -20825,7 +20821,13 @@ const getParameterValue = (property, parseNumericString = true) => {
20825
20821
  if ("enumeration" in restriction) {
20826
20822
  result.type = "enumeration";
20827
20823
  const enumeration = restriction.enumeration.map(
20828
- ({ value }) => parseNumericString ? value : String(value)
20824
+ ({ value }) => {
20825
+ if (restriction.base.includes("string"))
20826
+ return String(value);
20827
+ if (restriction.base.includes("integer") || restriction.base.includes("double"))
20828
+ return Number(value);
20829
+ return value;
20830
+ }
20829
20831
  );
20830
20832
  result.parameter = enumeration;
20831
20833
  }
@@ -20919,19 +20921,19 @@ const createMaterialFacets = (components, elements) => {
20919
20921
  }
20920
20922
  return facets;
20921
20923
  };
20922
- const createPropertyFacets = (components, elements, parseNumericString) => {
20924
+ const createPropertyFacets = (components, elements) => {
20923
20925
  const facets = [];
20924
20926
  for (const element of elements) {
20925
20927
  const psetParameter = element.propertySet;
20926
20928
  const baseNameParameter = element.baseName;
20927
- const pset = getParameterValue(psetParameter, parseNumericString);
20928
- const baseName = getParameterValue(baseNameParameter, parseNumericString);
20929
+ const pset = getParameterValue(psetParameter);
20930
+ const baseName = getParameterValue(baseNameParameter);
20929
20931
  if (!(baseName && pset))
20930
20932
  continue;
20931
20933
  const facet = new IDSProperty(components, pset, baseName);
20932
20934
  if (element.cardinality)
20933
20935
  facet.cardinality = element.cardinality;
20934
- const value = getParameterValue(element.value, parseNumericString);
20936
+ const value = getParameterValue(element.value);
20935
20937
  facet.value = value;
20936
20938
  facet.dataType = element.dataType;
20937
20939
  facet.uri = element.uri;
@@ -21042,7 +21044,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21042
21044
  *
21043
21045
  * @returns An array of IDSSpecification instances created from the parsed data.
21044
21046
  */
21045
- load(data, config = { parseNumericString: true }) {
21047
+ load(data) {
21046
21048
  const result = [];
21047
21049
  const ids = _IDSSpecifications.xmlParser.parse(data).ids;
21048
21050
  const { specifications, info } = ids;
@@ -21082,11 +21084,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21082
21084
  applicabilities.push(...facets2);
21083
21085
  }
21084
21086
  if (facetName === "property") {
21085
- const facets2 = createPropertyFacets(
21086
- this.components,
21087
- elements,
21088
- config.parseNumericString
21089
- );
21087
+ const facets2 = createPropertyFacets(this.components, elements);
21090
21088
  applicabilities.push(...facets2);
21091
21089
  }
21092
21090
  if (facetName === "partOf") {
@@ -21124,11 +21122,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21124
21122
  reqs.push(...facets2);
21125
21123
  }
21126
21124
  if (facetName === "property") {
21127
- const facets2 = createPropertyFacets(
21128
- this.components,
21129
- elements,
21130
- config.parseNumericString
21131
- );
21125
+ const facets2 = createPropertyFacets(this.components, elements);
21132
21126
  reqs.push(...facets2);
21133
21127
  }
21134
21128
  if (facetName === "partOf") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thatopen/components",
3
3
  "description": "Collection of core functionalities to author BIM apps.",
4
- "version": "3.2.4",
4
+ "version": "3.2.6",
5
5
  "author": "That Open Company",
6
6
  "contributors": [
7
7
  "Antonio Gonzalez Viegas (https://github.com/agviegas)",