Skip to content

Commit

Permalink
fix(front): correct face measurement position when model has transform
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Jul 23, 2024
1 parent 5ceb4e6 commit 086855d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.1.7",
"version": "2.1.8",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
7 changes: 7 additions & 0 deletions packages/front/src/measurement/FaceMeasurement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ export class FaceMeasurement
counter += 3;
}

this.preview.position.set(0, 0, 0);
this.preview.rotation.set(0, 0, 0);
this.preview.scale.set(1, 1, 1);
this.preview.updateMatrix();

this.preview.applyMatrix4(mesh.matrixWorld);

const buffer = new Float32Array(position);
const attr = new THREE.BufferAttribute(buffer, 3);
this.preview.geometry.setAttribute("position", attr);
Expand Down

0 comments on commit 086855d

Please sign in to comment.