Notifications
Clear all

[Closed] extend 2 point line in z axis

Hello,

I am wondering how i can extend a 2 point line for example by 10 cm.
the points dont contain any directions, so a vector has to be made.
I think this is done by (P2 – P1), but then.

See the image below.

2 Replies

Hi,

just found the solution.
here is the example code. i almost had it correct, just had to normailze the vector so it would have a value of 1.

 new_point = vertex_array[2] - vertex_array[1]
new_point= normalize new_point
afsteun = vertex_array[1] + (-10 * new_point)
 3ak
fn moveP2 p1 p2 dist = 
(
	p3 = p2-p1
	p1 + p3*(1+(dist/(length p3)))
)