toglobal (Object)
toglobal (object) → number It shows the global coordinates of points within objects ("Surface," "Volume," "Line," etc.) that contain only point objects and have no other intermediate objects. It accumulates local values hierarchically and converts point coordinates from local to global values.
For example, in a 3D graphics, global coordinates might be used to position objects within a scene, while local coordinates would define an object's shape and how it is transformed within the scene. |
Example:
<O N="toglobalObject1" T="Project" Category="Functions" TransAlignRule="1">
<!-- created by ParamML Examples on 8/24/2023 -->
<P N="GlobalCoordinates" V="toglobal(Line1)" />
<P N="GlobalCoordinates_R1_Z" V="GlobalCoordinates[0][2]" />
<P N="LocalCoordinates_R1_Z" V="Line1.R1.Z" />
<O T="Group" X="5" Y="14" Z="12">
<O N="Line1" T="Line" X="2" Y="3" Z="6">
<O N="R1" T="Point" X="5" Y="10" Z="20" />
<O N="R2" T="Point" X="-5" Y="-10" Z="-20" />
</O>
</O>
</O> |
Debug Trace |
In the example above, the "Line1" object contains points with local coordinates [5,10,20] for R1 and [-5,-10,-20] for R2. When considering the Z value of the R1 point, its local Z coordinate is recorded as LocalCoordinates_R1_Z=20. Correspondingly, when accounting for the same point's global Z value within the hierarchical context of the "Group" object, the sum of 12, 6, and 20 yields a GlobalCoordinates_R1_Z=38. |
To view this example in the library, see (Engineering on Cloud ) |