Proposal: add orientation option to triangle node
I find the current version of the triangle node to be almost useful in many situations... except that there is no way to control the orientation of the resulting triangle.
This is a particular problem when using the node for more advanced setups with points not in a flat XY plane- say, trying to generate triangles projecting from a surface.
Even a consistent arbitrary orientation would be preferable to the current semi-arbitrary rotations used to lock the third point to the XY plane:
Manually calculating with respect to a plane, however, gives a consistent orientation that's easier to manipulate:
My suggested implementation would to have an "up" vector and direction vector (or perhaps a quaternion) for maximum flexibility, as an optional input with a toggle in the node panel. The absolute ideal would be to have it vectorized, so that one could easily create a series of triangles with orientations given by something like curve matrices or edge normals
not sure i understand aim. wikipedia or wolframalpha links? Or draw grece pencil
Here's a simpler example, maybe that will make the problem clearer:
Output for A and B on the XY plane, adequate for simple use cases:
Output for slanted A and B. Trigonometry calculations ignore Z elements, and node creates a triangle such that CZ=0 with incorrect side lengths and angles. This is not useful output, and there is no error message indication that the node fails for such input.
A partial solution that can use the node's existing formulas would calculate the triangle in two dimensions, then use a given direction vector (here it's Y-up converting to Z-up, which would make a good default) to figure out the plane matrix to align that to.
In case it also helps, a simplified version of the use case that made me realize the limitations of the triangle node, and a mockup of the extra input (applied as a matrix multiplication on the previous comment's matrix):
I needed to project a third point from two known points on a surface. In the more complicated version, the exact offset needed varies, but is similar in that it is most easily defined using A B Alpha Beta and a normal perpendicular to the line AB. A triangle node that works in 3-space makes this calculation simple.
I also suggest adding a "C only" output, because it is tedious to have to split it off from A and B when I only need C.
some nodes have defective options. i.e. some days ago i fixed mirror node for matrix mirror case. So, someone have to make revision for trizngle_mk2, sadly, not me for a moment.
Hi! I am the author of the node :D and you are right, the node should be renamed triangle 2D
I would approach the problem this way:
If you have the matrix where the triangle should lie you could multiply A and B frist by the inverted of the matrix, use the triangle node and multiply by the matrix
But I see your pain, it would be much easier to do it with a matrix input. Also the C output is an easy and good idea too.