Middle extrusion for mesh

geometry

#1

I’m currently creating a three js app and I just want to ask if this is possible. So my goal is create a model in blender that’s like mesh #1 on the image below, export it thru blender gltf exporter by KhronosGroup, import it in Three JS and extrude the mesh in the middle to achieve mesh #2 in the image below.

The reason for doing this is I need to display a model that could have a dynamic length and let user control the length of the model thru the app’s UI.

Is this possible? If not, is there a way for me to achieve the behavior that I need to accomplish?


#2

Unfortunately, there is not built-in function that automatically performs your intended task. ExtrudeGeometry only extrudes a 2D shape into a 3D geometry, so it’s not helpful for your use case. I guess you have to implement the logic for manipulating the geometry by yourself.


#3

It would be better to provide a live code example with the model from Blender.


#4

Crossposting:


#5

I’ll try creating a live code sample. For the stackoverflow link, I forgot to add the link to my post. Sorry about that.


#6

It might be easier to separate your model into 3 parts. 1 for each end and 1 for the center that will expand.
Instead of ‘extruding’ the shape, you scale the center part and translate the two ends to match it.