How to remove unused polygons and vertices using code?

Hi all!

I’m working on a new functionality and for it I need to create new geometry from one model, directly in 3D, on which I will then apply a texture.

I created a test scene that replicates my functionality. Let’s say you have two geometries and then we get the intersection of these geometries. Next, I need to click to select only the required geometry surface and delete all others. My goal is to leave the curved area and remove the rest. How can I implement this? Is it possible to check the angles between polygons and remove those polygons whose angles exceed, say, 80 degrees? Or is there another way to automatically remove polygons and vertices that do not fall within the selection frame (then I need to somehow select polygons with a frame)?
In general, I need to implement the standard functionality of any 3D editor, but unfortunately I have to do it directly in the browser because it will be done by people not trained in 3D. It is possible that getting the intersection and then removing the unnecessary one is not very optimal, then I am open to any suggestions!

Hey! I’m not entirely sure I get want you want but if I’m not wrong, you want to pick some faces (on the surface) and remove the rest?

Can you maybe make a picture or something to explain your goal?

1 Like


I need to place an embrlidery in different areas on different 3D models, so I need to show users where this areas, for this areas i need create a new instrument for creating this areas :blush:

What about decals? or vertex paint maybe?

It’s not help because i need prepared areas on the model, we cannot does embroidery everywhere, only on prepared places. and then show user this areas and user choose where he want place an embroidery, i know about decals, and i have a working code with the decals, but it is not get accurately positioning.

You should be able to restrict where decals can be placed by detecting the pointer pick/hit on the object and only applying the decal if it’s within certain UVs.

See PickingInfo.getTextureCoordinates()

thanks for you answer! I did this but i cant place decal without going beyond the boundaries of the region. So this is a problem - I can’t made embroidery out off boundary, so I look a way to create a plane on 3D model and then use this plane for put on texture with text.

Probably it is easier to create such 3D planes in some DCC tool like Blender.

I would like to create this in Babylon, but after many hours of research I can agree with this.

1 Like