After giving this some more thought here is my proposed algorithm, feel free to find the holes in it:
1.) User selects the (end) face of the stud, joist, beam or rafter they want to extend.
2.) The user then selects the face (plane) they want to extend to.
(now the algorithm in the API)
3.) Find all of the vertices and edges belonging to selected face in step 1.
4.) Find each edge attached to the vertices in step 3 that is not belonging to the edges that make up the face.
5.) Check each edge found in step 4 by assigning a vector to one of them and then checking that each edge is parallel to this vector. If they are all parallel then proceed to step 6, if not abort.
6.) Check that the normal of the target face (step 2) is not perpendicular to the vector in step 5, if it is abort.
7.) Calculate the geometric line for each parallel edge (step 4). Then find the point (new vertex) for each line with the intersect_line_plane method and the plane (step 2).
8.) Calculate the distance between the new vertex (point) and the existing vertex (point), then move each vertex the calculated distance in the direction of the vector (step 5).
1.) User selects the (end) face of the stud, joist, beam or rafter they want to extend.
2.) The user then selects the face (plane) they want to extend to.
(now the algorithm in the API)
3.) Find all of the vertices and edges belonging to selected face in step 1.
4.) Find each edge attached to the vertices in step 3 that is not belonging to the edges that make up the face.
5.) Check each edge found in step 4 by assigning a vector to one of them and then checking that each edge is parallel to this vector. If they are all parallel then proceed to step 6, if not abort.
6.) Check that the normal of the target face (step 2) is not perpendicular to the vector in step 5, if it is abort.
7.) Calculate the geometric line for each parallel edge (step 4). Then find the point (new vertex) for each line with the intersect_line_plane method and the plane (step 2).
8.) Calculate the distance between the new vertex (point) and the existing vertex (point), then move each vertex the calculated distance in the direction of the vector (step 5).