Using the bmesh module, I have an edge extracted from other bmesh ops. I'm trying to use the distance_point_to_plane utility to find the distance from another point, parallel to this edge to an infinite plane residing on one of it's verts.
The only data I have is the 2 verts of this edge. I'm Using one of the vert.co for plane_co but I'm struggling to understand how to create the plane_no normal.

The normal of the plane needs to face along the length of the edge, same as the Y axis is facing in this image:
enter image description here

The plane_co would be the vert on the right.

How do I determine the normal along the length of the edge to use as plane_no given only the 2 vert.co vectors?

  • $\begingroup$ Can you provide us with a simple drawing of what you are actually trying to do? This is quite confusing. Are you trying to create a plane at one of the two vertices that has its normal facing in the direction of the edge? $\endgroup$ Apr 15, 2023 at 10:14
  • $\begingroup$ @JiříHonzák I'm not creating anything, I'm simply trying to figure out what the normal vector should be when using docs.blender.org/api/current/… $\endgroup$
    – Psyonic
    Apr 15, 2023 at 10:20
  • $\begingroup$ I want the plane_no variable when using docs.blender.org/api/current/… to align with the edge along it's length $\endgroup$
    – Psyonic
    Apr 15, 2023 at 10:21

1 Answer 1


Not sure whether I understand correctly what you are trying to achieve. To get a directional vector from two position vectors you simply subtract them.

Let's say you have a point A (3,4,0) and point B (-5,2,1).

Now you want you directional vector to start from A and go to point B.

The directional vector AB-> is (-5,2,1) - (3,4,0) = (-8, -2, 1)

This will create a normal vector that goes along the curve. If you have a plane at one of the two edge vertices, it's always gonna be perpendicula to the edge

  • $\begingroup$ Thanks, this is what I was doing but wasn't sure it was right. I'm getting strange results sometimes. Must be a problem elsewhere $\endgroup$
    – Psyonic
    Apr 15, 2023 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .