Skip to main content

Line Shorten

Shorten a polyline by an amount

Written by Holly Conrad Smith

Use this when you want to reduce the length of a polyline by trimming from its ends within a flow. Note: this is a legacy node — prefer sub curve or extend polyline for new flows.

Use shorten to reduce the length of a line, face or edge.

Inputs

This node runs in Transform mode by default, so its settings come from the paired Transform node through the T connector. You can't wire a value straight into a single setting. To drive one setting from your flow, override it with a Write Property node between the Transform node and T, or switch this node to Exposed Inputs to get a connector for each setting.

Name

Abbreviation

Type

Access

Description

Input

I

Feature

Item

The input data

Transform

T

Object

Item

Transform controls (overridden by individual parameters)

Outputs

Name

Abbreviation

Type

Access

Description

End

E

Feature

List

The shortened line end

Middle

M

Feature

List

The shortened line start

How to:

  1. Draw a Line or Rectangle or Polygon

  2. Add the Line Shorten node and the Line Shorten Transform node. Connect the transform's output to the Line Shorten node's T connector.

    1. Click “edit defaults” to set the starting values

  3. Edit the settings and outputs in Properties

Connect the Line Shorten Transform node

The Line Shorten node needs the Line Shorten Transform node connected to its T connector to use your settings. Without it, the Line Shorten node runs on Giraffe's built-in default settings, and you can't change any of them in Edit Defaults or the Properties Palette.

OR

Use the exposed inputs version of the Line Shorten node, which has its own connector for each setting and needs no transform node.

Line Shorten Transform settings object

The Line Shorten Transform node creates a set of inputs in the Properties Palette for anyone using the flow to fill out. It converts those inputs into a plain JSON object and sends it to the Line Shorten node through the T connector. The object has type set to lineShorten and the settings inside parameters. The values below are the built-in defaults.

{
"type": "lineShorten",
"parameters": {
"startOffset": 10,
"endOffset": 10,
"mergeStartAndEnd": true
}
}

The Line Shorten Transform settings in the Properties Palette show lengths, areas, and volumes in your project units. The JSON always stores them in meters, square meters, and cubic meters, so a value you write into it with Write Property must use those units too.

To drive one setting from elsewhere in your flow, override it with a Write Property node. Put Write Property between the Line Shorten Transform node and the T connector, and set Property to a path like parameters.startOffset.

Shorten Settings

The Line Shorten transform automatically adds key property inputs to the properties palette.

  • Choose start and end offset to control shorten distance

  • Often used with Explode

Use the Line Shorten node with exposed inputs

The exposed inputs version of the Line Shorten node has its own connector for each setting, so you can wire values straight in without a Line Shorten Transform node.

  1. Right-click the Line Shorten node and choose Expose inputs. Giraffe replaces it with the exposed inputs version.

  2. Connect your input to the Feature connector.

  3. Type a value into each setting on the node, or connect a value to its connector. A Number node, a value from another node, or an Input Parameter all work.

  4. To let people using the flow change a setting in the Properties Palette, connect an Input Parameter to it. Settings without an Input Parameter stay hidden.

To get the exposed inputs version every time you add a node, turn on Show exposed inputs when creating new nodes (the gearbox icon) in the flow editor toolbar. Settings don't carry over when you switch between versions.

Line Shorten exposed inputs

Connector

What it does

Feature

Feature to shorten.

Start Offset

Distance to shorten from start.

End Offset

Distance to shorten from end.

Merge Start And End

Whether to merge start and end if they overlap after shortening.

Shorten Outputs

  • Provides 2 :outputs Middle and End

  • Allows you to perform different functions on the start/end offset distance and the leftover (middle)

Did this answer your question?