Skip to main content

1D arrays - Generator L1S

Overview

Generator L1S is one of two types of Generator included with RailClone.

Generators use a set of construction rules that determine how to build the object. You can define which segments to use for each part of a spline, For L1S these options include: default, start/end, corners and evenly spaced. The segments are assigned by connecting a Segment node to the respective input in the generator's node.

Each type of generator is specialised in one task. L1S is used to create linear structures along a path, defined by a single Spline base object. It uses the following base objects, segments and rules.

  • Spline(Optional): Uses a Spline input to identify the object in the scene to be used as the construction path. Alternatively, create an array without a spline by entering a value in the General > Geometry > X.Size.property.
  • Clipping Area(Optional): Uses a single closed spline to cut through the RailClone object. Clipping splines can be set to include or exclude geometry.
  • Surface(Optional): Uses a mesh object as a surface. When a Surface object is attached

to segments will conform to the surface by projecting them along the RailClone object's Z Axis.

At least one of the following inputs must be used in order for the L1S generator to create geometry. The diagram at the top of this page demonstrates a typical style that uses all of these inputs.

  • Default: used as the base mesh in the event that the other nodes have no inputs. If one of the following inputs is left empty, the segment wired to the default input will be used.
  • Start: creates a segment at the start of the path, as defined by the spline's original vertex numbers.
  • Corner: creates a segment at each of the intermediary vertices of the construction spline. Can be set to only create a segment on certain types of vertex i.e. corner. bezier-corner, bezier, smooth, or on all of these.
  • Evenly: creates evenly spaced segments along the construction path.
  • End: create a segment at the end of the path as defined by the spline's original vertex numbers.

Procedures

To create a basic L1S generator

A L1S generator requires a spline to be used as the path and at least one mesh to construct the object. This procedure assumes these have been created in the scene.

  1. Create a new RailClone object by going to Create>Geometry>Itoo Software>RailClone Pro and drag out a new RailClone object in the viewport.

  2. With the new RailClone object selected, go to the Style rollout and click on the Open Style Editor button

  3. Drag a new L1S Generator from the Items list to the Construction View.

  4. The X axis of an L1S generator can be defined using a simple numerical dimension or by using any spline as a path. To use a dimension enter a value in the Geometry>X Size parameter, alternatively to use a spline, drag a new Spline Node. ) to the Construction View and wire to the spline input of the L1S Generator

  5. A new spline input will appear in the Base Objects rollout of the Max Plugin. Highlight this and from the properties section click on the spline name (will be None by default) and pick a spline from the scene. By default, all new base objects will be named spline. In the case of complex style with multiple inputs it is sensible to rename the nodes from the properties panel in the style editor, these names will be reflected in the Base Objects rollout.

  6. In the style editor create a new Segment Node () for each of the input slots you plan to use, remember that segment nodes can be wired to multiple inputs

  7. Wire the Segment Node output to the relevant L1S NodE input. Below is an example that uses the same segment for multiple inputs.

  8. For each Segment Node go to Properties and select the Object to be used from the scene

  9. Adjust the Segment settings for each node to achieve the desired result

  10. Adjust the Generator's rules as appropriate, changes will be visible in real-time in the viewports. See the reference below for more information about the relevant settings.

Use a spline as a clipping area

In RailClone it is possible to use an enclosed spline as a clipping area . This procedure assumes you already have a style and need to add this functionality.

A rectangular spline being used as a clipping area.

  1. From the Style rollout open the Style Editor

  2. Add a new Spline Node .

  3. Wire the new Spline Node to the Clipping input node of an L1S generator

  4. With the L1S Generator selected go to the Properties Editor and set the Clipping Mode to include or exclude as desired.

  5. Close the Style editor. Go to the Base Objects rollout in the 3DS Max plugin, select the clipping item from the list and choose the spline from the scene.

To add a surface to an L1S Array

  1. Drag a new Surface object to the construction View

  2. Wire the Surfaces output to the Surface input of an L1S Generator.

    RailClone Linear interfaceRailClone Linear interface

  3. From the Base Objects rollout, select the surface from the list then click the surface picker button and select a mesh object from the scene.

To distribute evenly spaced segments based on distance

  1. Attach a new Segment Node to the Evenly slot of an L1S Generator. In the Properties View, choose the segment you wish to distribute evenly by clicking the blank Object slot and picking from the scene.

  2. Select the L1S Generator to Properties>Rules>Evenly and set the mode to Distance.

  3. Set the Distance value to determine the space between segments.

  4. Change the Adjust to End setting to control the minimum length the remaining space at the end of a path can be before a new segment is added. This property is measured as a percentage of the Distance setting.

  5. Turn on Justify if you require the first space at the beginning and last space at the end of the path to be equal.

  6. Turn on Adaptive node if you wish to equalise the spacing between all the evenly segments.

  7. If you are using Mirror to create two paths, turn on Sync Offset to maintain the same number of evenly spaced segments in both paths.

To distribute evenly spaced segments based on a fixed number of divisions

  1. Attach a new Segment Node to the Evenly slot of an L1S Generator. In the Properties View, choose the segment you wish to distribute evenly by clicking the blank Object slot and picking from the scene.

  2. Select the L1S Generator to Properties>Rules>Evenly and set the mode to Count. Set the Count value to determine the number of evenly spaced divisions to place along the spline.

To prevent clipping of segments at the start or end of the path

It is possible to automatically scale segments so that they fill a path with only whole segments, avoiding clipping at the start or end. Assuming you already have a segment in the default input:

  1. From the Generator's properties, go to Rules>Default and set the mode to Adaptive.
  2. Set the Adaptive Percentage to control the minimum length of remaining space before a new segment is added (see the section below for a more detailed explanation).

To Cap Clipped Geometry

  • Enable Cap Holes from the Generator's properties.

To align a corner segment to the path

  1. Open the Style Editor. Select the L1S Generator you wish to apply this rule to.

  2. Go to Properties>Rules>Corner and turn on Align to Path.

  3. Alternatively, turn this property off to align the corner with the preceding segment.

The pillar on the right demonstrates Align to Path on, the left image shows the rule switched off

To create mirrored and offset geometry

  1. Either adapt an existing RailClone style or Create a new L1S generator as described above

  2. In the Style Editor, select the L1S Generator you wish to mirror

  3. Go to Properties>General>Geometry and turn on Mirror. Use the Y Offset value to displace the geometry either side of the path.

  4. To flip the mirrored copy, turn on Flip B. To flip the original copy, turn on Flip A. If the style uses Evenly segments that do not correctly align, go to Properties>Rules>Evenly and turn on Sync Offset

    In this example mirror is used to position lamp posts either side of a street. In the top example Sync Offset is on, in the bottom example it is off

To create a style that places an object only on vertices of a designated type

  1. Either adapt an existing RailClone style or Create a new L1S generator as described above.

  2. Open the Style Editor and attach a Segment Node to the Corner input of the L1S Generator. In the L1S Generator to Properties>Rules>Corner choose the Vertex Type or types you wish to apply the segment to from the drop-down list.

To create a style that uses several different corner objects based on vertex type

  1. Either adapt an existing RailClone style or Create a new L1S generator as described above.

  2. Go to Properties>Rules>Corner>Vertex Type and set it to All.

  3. For each different vertex type you wish to target, create a new Conditional Node with a segment wired to the True input slot

  4. For each Conditional node, set the Properties>Vertex>Type to On and choose the Vertex Type from the drop-down list.

  5. Wire the conditional nodes together in series, each Conditional node's output is wired to the False input of the following.

  6. Wire the final Conditional node to the L1S Generator's Corner input

To set a generator to use only spline segments with a designated material ID

  1. With the L1S generator selected, go to Properties>Limits and turn on "Material ID".

  2. Designate a Material ID Value. From the drop-down list identify whether a segment is used by being either equal. lesser. greater on not equal to this value.

  3. To change the Material ID of a spline segment add an Edit Spline modifier, select a segment and go to Surface Properties>Material>Set ID

    .

    If you see no effect, check the Generator's Rules>Default>Mode is set to Tile or Scale.

Interface

Spline

This node defines the construction path along which segments are distributed. Though the node is created in the style editor, the spline object is selected from the Max plugin. This is to enable the easy reuse of a style without the need to repeatedly open the style editor. When assembling segments, RailClone aligns the X axis if each segment with this spline.

Changing the spline settings has an effect on all the segments attached to the generator, the spline settings are found under the General section in the Properties Editor.

X Size

Allows you to build the RailClone object without the need to use a spline as a path. The X Size parameter defines the length of the X Axis in scene units.

Reverse

Reverses the direction of the path. This has the same effect as applying a "Reverse" command to an editable spline.

Flatten Stepped

Enable this option to automatically flatten the path in the positions where RailClone uses segments in Stepped mode. This feature is used to fix alignment issues that may appear with railings and sloped paths as demonstrated in the diagram below.

Mirror

Creates a copy of the geometry at the opposite side of the path. Use it in combination with the "Y Offset" parameter to move the geometry an equal distance on the either side of the path on the Y axis.

Flip A/B

Flips the RailClone geometry using the path as a mirror axis. A is the original object, and B is the copy created with the Mirror feature.

Double guardrail using Mirror, Offset Y and Flip B

Cap Holes

When checked, holes caused by boolean clipping and slicing are automatically capped. Faces generated from clipping areas are mapped using parameters from the Segment's Deform>Apply Box Mapping settings. Mapping parameters are taken directly from the Segment node, and are not affected by UVW XForm operators.

Material ID

Sets the material ID for capped faces.

X Offset

Applies the specified offset to the entire generator along the X path.

Y Offset

Applies the specified offset perpendicular to the path's direction.

Simple Y Offset

Standard Y-Offset uses a sophisticated algorithm to compute Y-Offset paths, but in some cases does not generate the expected result. Simple Y-Offset provides an alternative algorithm that may resolve these problems. Enable this mode if you get distorted geometry when using standard Y-Offset.

Z Offset

Translates the geometry the specified distance in the Z axis.

X Rotation

Rotates the segments along the direction of the spline. This parameter has the same effect that Style->Geometry->Rotation. but only affects segments attached to the individual generator. This is useful when creating styles that use multiple generators. In this situation both values are added to get the total X rotation.

Clipping Area

Uses a closed spline as a boundary region, using it to clip the geometry of the object. RailClone clipping is much more efficient that a 3DS Max boolean operation, and optimizes the instanced geometry when using the VRay/Mental Ray geometric shader.

Mode

Defines the clipping mode: Include preserves the geometry inside the area, and Exclude removes the geometry inside the area.

Projection

Clipping works in 2D, projecting the spline along the axis defined by this parameter (X,Y or Z in the local coordinates of the RailClone object).

UVW Offset

When using RailClone's automatic box mapping feature, these settings allow you to offset the box mapping on the UVW axes. For more information about box mapping, see the entry on Segments

Default

If there are no other applicable rules, RailClone uses this segment by default. There are two operation modes: Tile and Scale.

Tile

The segment is replicated along the path. RailClone applies the deformation parameters defined in the Segment properties, such as slicing the segment automatically to fit the path's length or applying the padding distances.

Scale

In this mode, the default segments are scaled along the X axis to fit the distance between the initial and final positions of the path section. A section is defined by the start and end points of the spline unless an X-Evenly or corner segment is used to subdivide the path. When scale mode is active the bevel settings are greyed out.

Adaptive

Adaptive mode calculates the number of whole segments that would fit along a spline segment then scales them on the X axis to fill the available space. This mode generates complete segments, with no clipping at the start or end of a spline segment.

Adaptive Percentage: this value specifies the minimum length of remaining space (expressed as a percentage of the segment's original size on the X axis), at which a new segment can be added. For example if a segment's X-dimension is 1m and the spline length is 4.25m, the segment will fit into the distance 4 times (4 x 1m = 4m). The remaining space is 0.25m, therefore a new segment will be added if the Adaptive Percentage is set at or below 25%.

Count Mode: scales a fixed number of segments to fit between the start and end positions of a path section. A section is defined by the start and end points of the spline unless an X-Evenly or corner segment is used to divide the path.

Count Parameter: defines the number of segments to scale along the path when Count Mode is enabled.

Scale Padding: When enabled any segment padding is scaled on Scale, Count, or Adaptive modes. If it is disabled, the padding is constant.

info

It is possible to not assign a default segment. You can use this, for instance, to place objects evenly spaced along a spline (see "Evenly" section below), without any other segments between them.

Start

Lets you specify a segment for the start of the path.

info

Sometimes you would need to assemble several segments for each position, not only one piece. In this case, you can use a "Compose" operator, to join several elements in a unique segment.

End

Works like the "Start" rule, but applied to end of the spline.

Corner

This construction rule is applied on specified vertices of the path, to create corners and bevels. To create corners, you must assign a segment to the "Corner" connector on the generator's node, however to use the bevel features, no segment should be used.

Vertex Type

It is possible to only add corner segments to vertices of a specified type. Thus, parameter defines which vertex types will be used from the following values: "Corner or Bezier-Corner", "Corner", "Bezier-Corner", "Bezier", "Smooth" or All.

Align to Path

Enable this option to create smooth transitions of the corner segment along the path's trajectory. When off, RailClone aligns the corner with the last segment of the spline.

Fillet Radius

Adjusts the path to create a rounded corner. The numeric parameter defines the radius of the fillet arc.

Bevel Mode

Creates beveled edges in the corners, slicing the geometry of the Default segment. If Bevel is disabled, RailClone bends the geometry of the Default segment along the corner.

There are four Bevel modes available, which define the displacement of the segments before and after a bevel's edge.

  • Reset. Each segment is placed at its default position (defined by the Alignment and Padding values), without applying any displacement.
  • Extend: extends the geometry of the segments along the bevel, giving an appearance of continuity.
  • Symmetric. Creates symmetrical geometries at both sides of the bevel's edge.

Offset

Applies a global displacement to all segments along the spline. The value is defined as a percentage of the segment's size (from 0% to 100%).

Bevel Corner

When active, bevels the segment attached to the corner input, slicing the geometry. If Bevel Corner is disabled, RailClone bends the geometry of the Corner segment around the corner.

The alignment of the geometry in relation to the Corner depends on the number of segments used in the Inner Corner input. The examples below explain how using a single, odd or even number of segments affects the alignment.

Segments used in this example

In the following examples these segments are used in the corner input. Where multiple segments are used, they are wired to a compose operator.

Using a single corner segment

When using a single segment in the corner input, the geometry is duplicated and a segment is placed on either side of the vertex. The position is adjusted to ensure that the full length, measured on the outside face and along the X axis, is maintained irrespective of the angle of the corner.

Using an even number of corner segments

Duplicates the segment immediately before the center then places other segments on left/right depending on order in the compose operator. Using an even number of segments always creates an asymmetric composition.

Using an uneven number of corner segments

Duplicates the center segment then places other segments on left/right depending on their order in the compose operator. Using an odd number of segments always creates a symmetrical composition.

Bevel Corner Offset

Allows you to adjust the offset of the Corner segments. Distance is measured as a percentage of the length of the corner segment. positive values pull the segment towards the corner, negative values will move the segments away from the corner. If a negative value is sufficiently large a gap will appear. The example below illustrates the effect of increasing the Offset value, bringing together and slicing the corner segments.

info
  • The Bevel feature works better on straight lines and wide corner angles. You will get incorrect results on narrow angles or curved paths.
  • In closed splines, it's not possible to adjust the segment displacement in the last corner, because it depends on the path's length.
  • Bevel is not compatible with the Default segment in Scale mode.

Evenly

This construction rule lets you add evenly spaced segments along the path. As always, you must assign a Segment to the respective connector in the generator's node.

Distance

Defines the distance between the evenly segments, specified in scene units by the Distance parameter.

Count

Defines a set number of evenly segments, specified by the value of the Count parameter.

Adjust to End (Distance Mode Only)

This value specifies the minimum length (as a percentage of the distance parameter), at which a new even segment can be added.

For instance: using a value of 40% and Distance = 2m, RailClone adds new segments only if the length from the last evenly segment to the end is greater than 0.8m.

Justify (Distance Mode Only)

When activated the first and last segment are equal, creating a symmetrical distribution.

Adaptive to (Distance Mode Only)

Adaptive mode is used to ensure the spacing between Evenly segments is identical. This mode calculates the number of times the full Evenly distance can be distributed along the path then divides that number by the path's length to generate a new equalised spacing. 3 modes are available, either an off number of divisions, an even number, or any number,

Reverse (Distance Mode Only)

If Justify or Adaptive mode are both off, the space between evenly segments will be measured at precise intervals from the start of the array. Use the reverse option to start the evenly measurements from the end of the array.

Sync Offset

When an Offset Y displacement is used, by default RaiClone computes the positions of the even segments on the offset path, using the Distance parameter. This may be a problem in mirrored objects over curved paths, because the segments are not aligned on both sides. With "Sync Offset" enabled, the plugin uses the base path (without Offset Y applied) to place the evenly segments, and then translates the positions to the offset path, solving this issue.

Marker

Marker

Allows you to filter which Marker IDs and Modifiers generate Marker segments

From/To ID

allows you to set a range of marker IDs. Any markers with IDs outside this range are ignored.

Modifier

When using multiple RC Spline modifiers it is possible to limit a generator to use just one. The index is counted from the top of the modifier stack downwards. Setting this value to 0 will allow RailClone to use markers in all the RC Spline modifiers applied to a path.

Limits

Sometimes it is necessary to combine several generators in a unique RailClone object, applying each one of them to certain parts of the spline. These limits are defined here.

Material ID

Applies the generator only to the spline's segments with the material ID specified. To define a material ID in a spline, use Editable Spline->Sub-object Segment->Surface Properties>Material. acceptable

values are single numbers, ranges and multiple entries separated by commas. For example: "1,3,5-8".

Padding

Adds an offset to the Start and End of the generator. All calculations, such as evenly spacing, are based on the new length of the array after the offset has been applied.

Limit by Material ID not working

Occasionally when using the Limit by Material ID option of a generator to restrict geometry to a particular section of a spine, it is generated incorrectly. This is often caused by using Adaptive mode, found in the spline's Interpolation roll-out, which can scramble the material IDs. If this issue occurs, simply turn off Adaptive mode to restore the correct behaviour.