0
$\begingroup$

Is it possible to get coordinates (in a global coordinate system) of a vector that is collinear with an edge using some default Blender feature or some add-on? I need these coordinates for the rotation axis coordinates to animate an aileron of aircraft. The edge is selected on a picture below. enter image description here

enter image description here

Also, I'm wondering how to get coordinates for a normal vector that is perpendicular to selected face (for animation gauges on dashboard). Of course, I could get these coordinates using coordinates of vertex and calculation, but I hope it can be done automatically.

$\endgroup$
4
  • 2
    $\begingroup$ How are you going to animate it? $\endgroup$ Commented Jul 27 at 20:34
  • 1
    $\begingroup$ If you select the edge and use "3D Cursor to Selection" command, 3D cursor is moved where the edge is. After that you can use "Origin to 3D Cursor" to move objects origin, so it will rotate around the edge. Or, you can use "Selection to 3D Cursor" to move for example Empty where cursor is, and then parent wing to it. $\endgroup$ Commented Jul 27 at 20:43
  • 1
    $\begingroup$ @khellstr has asked the most important question. Usually, via parenting the component as a separate object, this calculation would be made unnecessary. $\endgroup$ Commented Jul 28 at 7:45
  • $\begingroup$ @khellstr, I am going to animate it not in Blender, but in a separeate Lua script for one free simulator game. So, I need to know three coordinate values for the vector that is collinear with the selected edge. I know the commands "3D Cursor to Selection" and "Origin to 3D Cursor", but they do not define the rotation plane at all. $\endgroup$ Commented Jul 28 at 12:58

1 Answer 1

1
$\begingroup$

With Geometry Nodes, you can get World Position of the Vertices. Also, naturally, do all kind of vector math for those. Here I calculated a vector that is collinear to the edge, with length of 1. Data can be read from the Spreadsheet. (It could be written as a mesh in the 3D view too, but that is probably not what you need)

enter image description here

With this same method we can get the Face normal too: enter image description here ( A small hindrance in this method is that sadly you can't copy values from the Spreadsheet. I would recommend getting Windows Powertoys app, that has an utility for copying text from anywhere in screen to clipboard)

If you need Local coordinates, you can set transformation in Object Info to Original
enter image description here

For selection from which elements we want to have info, we use an Attribute, which type is Boolean and domain same as the element we want the information.

Attributes can be created from Object properties: enter image description here

And set from here : enter image description here You need to have the attribute and the element you want to set selected.

As final words I'd like to add that I don't know if this is the most straight forward way to do this. Maybe there are simpler methods. I assume that with some scripting you could get those values to a text file, for example.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.