let's just say we have a sloping level, like a ceiling. Then we have objects, like cubes, that hang from the ceiling. I wonder if there is any simple way to see the distance between the roof and the cube. Sure, i can measure it, but if there are, say, 10,000 cubes, measuring and calculating every distance doesn't seem nice. I almost know it's not possible, but I had to ask... Below is a picture that may somehow explain the problem. Thank you.
-
$\begingroup$ If all the cubes are the same height, it's pretty simple trigonometry. If you have say, 4 different possible heights for cubes, and all 4 cubes are at one of those levels, you just have 4 simple trigonometry equations to do $\endgroup$– josephhansenCommented Mar 17, 2022 at 15:29
-
$\begingroup$ Basic trigonometry, yes. But if the ceiling would be 8m high and the size of the ceiling would be 7m x 8m. Then we hang from random points, for example, 5000 3x3x3cm cubes at different heights. Some points include several cubes. It would be nice if you could see the distance between the ceiling level and the cube by clicking on the cube. Like you can see objects location in transform panel. $\endgroup$– stnprklCommented Mar 17, 2022 at 16:42
2 Answers
It is possible with Geometry Nodes:
What I'm doing is creating a line with two endpoints, then using a Raycast node to move the second vertex straight up until it hits a face in the target object. Be aware that the distance is calculated from the object's origin. This could be further improved to suit specific needs by moving the first vertex an appropriate amount (to measure not from the origin, but the top face, for ex). You could also measure horizontal distances (or any slant in-between) by changing the Raycast ray direction.
Most important part, the actual generation of the number is done with Ginyumbi's (free) Attribute Viewer node group:
To use, you can append the NodeTree "LaserMeasure" from the attached file below. You also need to download Ginyumbi's attribute viewer and append and link it as seen in the full node screenshot.
-
1$\begingroup$ Wow! This is more than great! I think this Geometry Node stuff can really be weird some times. I really appreciate your reply. And how well done and beautiful that reply is. Thank You! $\endgroup$– stnprklCommented Mar 17, 2022 at 21:15
-
$\begingroup$ You're welcome. What do you mean with "weird"? $\endgroup$– KuboåCommented Mar 17, 2022 at 21:16
-
1$\begingroup$ So many absolutely strange things you can do. Some times those node groups just make my head hurt. Powerful stuff. That's what I meant. Thanks again. $\endgroup$– stnprklCommented Mar 17, 2022 at 21:26
Easy just use Measurelt add-on that is included with Blender. These are the steps to do:
The add-on will measure the distance between origins of objects in XYZ.
I hope I helped you. The Measurelt docs
-
$\begingroup$ I'm fine, thanks for asking. Thank you for your answer. I know the MeasureIt tool, but unfortunately it doesn't solve my problem. I don’t need a origin point to origin point measure. Can't it be possible to change the x-axis angle in my case? How great it would be if there was a python wizard who could turn x-axix 20 degrees. $\endgroup$– stnprklCommented Mar 17, 2022 at 16:41
-
$\begingroup$ I thought in python code that could help you, it is about drawing a line from a face of an object that be in your case cubes and choose then the direction up or down of the cube and when the line hit a surface the face of the plane it will stop in this case the ceiling is the plane and then measure the length of line. This could help with some edits and it could be an add-ons , you just need one to code it. $\endgroup$ Commented Mar 17, 2022 at 17:35