Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<O N="VolumeObject2" T="Project" Category="3D Geometric Objects" TransAlignRule="Right">
    <!-- created by ParamML Examples on 01.02.2023 -->
    <O N="WrongPrism1" T="Volume" Y="50">
        <O T="Surface" Z="0">
            <O T="Point" X="10" Y="-10" />
            <O T="Point" X="10" Y="10" />
            <O T="Point" X="-10" Y="10" />
            <O T="Point" X="-10" Y="-10" />
        </O>
        <O T="Surface" Z="25">
            <O T="Point" X="-5" Y="-5" />
            <O T="Point" X="5" Y="-5" />
            <O T="Point" X="5" Y="5" />
            <O T="Point" X="-5" Y="5" />
        </O>
    </O>
    <O N="WrongPrism2" T="Volume">
        <O T="Surface">
            <O T="Point" X="10" Y="-10" />
            <O T="Point" X="10" Y="10" />
            <O T="Point" X="-10" Y="10" />
            <O T="Point" X="-10" Y="0" />
            <O T="Point" X="-10" Y="-10" />
        </O>
        <O T="Surface" Z="30">
            <O T="Point" X="5" Y="-5" />
            <O T="Point" X="5" Y="5" />
            <O T="Point" X="-5" Y="5" />
            <O T="Point" X="-5" Y="-5" />
        </O>
    </O>
</O>

To view this example in the library, see (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objid2geiywza70kl99birr5c9)

Example:

Code Block
languagexml
<O N="VolumeObject3" T="Project" Category="3D Geometric Objects" TransAlignRule="Right">
    <!-- created by ParamML Examples on 01.02.2023 -->
    <P N="width" V="20" Role="Input" />
    <P N="height" V="10" Role="Input" />
    <P N="a" V="toglobal(surface1)" />
    <P N="b" V="toglobal(surface2)" />
    <P N="Global_Z_of_Surface1" V="a[0][2]" />
    <P N="Global_Z_of_Surface2" V="b[0][2]" />
    <O N="TopElevation" T="Group" Z="5">
        <O N="Volume1" T="Volume" Z="height">
            <O N="surface1" T="Surface" Z="1">
                <O T="Point" X="width" Y="-width" Z="3" />
                <O T="Point" X="width" Y="width" Z="3" />
                <O T="Point" X="-width" Y="width" Z="3" />
                <O T="Point" X="-width" Y="-width" Z="3" />
            </O>
            <O N="surface2" T="Surface" Z="12">
                <O T="Point" X="width/2" Y="-width/2" Z="8" />
                <O T="Point" X="width/2" Y="width/2" Z="8" />
                <O T="Point" X="-width/2" Y="width/2" Z="8" />
                <O T="Point" X="-width/2" Y="-width/2" Z="8" />
            </O>
        </O>
    </O>
</O>

If all the points on a surface have the same coordinate value, it can be represented as a common value in the brackets. This is equivalent to writing the same coordinate value for each point.

For example, since all the Z values in the first "Surface" object are 0, they can be written in a single line in the surface object definition, instead of writing them individually for each point. The hierarchy of these lines can be seen using the "toglobal" function.

The example shows that the "Group" volume contains the volumes from the outermost to the innermost, including both surface1 and surface2.

In other words, the Z value of surface1 is calculated as 3 + 1 + 10 ( height) + 5 = Z → 19, starting from the innermost point. The Z value of surface2 is calculated as 8 + 12 + 10 (height) + 5 = Z → 35.

Image Added

To view this example in the library, see (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objidntg1e8ow40d9jdlx6oj3m)

Example: