ScriptSpot

Forum topic · General Scripting

Tape Helper value problem

By Mrjacks2o · 2012-06-27

Description

Hi i am trying to get the the ZX plane Value of my Tape Measure helper.
i attached a picture of what i mean by ZX plane value so i don't confuse anyone.

i know how to get the distance
getTapeDist $tape001

but cant get the ZX plane value.

Thanks in advance

Attachments
Comments (3)

function

jos · 2012-06-27

wrote a function for it, much better


function getToPlane TapeNode ToPlane =
(
	n1 = [TapeNode.pos.x - TapeNode.target.pos.x,TapeNode.pos.y - TapeNode.target.pos.y,TapeNode.pos.z - TapeNode.target.pos.z]
	abs( acos (dot (normalize n1) (normalize ToPlane)) - 90)
)
getToPlane $ [0,0,1]

you'll have to calculate this

jos · 2012-06-27

seems that you cant acces this info.
this script get the "To .. Plane"
the first function in comments is for "To .. Axis"


x1 = $Tape001.pos.x
x2 = $Tape001.Target.pos.x

y1 = $Tape001.pos.y
y2 = $Tape001.Target.pos.y

z1 = $Tape001.pos.z
z2 = $Tape001.Target.pos.z

n1 = [x1,y1,z1]/[x2,y2,z2]
n1 = [x1-x2,y1-y2,z1-z2]
n2 = [0,0,1]

--fn getVectorsAngle n1 n2 = ( acos (dot (normalize n1) (normalize n2)) )
fn getVectorsAngle n1 n2 = abs( acos (dot (normalize n1) (normalize n2)) - 90)
	
ToAxis = getVectorsAngle n1 n2

print ("To " + n2 as string + " Axis = " + ToAxis as string)

Mrjacks2o · 2012-06-27

Thanks!!!! so in my case to get the value of "ZX"
I changed the getToPlane $ [0,0,1] to -> getToPlane $ [0,1,0]
thanks so much for your help :)