How to use Euler sequences
I'm trying to write a LISP function to let me add Coordinate Systems with Body Euler Sequences using Pitch, Yaw, Roll.
So far I can create a coordinate system and set an offset it, but I can't seem to rotate it using LISP calls.
Is this even close or is there a something completely different that does the same thing?
Thanks,
Damion
(use-package :oli)
(defun create-cs-pyr (frame-name owner-path parent-cs x y z pitch yaw roll)
(let ( (frame-path nil) (frame-obj nil)(origin nil) (x-dir nil) (y-dir nil) (z-dir nil))
(pos_create_coordinate_system :owner owner-path :name frame-name :u_name "x" :v_name "y"
:w_name "z" :by_ref_coord_sys :ref_coord_sys parent-cs :offset_u x :offset_v y :offset_w z
:done)
(complete)
(setq frame-path (concatenate 'string owner-path "/" frame-name))
(setq frame-obj (sd-pathname-to-obj frame-path))
(setq origin (getf (sd-inq-coord-sys-elem-value frame-obj :origin t ) :origin))
(setq y-dir (getf (sd-inq-coord-sys-elem-value frame-obj :y-axis t ) :y-axis))
;; How to get this to work or something similar? Once the coordinate system is rotated about the y-axis (Pitch), I'd like to query the new orientation and
;; do the yaw and roll?
(pos_create_coordinate_system :action :position :coord_sys frame-obj :rotate :axis :pt_dir origin (second y-dir) :rotation_angle (sd-deg-to-rad pitch) complete)
(setq z-dir (getf (sd-inq-coord-sys-elem-value frame-obj :z-axis t ) :z-axis ))
(setq x-dir (getf (sd-inq-coord-sys-elem-value frame-obj :x-axis t ) :x-axis ))
)
)
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

