Model.hm_xformvectoratpointtoglobal#

Model.hm_xformvectoratpointtoglobal(x, y, z, system, node)#

Returns the three global components of a locally defined vector.

This function can be used in conjunction with Model.hm_xformvectoratpointtolocal() to convert a vector from one coordinate system to another.

Parameters:
  • x (double) – The x value should be given relative to the global coordinate system.

  • y (double) – The y value should be given relative to the global coordinate system.

  • z (double) – The z value should be given relative to the global coordinate system.

  • system (Entity) –

    The object describing the system entity.

    The x, y, and z values should be given relative to the local coordinate system . If system is a cylindrical system, r, t, and z must be used for x, y and z. If system is a spherical system, r, t, and p must be used for x, y and z.

  • node (Entity) – The object describing the node entity.

Returns:

Example#

Convert the vector ( 1,0,0 ) at base node with ID 10 defined in rectangular system with ID 5 to the cylindrical system with ID 8#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_xformvectoratpointtoglobal(
    x=1.0, y=0.0, z=0.0, system=ent.System(model, 5), node=ent.Node(model, 10)
)

x_glob = result.globalComponents[0]
y_glob = result.globalComponents[1]
z_glob = result.globalComponents[2]

_, result = model.hm_xformvectoratpointtolocal(
    x=x_glob, y=y_glob, z=z_glob, system=ent.System(model, 8), node=ent.Node(model, 10)
)

print("globalComponents",result.globalComponents)