Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Siemens PLM Community
- NX Manufacturing
- Discussion Forum - NX Manufacturing
- Two Vectors Angle

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-17-2018 12:35 PM - edited 04-17-2018 12:41 PM

Hello ,

is there any simple function that returns angle between 2 vectors (in 3D) ?

Or any good idea?

Because I calculate it step by step (with dot product,acos, vec length, etc..) and it is little bit tidious way

(I am calculating angle deviation in segmented tool path)

Thank you

---------------------------------------------

#♫ PB, 5ax, itnc, nx, vericut ♫ #

#♫ PB, 5ax, itnc, nx, vericut ♫ #

10 REPLIES

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-17-2018 09:10 PM

Hello @Juraj

This would be a good example to make a small custom application with one of the NX programming tools. Probably SNAP would be my first choice considering it's a simple select , measure then calculate function.

You could make a nice icon, add it to your toolbar to make it super simple to use.

Regards

Paul

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-17-2018 11:47 PM

In ugopen exist very useful function UF_VEC3_angle_between, return no sign angle 0..360 but you must to add third vector to define rotation from 1st to 2nd. Usually 3rd vector is a cross product 1st and 2nd.

In TCL you must to calc with dot, acos. Not so bad, if you need just value of angle and no need shortest angle from 1st to 2nd.

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 02:21 AM

In PostConfigurator there is a function that do this.

I give you the link where you can find it

https://docs.plm.automation.siemens.com/tdoc/nx/12.0.1/nx_help#uid:xid1128418:index_mfgpostconfig:xi...

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 02:42 AM

Here is a sample from the docs. Search for Angle Method.

Regards

Paul

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 03:13 AM

Hello,

thank you all for reply

I am not experienced in NX open programing :/

Anyway, I calculate angle between two tool path segment - sharp corner angle

and if there value bellow 120deg I output some smoothing function in NC code.

(Customer wish)

In short:

create 2 vectors from points - prev pos, pos, nxt pos / a_vec, b_vec

vec unitize

vec mag as a length / |a_le|, |b_le|

vec dot product / a.b

then cos_del [expr [VEC3_dot a_vec b_vec]/$a_le*$b_le]

and from cos get the angle

and then 180 - angle to get inside corner angle

---------------------------------------------

#♫ PB, 5ax, itnc, nx, vericut ♫ #

#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 03:34 AM

Hi @Juraj

I'm interested in this bit: "output some smoothing function in NC code" I assume you remove "pos" and replace with something. The length of each vector would be taken into account I assume.

Seems doable but would need some heavy testing. I'd be keen to pursue this further.

Do you want to do this during postprocessing or as a function on an existing G-Code file?

Paul

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 03:53 AM - edited 04-18-2018 03:55 AM

Hi,

I do it during postprocessing.

If angle is less than 120deg - I output G61, else I output G64.

I did it in CMD and as input points for vector I use mom prev pos, mom pos, mom nxt pos

Actually this logic seems working.

(To be honest, customer figure out that such logic is good I really dont know what machine will do.)

(They have probelms with braking and some others)

---------------------------------------------

#♫ PB, 5ax, itnc, nx, vericut ♫ #

#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 03:59 AM

Ok I see now. They want exact stop on something that should be defined and not washed away by the machine not stopping exactly at the programmed points probably because of high feedrates.

Thanks for the clarification.

Paul

Re: Two Vectors Angle

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2018 04:54 AM - edited 04-18-2018 04:55 AM

yes exactly

they trying to find some solution to keep sharp corners really sharp and on "flat" areas to keep smooth/fluent motion

(machine is a little bit dummy)

---------------------------------------------

#♫ PB, 5ax, itnc, nx, vericut ♫ #

#♫ PB, 5ax, itnc, nx, vericut ♫ #

**Learning Advantage** Learn NX CAM online at your own pace (Login required)

**Manufacturing Tutorials**

Already have NX CAM installed? Get hands-on with the in-software tutorials

**Product Support**

Contact Global Technical Access Center (GTAC)

Follow Siemens PLM Software

© 2019 Siemens Product Lifecycle Management Software Inc