AntoineSfx 42 Posted June 24, 2021 (edited) vector p8 = point(0,"P",8); @P.z = p8.z; Is there a shorter way to do it ? Edited June 24, 2021 by AntoineSfx Share this post Link to post Share on other sites
animatrix 287 Posted June 24, 2021 Hi, You can do it like this: @P.z = point(0,"P",8).z; Share this post Link to post Share on other sites
AntoineSfx 42 Posted June 24, 2021 1 hour ago, animatrix said: Hi, You can do it like this: @P.z = point(0,"P",8).z; No. It's like point() is seen as a float unless it is assigned explicitly to a vector. Share this post Link to post Share on other sites
Alain2131 42 Posted June 24, 2021 You indeed need to specify that point will return a vector by encapsulating it with the vector keyword. @P.z = vector(point(0, "P", 8)).z; Share this post Link to post Share on other sites
AntoineSfx 42 Posted June 24, 2021 16 minutes ago, Alain2131 said: You indeed need to specify that point will return a vector by encapsulating it with the vector keyword. @P.z = vector(point(0, "P", 8)).z; Thanks. I now realize that point is a template function - meaning the type which is returned depends on the second argument "P" , thus it's not obvious to the compiler that it's a vector at parse time. How hard would it be for the user to define a function with this signature once and for all: vector vpoint (int input; int ptnum) return vector(point(input,"P",ptnum)) or something closer to this related trick: v@opinput1_P.y -- but with an additional argument Share this post Link to post Share on other sites