Very interesting. Having 3 parts all you need is an equation to fit the case. Generally one can start from the following:
ax + by + cz +d = 0
and plug in your points, given that you have all it needs. So you might be doing it in an analytical form inside of your script.
But, imo, this isn’t the easiest way to implement it inside of a script, since you’ll still have to think of how to translate the equation into a new part. We can, instead, divide the process into 3 steps:
1 ) get 2 points and calculate the vector spacing from one to another point (i.e. (x1-x2, y1-y2, z1-z2)), then create a part in that direction.
2 ) get the third point you want to make the plane pass through and rotate the part you created earlier then extend the size of the part to the point (simple having to calculate the magnitude of the normal vector to the part that reaches to point 3; the normal vector is the one vector whose scalar product with the other vector is 0; we do this since we want to extend the part in a perpendicular direction);
3) I guess that’s it. But remember, the one presented above is a method used for parts. If you’re planning onto playing with wedges or such, things chanel a bit, since you’ll have to manipulate a specific vertex of the part. Besides this, the procedure should be pretty much the same.