# Maintaining shape integrity while manipulating an extruded 3D shape's vertices

Good day, all!

What I have is:

1. Users can draw a 2d shape on the ground.
2. Users extrude the 2d shape into 3d.
3. Once 3d, users will be able to move/manipulate any vertex of the 3d object freely.

However, when moving the vertex too much, I lose shape integrity. (Vertex gets disconnected from resulting previously-adjacent vertices, resulting in the face getting disconnected from adjacent faces)

I’m a total BabylonJS beginner, forgive me please.

Vertex manipulation | Babylon.js Playground (babylonjs.com)

Hi @Grogu and welcome to the forum.
If the mesh geometry data is set as updatable, then it should work properly.
It’s hard for us to help you without a working PG. We’d be glad to help you if you provide a small PG that repro the issue you are facing

1 Like

Alright, I will try my very best to reproduce this said problem in the PG!

1 Like

I don’t see anything weird in the code and it behaves well when I’m using it. what do you mean by shape integrity? faces disappear?

the tool doesnt work vey well when I try it. You need to revise your code that converts screen space coords into your 3d space.

I did something like this in Unity many years ago , I vaguely remember it involves a plane being created with the orientation of the model , a ray getting created from the camara to the 2d point that was converted into 3d space , although unity has a built in function for that , not sure what math was used. then using that ray and the created plane a hit point is found. Although this all was only permitting moving in a single xz plane (where y is up )

Actually not sure how this would be handled if expecting to move in three dimentions , because a single direction in screenspace could be a movement in all three planes , how much movement in each is then decided?

That is only a vague reproduction of my whole code.

Is there a way you can try out my whole code?

Should I perhaps make a GH repo of it and post the link here?

trying the whole code would be counter productive in this case, you should be able to isolate the broken behavior in the playground for us to look into it I know it is sometimes hard but might even highlights the issue during the process.