# 3.9.18 Surface To Truss

The "Surface to Truss" component facilitates the generation of various truss geometries based on arbitrary surface inputs. In addition to generating geometry, it provides local orientations for the truss members derived from the specified surface (refer to Fig. 3.9.18.1). The output of this component can be directly utilized by the "[Create Linear Element](/3-in-depth-component-reference/3.1-model/3.1.6-create-linear-element/3.1.6-line-to-beam.md)" component for integration into a structural model. Additionally, the component includes an option to relax the truss geometry, optimizing the angles between truss members to achieve their maximum possible value.

<figure><img src="/files/MWqsJOtTKUzdD7qdlsPx" alt=""><figcaption><p>Fig. 3.9.18.1: Creation of a K-Truss on a given surface.</p></figcaption></figure>

{% file src="/files/w2q82NbLGNTxe3WsqxWH" %}

These are the component inputs:

<table><thead><tr><th width="288">Input-plug Name (Nickname)</th><th>Description</th></tr></thead><tbody><tr><td>Surface (S)</td><td>The input surface used to generate the truss. By default, U=0 corresponds to the left side of the truss, V=0 designates the position of the lower girder, and V=1 indicates the position of the upper girder.</td></tr><tr><td>Truss Type (Type)</td><td><p>An integer value specifying the type of truss to generate. Right-click the component and select "Expand ValueLists" to display the available options. The options are as follows:</p><p>1: Pratt Truss<br>2: Warren Truss<br>3: Warren Truss with verticals<br>4: K-Truss<br>5: Diamond<br>6: Diamond Straight<br>7: Vierendeel Truss.</p></td></tr><tr><td>Number of Subdivisions (NSub)</td><td>Number of truss subdivisions, by default in surface U-direction.</td></tr><tr><td>Flip U Direction (FlipU)</td><td>Reverts the surface's U-direction for truss generation.</td></tr><tr><td>Flip V Direction (FlipV)</td><td>Reverts the surface's V-direction for truss generation.</td></tr><tr><td>Swap UV Directions (SwapUV)</td><td>Exchanges the surface's U- and V-directions for truss generation.</td></tr><tr><td>Relax Angles (Relax)</td><td>When set to true, the truss nodes on the upper and lower boundaries are shifted along the surface to minimize the sum of the squared angles between the truss members at the nodes. If this option is disabled, the nodes on the upper and lower boundaries are positioned at evenly subdivided U-values.</td></tr><tr><td>Target Post Direction (TargetDir)</td><td>If the vertical posts of the truss require a predefined direction, the corresponding directional constraint can be specified here using a vector, which will be mapped onto the underlying surface.</td></tr><tr><td>Maximum Relaxation Iterations (MaxIter)</td><td>The minimization of the internal angles is achieved through dynamic relaxation. This input value defines the maximum number of equilibrium iterations.</td></tr><tr><td>Length Tolerance (LTol)</td><td>Relative displacement tolerance from one iteration to the next for stopping the dynamic relaxation iterations.</td></tr><tr><td>Damping Factor (DFac)</td><td>Factor for scaling the displacement change from one dynamic relaxation iteration to the next.</td></tr></tbody></table>

In cases where the UV-space is highly distorted, it may be necessary to experiment with different settings for the damping factor and the maximum number of relaxation iterations.

{% embed url="<https://youtu.be/DXOELlb0kyI?si=KI8V4NXDENpUaLMq>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.karamba3d.com/3-in-depth-component-reference/3.8-utilities/3.9.18-surface-to-truss.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
