Rhinoscript: Widen the gaps

Hi all,

I have some items with gaps in them. From a database I have the widths of the parts that have to go into the gaps. The problem is to widen/narrowing each gap based on the width from the database.

In attached gear the gaps is going to be between 2.5 and 3.5.

The strategi is to turn on the grips for each gap and then move some grips (in these case half-1) in one direction and the other grips in the opposite direction (the purple line indicating the direction).

I have most sorted out, but I have trouble finding a reliable way to find the direction.

Any suggestions?


Widen the gab.3dm (121.5 KB)

Shooting from the hip:
Use the purple-lines’ start and end tangent(reversed) for direction.
Decide on the distance and direction sign by finding the difference between the desired width and the length of the purple curve

Is that an option?


Well, it was not that difficult after all.

The trick is to use the normal of the purple line to find the transformation of each grip