Fences

 
Fences are special kind of splines used specifically for creating geometry barriers and fences.
Unlike all the other spline types, fences use custom geometry, i.e. a source mesh taken from a static mesh model (sm2) in the project.
 
This geometry must have some features for working properly (see Preparing model for fence).
 
To access the fences panel click on fences tab in the splines tool panel.
3.4.10.2.3.4. Fences
1

Fence editing

1. Fence editing
 
In this section you can edit points of an already created fence.
To create a new fence see Fences list  below.
 
The buttons on this section are radio buttons, this means that a button remains pressed until you click on another button on the toolbar.
 
  • Add a new fence point

    When this button is pressed, every time you press left mouse button on a point of the terrain a new road button is added following the previous one.
    If you hold the left mouse button when adding the new point, you can move it on the terrain until you reach the desired position.


    The last point of the fence is the one you cannot move. If you click on it a new point will be created and moved.


    Do not forget to select a fence before adding new points.

     
    If you click on an already created point you can simply move it on the terrain as described before.
     
    You can also add a new point between two points already created:
     
  • Move fence point

    When this button is pressed you can only select and move a point on the fence.
    You can move it in two ways:
  • Sliding on the terrain: As described when adding a new point, select the point a hold left mouse button while moving.
  • Use gizmos: You can use the point gizmo for moving along one axis separately.
     
  • Select fence point

    Use this button if you want only select a fence point.
     
  • Delete selected fence point

    This is the only button that, if pressed, doesn't work as radio.
    If you want to delete a fence point simply:
  • select the point
  • click on delete button
     
2

Fences list

2. Fences list
 
Here is where you can create a new fence or select / delete an already created fence.
 
To create a new fence:
  • Click on button to add a new slot to the list
  • Select the newly created <empty> slot and click on button.
  • Choose the model you want to assign to the river from the appearing model browser dialog.


    Model must be static (sm2 file format)

     
To delete an already created fence:
  • Simply click on trash icon of the fence to delete's row.
 
To select a fence click on the related row into the list.
The selected fence will be showed with an violet spline at the bottom of the fence geometry in the scene viewport.
 
The fence points are showed as violet boxes in the middle of the fence spline section.
When you select a fence point it becomes yellow.
 
3

Fence parameters

3. Fence parameters
 
  • Fence Width

    The width of the fence in centimeters.
     
  • Fence Height

    The height of the fence in centimeters.
     
  • Fence Max Dist

    The maximum distance at which the fence can be drawed (in centimeters). It is used for optimization purpouse.
 
PREPARING MODEL FOR FENCE
In order to make the fence spline working you have to prepare the model to assign to a fence in the correct way.
 
As showed in the image above, the model section must be orientated along the Z axis (blue axis).
If you have a model with a different orientation you have to do following steps in order to make it compliant with fence tool (in the example, we use the fence model in the medieval town DLC that isn't orientated for the fence spline, we leave the user to repeat these steps on the medieval town fence model as an exercise):
 
  • Show the model into model editor
     
  • Select the unique node of the model (remember it must be a single mesh model, sm2)
     
  • choose the translate tool for visualizing the gizmo axis
     
  • Rotate the node in order to make the model section to be aligned with the z axis of the global gizmo (see model viewport).
    In our case we have rotated the node by 90 degree around the Y axis.
     
  • Finally click on Reset Xform () button to collapse the node rotation.
     
  • As a result our model is now in the correct orientation respect the global gizmo


    When you change the model rotation in this way, all changes will be immediately aplpied to all models in the scene.
    Save the model if you want to keep the changes when reload the project

     
     
LIMITATIONS OF FENCE SPLINE
  • In the current version the fence spline doesn't allow the tiling of the mesh geometry when the distance between two successive points of the spline is greater that the length of the source mesh. This means that if you make 2 points of the spline too much far from each other, the mesh is stretched.
     
  • The tessellation of the spline depends from the density of triangles in the source mesh.
     
  • The orientation of the source mesh must be done in a certain way (see above)
     
  • The model from which to take the mesh must be static (sm2)