Jump to content
Trilec

insert point along vector of two points in world units

Recommended Posts

Hi All,

Quick question,

Objective:

I have two points (could be any orientation), If the distance is greater than "x" meters ( in world units, 0.5m in this example) I would like to add an additional point 0.25 Meters along the vector (eg.from first point two second point direction)

 is there a VEX function for this?

cheers

 

Share this post


Link to post
Share on other sites

Hi,

There is no specialized function to do this but you can run this in a Detail Wrangle:

vector p0 = point ( 0, "P", 0 );
vector p1 = point ( 0, "P", 1 );

vector dir = p1 - p0;
if ( length ( dir ) > 0.5 )
{
    vector n = normalize ( dir );
    addpoint ( 0, p0 + n * 0.25 );
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×