Curve Connector

The Curve Connector component defines a connection interface along a curve. A point connector can snap anywhere along the curve instead of being restricted to a single mounting position. For example, a curve connector can be added along the side of a straight or curved conveyor. A sensor bracket, conveyor stand or other attachment containing a point connector can then be positioned anywhere along it. For more information, please see the API documentation.

Properties

The curve connector component properties that are accessible through the inspector.

Curve

The curve of the connector in the local space of the entity. The curve can be selected from mesh geometry using feature selection or specified programmatically using the Curve API.

Rotation

The local rotation applied to each frame along the curve. This can be used to control the orientation of attachments, such as making a bracket face outward from the side of a conveyor.

Tag

The tag assigned to the connector. For example, a conveyor side could use conveyor.side or a conveyor top could use conveyor.top. A point connector on a side bracket targeting the conveyor.side tag can then snap to it. Please see the built-in connector tags that you can use. You may also create a tag provided that it has a unique name. The name before the . can be used to categorize the tag when it is displayed in the inspector UI.

Snap Mode

The snap mode controls which parts of the connector pose are aligned. The Position, X Axis, Y Axis and Z axis can be enabled independently. The mode is only applied when it is enabled on both connectors.

Snap Entity

The optional entity that becomes the parent of the source connector’s snap entity when a connection is created. Reparenting only occurs when both connectors have a snap entity that is set.

Snap Radius

The screen-space radius used for interactive snapping, measured in viewport pixels. A connection is created if the distance between the two connectors is less than the snap radius.

Snap Angle

The maximum angular difference for snapping axes, measured in radians. For a connection to be created, the angle between the axes of each connector must be less than the snap angle.

Scripting

The underlying CurveConnector is available through the connector property on the component. For example, a source point connector can be snapped to a target curve connector using:

world.connectors.snapPointCurve(source, target, { t: 0.5 });

The t option specifies a normalized position along the curve between 0 and 1. The s option can instead specify a distance along the curve. This makes it possible to position attachments programmatically along both straight and curved equipment. Note that it is not permitted to snap a curve connnector to a point connector or to another curve connector since the CurveConnectorComponent doesn’t specify a targets array property like the PointConnector component.