# How to bend a cylindrical geometry by X degrees at X height (and do it multiple times)

Hi there, i’m working on this pen where i’m attempting to bend a long geometry at X height by X degrees and for X area of effect. https://codepen.io/funianrun/pen/QzQQJB

I’ve managed to bend it in a long arcing motion. However i’d like to confine the bend to only a section of the cylinder and not the entire thing. In my main project, the geometry is bent after applying effects like waves, and after extruding it from a bezier curve created in a 2D canvas.

I tried lerping from the original vector to the new vector created by the bend formula, but it creates a sharp hacked off shape at the bend point.

Here’s a pic of what i’m trying to get:

/cc

I’ve made such distortions.

Take a look at the code.
Maybe you’ll find something.

http://sandboxthreef.threejs.hofk.de/formLibrary.html
see
//0002 knot / various knots - http://www.mi.sanu.ac.rs/vismath/taylorapril2011/Taylor.pdf

https://github.com/hofk/THREEf.js/blob/dev/THREEf_90/THREEf.js
see line … 2052 function xyzCalculation() { …

2 Likes

awesome thank you! really interesting stuff. I’m not sure i understand the math yet, but i will keep trying.

it seems like best option will be to use the THREEf like this, but without the time variable:

my_cylinder.createMorphGeometry = THREEf.createMorphGeometry;
my_cylinder.createMorphGeometry( parameters );

Why don’t you copy this example:

https://threejs.org/examples/?q=extrude#webgl_geometry_extrude_shapes

but instead of using a triangle or a star as your base shape, you could use a circle.

@marquizzo
He needs to bend this:

The profile is not constant along the length of the “cylinder”.

1 Like