"Cannot convert argument to Geom::Vector3d" error
-
I get a: "Cannot convert argument to Geom::Vector3d" error and I can't see what I'm doing wrong here:
Code snippet:sel.each{|e| tr = e.transformation ip = tr.origin xa = tr.xaxis ya = tr.yaxis a_vector = Geom;;Vector3d.new(a_center.x-ip.x, a_center.y-ip.y, 1) if(@@axis == "X") obj_axis = xa # I've tried with this... obj_axis = Geom;;Vector3d.new(xa) # ...this... obj_axis = Geom;;Vector3d.new(xa.to_a) # ...and this elsif(@@axis == "Y") #obj_axis = ya obj_axis = Geom;;Vector3d.new(ya.to_a) end#if angle = a_vector.angle_between obj_axis ### ArgumentError; Cannot convert argument to Geom;;Vector3d # do more stuff here... } -
Before the line starting
angle...
Add in these to see what the arguments you pass areout the possible obj_axis permutations and retest...
` p e
p trp a_vector
p obj_axisp a_vector.to_a
p obj_axis.to_a`If one or both of them are NOT vectors, then we've got somewhere...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement