/
toglobal (Object)

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.

  • Global coordinates are universally applicable and provide a common reference for multiple objects within a larger context.

  • Local coordinates are specific to individual objects and are used to define their properties and transformations within their own reference frame.

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 (https://openbrim.org/app/?incubator=1&author=ParamML_Examples_OpenBrIM+Platform&obj=objidbytucev4obd1o7gn1fio2p )

 

 

Related content

Custom Function
Custom Function
Read with this
Objects
Objects
More like this
Group
More like this
3D Geometric Objects
3D Geometric Objects
More like this
Surface
Surface
More like this
Point
More like this