Best way to update a mesh

Hello everyone,

I’m working on a Three.js project where I load a GLTF house model. I’ve set up raycaster logic to select a wall in the model. Now, I want to update the geometry of the selected wall efficiently.

Here’s what I need to do:

  1. Load a GLTF house model.
  2. Select a wall using raycaster logic.
  3. Update the geometry of the selected wall by extending its length from a specific point (e.g., the minimum point of its bounding box) without stretching the texture.

For example, in the screenshot below, I want to extend the length of the wall to the right, keeping the texture and other properties intact. What I mean increase the length from that point(without stretching it). I hope someone understands what I am trying to say.

Screenshot 2024-06-12 at 10.40.09 PM

What is the best way to achieve this in Three.js? Any advice or code snippets would be greatly appreciated!

Thanks in advance!

how do you plan to extend the wall when it has windows and frames in it? it doesn’t sound very feasible if you have to mess with geometry buffers. if you scale the wall it will stretch everything in it as well.

something like that is normally built from scratch either with topological cad, or constructive solid geometry.

i would use csg to built the basic walls, roofing, floor, and then insert the fixed stuff with separate models, windows + frames, doors, etc. like so CSG house - CodeSandbox

the vanilla library used in that sandbox is GitHub - gkjohnson/three-bvh-csg: A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh

1 Like

Thank you so much for the reply, So do you think it is possible at all to these CAD like functions to existing GLTF models? All I simply want is move walls the way I explained it.