Beams and beamgroups

Beams

Parent element name: hill
Element name: beam

The beam is a bollard. It's ideal to create for example simple handrail. Many beams can be defined as one element named beamgroup.

Positioning beams

NameTypeAllowed valuesDescriptionOptional
x[1, 2]?FloatThe starting and/or ending point in position relative to the X-axis
y[1, 2]?FloatThe starting and/or ending point in position relative to the Y-axisTrue
z[1, 2]?FloatThe starting and/or ending point in position relative to the Z-axisTrue
refx[1, 2]?StringA built-in reference which applies for refx or custom refx idA reference to the X-axis, which beam is based on
refy[1, 2]?StringA built-in reference which applies for refy or your defined profile nameA reference to the Y-axis, which beam is based onTrue
refz[1, 2]?StringA built-in reference which applies for refz or your defined profile nameA reference to the Z-axis, which beam is based onTrue

WARNING

Beams are always created along the shortest possible path between [x, y, z]1 to [x, y, z]2. It isn't possible to create curved beams.

Advanced beams positioning and rotating

TIP

In many cases, you don't need to use attributes from this table. However, they can be helpful, if you want to make a realistic-looking hill.

NameTypeDescriptionOptional
ny[1, 2]?FloatThe starting and/or ending point in position perpendicular (using normal vectors) relative to refy[1, 2]? profileTrue
nz[1, 2]?FloatThe starting and/or ending point in position perpendicular (using normal vectors) relative to refz[1, 2]? profileTrue
n_[x, y, z]FloatThe [X, Y, Z]-coordinate of a normal vector to one of the side edges of the beamTrue

TIP

By changing n_[x, y, z] attributes, you can control the rotation of the beam sides.

Sizing beams

NameTypeDescriptionOptional
r[1, 2]?+FloatBeam radius
rb[1, 2]?+FloatSecond beam radius valueTrue

TIP

Specify the rb attribute to create the ellipse beam.

TIP

r[1, 2] (rb[1, 2]) are usually used if the beam is to have a different radius at both ends.

Controlling sides

NameTypeDefault valueDescriptionOptional
edges+IntegerEdges count
smoothBooleanFalseToggles smooth sidesTrue
rectBooleanFalseToggles a cuboid shapeTrue
sideBooleanTrueToggles rendering sides of the beamTrue
end[1, 2]BooleanFalseToggles rendering full shapes of beamsTrue
invertBooleanFalseToggles the inversion of all sides of the beamTrue

Texturing beams

TIP

If you have two surfaces that are overlapping each other, specify the zbias attribute, so this surface will appear "above" the second surface

NameTypeDescriptionOptional
[t, m, c][Texture, Material, Color]Texture, material and color
zbias+IntegerZ-indexTrue

Beamgroups

Parent element name: hill
Element name: beamgroup

Beamgroup is a group of beams defined using one element named beamgroup. So instead of declaring beams multiple times, you can have one beamgroup.

TIP

All beams' attributes are working also with beamgroups. However, some extra attributes apply for beamgroup only.

TIP

The stepper attribute can't be described using only words, as it includes advanced math and deep knowledge of DSJ4 code. In most cases setting its value to 0 should be enough, however, the difference between values can be noticed.

Managing steps

NameTypeDefault valueDescriptionOptional
step+FloatStep between beams
fitstepBooleanToggles equal beams arrangementTrue
stepper+integer<0; 5>Step management way

Rendering beamgroups

NameTypeDefault valueDescriptionOptional
firstBooleanTrueToggles rendering the first beam in beamgroupTrue
lastBooleanTrueToggles rendering the last beam in beamgroupTrue
end[1, 2]BooleanFalseToggles rendering full shapes of beamsTrue
sideBooleanTrueToggles rendering sides of the beamTrue

Positioning beamgroups

TIP

Beamgroups render multiple beams in a range of positions from [x, y, z]1 to [x, y, z]2.

The intermediate points for beams are calculated with the following formula (for stepper="0"):

P(n) = P1 + [(P2 - P1) / Distance(P2 - P1)] * n * step,

where P1 is [x, y, z]1 point in the global coordinate system and P2 is [x, y, z]2 point in the global coordinate system.

TIP

These attributes manage the ending points of each beam relative to P(n) points from the previous tip.

NameTypeDescription
dx[1, 2]?FloatThe ending points of beams in position relative to X-axis
dy[1, 2]?FloatThe ending points of beams in position relative to Y-axis
dz[1, 2]?FloatThe ending points of beams in position relative to Z-axis
ny[1, 2]?FloatThe ending points of beams in position perpendicular relative to refy[1, 2]? profile
nz[1, 2]?FloatThe ending points of beams in position perpendicular relative to refz[1, 2]? profile
n_[x, y, z]FloatThe [X, Y, Z]-coordinate of a normal vector to one of the side edges of the beams

Code snippets

<hill version="DSJ4-1.10.0">
    <!-- Rest of code omitted for clearance -->
    <!-- This XML outputs in simple barrier placed on left side of the inrun. -->
    <beam x1="5" x2="25" y="1.5" z="1.5" r="0.025" edges="8" end1="true" end2="true" smooth="true" t="Textures\metal.png" m="Materials\metal.xml" c="0x505050" refx="inrun" refy="inrun-top"/>
    <beamgroup x1="5" x2="25" y="0" z="1.5" r="0.025" edges="8" dy1="0" dy2="1.5" end1="false" end2="true" smooth="true" stepper="1" step="1" t="Textures\metal.png" m="Materials\metal.xml" c="0x505050" refx="inrun" refy="inrun-top"/>
</hill>