<p>How can I remodel a line, i want to draw first a line then i want to remodel the line such as in paint software, which algorithm should I use? Are there several algorithms to achieve this? i am using the bresemhan algorithm</p>
<p>For example i have this line, but when i will click in the center and with the mouse i want to pull</p>
<p><a href="https://i.sstatic.net/n7LXS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/n7LXS.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2020-09-02T07:33:02.690Z
I find it hard to understand what exactly you want to achieve. I guess you draw a straight line and then "pull" to make it a curve? If you add a sketch or two, it might help.
Tare
CC BY-SA 4.0
2020-09-02T14:42:57.653Z
@Tare i edited my question
hubman
CC BY-SA 4.0
2020-09-03T05:46:31.683Z
From quickly reading up on the Bresenham algorithm, it has little to do with with your line you want to draw. You also don't mention the framework you're using, so this is still tricky to answer. However, the two things that come to mind when creating a curved line based on certain points are Splines and Bezier Curves. Your points would be the start and end point from your first line drawing, plus either the center or the point closest to the mouse click when pulling (and then to wherever you pull it). Based on that, you should be able to get a curve
Tare
CC BY-SA 4.0
2020-09-03T18:18:19.527Z
@Tare bezier curves can i use to 3d as well?
hubman
CC BY-SA 4.0
2020-09-05T21:35:41.700Z
@hubman i dont know sure, but bezier curves is used to 2d and 3d.
information
CC BY-SA 4.0
2020-09-07T07:57:42.877Z
In theory you could just use the Bezier Curve in any plane and then project it into your 3D world. If you want to use it for surfaces, there are Bezier Surfaces (see https://en.wikipedia.org/wiki/B%C3%A9zier_surface ). If you just want a curve going through all 3 dimensions, there are some sources for that as well (see https://mathcurve.com/courbes3d.gb/bezier3d/bezier3d.shtml ). So I guess any way you look at it you should be fine in 3D.
Tare
CC BY-SA 4.0
2020-09-15T04:52:19.673Z
I might add that for more control (with more implementation and math complexity off course) BSplines are great. Pomax has a primer on Bézier that ends with them so you might look into that.
Felipe Gutierrez
<algorithm>
How can i stretch a line?
hubman
# How can i stretch a line?

(Asked by: username_0 on 2020-09-02)

How can I remodel a line, i want to draw first a line then i want to remodel the line such as in paint software, which algorithm should I use? Are there several algorithms to achieve this? i am using the bresemhan algorithm

For example i have this line, but when i will click in the center and with the mouse i want to pull

[![enter image description here](https://i.sstatic.net/n7LXS.png)](https://i.sstatic.net/n7LXS.png)

**Tags:** algorithm

> **Comments:**
> **username_1**: I find it hard to understand what exactly you want to achieve. I guess you draw a straight line and then "pull" to make it a curve? If you add a sketch or two, it might help.  
> **username_0**: @username_1 i edited my question  
> **username_1**: From quickly reading up on the Bresenham algorithm, it has little to do with with your line you want to draw. You also don't mention the framework you're using, so this is still tricky to answer. However, the two things that come to mind when creating a curved line based on certain points are Splines and Bezier Curves. Your points would be the start and end point from your first line drawing, plus either the center or the point closest to the mouse click when pulling (and then to wherever you pull it). Based on that, you should be able to get a curve  
> **username_0**: @username_1 bezier curves can i use to 3d as well?  
> **username_2**: @username_0 i dont know sure, but bezier curves is used to 2d and 3d.  
> **username_1**: In theory you could just use the Bezier Curve in any plane and then project it into your 3D world. If you want to use it for surfaces, there are Bezier Surfaces (see https://en.wikipedia.org/wiki/B%C3%A9zier_surface ). If you just want a curve going through all 3 dimensions, there are some sources for that as well (see https://mathcurve.com/courbes3d.gb/bezier3d/bezier3d.shtml ). So I guess any way you look at it you should be fine in 3D.  
> **username_3**: I might add that for more control (with more implementation and math complexity off course) BSplines are great. Pomax has a primer on Bézier that ends with them so you might look into that.  

---

## 0 answers

