FeatureScript: How to query (not in viewer!) points and lines to create planes?
leon_poot
Member, Developers Posts: 87 ✭✭✭
I'd like to create a plane in FS using either:
- three points which I create as variables, vector(x,y,z) * meter
- a line (more or less an axis, since it seems infinite) created using line(point,direction) and a point
"A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools." - Douglas Adams, Mostly Harmless
Tagged:
0
Best Answer
-
Typically, to create a plane you need an origin and a normal vector. If you created 3 points, you don't need to query anything. You already have vector variables representing those points.
Next, some math. Let's call the points A, B, and C. The origin will be just the average of the 3 points.
origin = (A+B+C)/3
The normal is a little more complicated. You'll need to calculate the cross product of 2 coplaner lines. This can be achieved with the cross command.
normal = cross(C - A, B - A)
Now, you can use the evPlane function.
newPlane = plane(origin, normal)7
Answers
-
Typically, to create a plane you need an origin and a normal vector. If you created 3 points, you don't need to query anything. You already have vector variables representing those points.
Next, some math. Let's call the points A, B, and C. The origin will be just the average of the 3 points.
origin = (A+B+C)/3
The normal is a little more complicated. You'll need to calculate the cross product of 2 coplaner lines. This can be achieved with the cross command.
normal = cross(C - A, B - A)
Now, you can use the evPlane function.
newPlane = plane(origin, normal)7
