.NET

## .NET

Valued Contributor
Posts: 51
Registered: ‎11-01-2001
Message 1 of 3 (516 Views)

516 Views, 2 Replies
03-22-2012 08:15 AM

Hi,

when you have a 3D-object, with a specific origin, i would like to know how it is positioned in space, X, Y, and Z coordinates, but also A, B, and C (like Tilt, Roll, Pitch), where A is rotation Angle around Z-axis, B around Y-axis, and C around X-axis. I am using this for a kuka robot

i can change the position of the UCS, but don't know how to only rotate the ucs about the Z-axis

'--- Set origin of UCS icon

acUCSTblRec.Origin = Psource(0)

acUCSTblRec.XAxis = Psource(0).GetVectorTo(Psource(1))

acUCSTblRec.YAxis = acUCSTblRec.XAxis.GetPerpendicularVector

kind regards

Wouter de Haan

Valued Contributor
Posts: 95
Registered: ‎11-15-2011
Message 2 of 3 (463 Views)

03-27-2012 12:55 PM in reply to: wbdehaan

hi wouter

there's much about coordinate systems in the developer guide starting here

(contents tab / 'work in three-dimensional space' header)

effectively you define an object coordinate system for your object (or entity coordinate system) in form of an ucstablerecord by setting origin and 2 axis, e.g. origin and an x and y vector at an angle (e.g. as you've shown), and add it to the ucstable. you then transform the coodinates from the ocs (or ecs) to the world coordinate system and vice versa. the matrix3d.aligncoordinatesystems() returns a transformation matrix for use in any coordinate's .transform() method.

going back to your question, if i understand you right then you have to first define the ocs (or ecs), then define the A, B and C ucs and then transform the object coordinates from ocs to ucs via object.transform(ocs2ucs()_matrix3d) and then transform the respective ucs to wcs via object.transform(ucs()2wcs_matrix3d). - provided you are apt with matrices, you can combine the two steps into one by multiplying the two matrices.

on second thought, provided the ocs (or ecs) is already equal to wcs you could make do with 3 transformations, from ucs() to wcs.

personally, i found it essential to go through the pages in the developer's guide first, but hope this helps.

felix

Valued Contributor
Posts: 51
Registered: ‎11-01-2001
Message 3 of 3 (423 Views)

04-06-2012 04:39 AM in reply to: FFlix

The problem was that I first had to rotate about the Z-axis in line with the object, that gave me the A-axis orientation, and after that, and after that calculate the angle between the XZ-plane which gave me the B-axis en YZ-plane that resulted in the C-axis.

kind regards,

Wouter

Recently Solved