Alingned Node Coordinate Value (TCL Script)

Felipe Cunha1
Felipe Cunha1 New Altair Community Member
edited October 2020 in Community Q&A

Hi,

 

How can I determine the node coordinates aligned from two nodes without need to use a temporary node technique.

A function type:

Input1:   two nodes N1 and N2    ( For Vector Definition)

Input2:   Node   N3  ( To be projected perpendicularly  to N1 and N2 vector )

output:  Aligned N3     (New Coordinate  ==>  X,Y and Z )

 

Thanks in Advance,

Felipe

 

Answers

  • tinh
    tinh Altair Community Member
    edited June 2019

    Hi

    I don't remember transforming matrix. But use vectors to find V04:

    (N4 is projected of N3)

    <?xml version="1.0" encoding="UTF-8"?>20190612_101312.thumb.jpg.11e1f9ab9cf2e9777086865282d49a16.jpg

     

    From V13 you can utilize built-in package math::linearalgebra

     

    <?xml version="1.0" encoding="UTF-8"?>20190612_101802.thumb.jpg.1c741f46ed956fc016fe83879ddb0147.jpg

  • Felipe Cunha1
    Felipe Cunha1 New Altair Community Member
    edited June 2019

    Hi Tinh,

     

    I really appreciated your code, but unfortunately HM could not found the ::math::linearalgebra package. It is possible be installed our use an similar  hypermesh library?

     

    Thanks,

    Felipe

  • Felipe Cunha1
    Felipe Cunha1 New Altair Community Member
    edited June 2019

    Hi Tinh,

     

    I found a similar functions in hypermesh:

    ::hwat::math::VectorCrossProduct {vector1} {vector2}

    ::hwat::math::VectorNormalize {valuelist} normvalue

     

    It solved now.

     

    Thanks very much!

    Felipe

  • tinh
    tinh Altair Community Member
    edited June 2019

    Even if there is no available function, you can write them easily. Google for their formula.

  • tinh
    tinh Altair Community Member
    edited June 2019

    An example expanse usage of expr command to do vector operations:

    <?xml version="1.0" encoding="UTF-8"?>20190613_085919.thumb.jpg.3584f7f5a8818834824fa4e2c5e1f968.jpg

  • Manoj Yandra
    Manoj Yandra Altair Community Member
    edited August 2020

    I want to get the coordinates of a node and use it in defining the base point (while projecting). Can you please tell me how to do this?

  • tinh
    tinh Altair Community Member
    edited August 2020

    Try

    set coords [ join [hm_nodevalue $nid]]