Rhinoscript: Widen the gaps


#1

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?

Hans

Widen the gab.3dm (121.5 KB)


(Willem Derks) #2

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?

-Willem


#3

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

https://1drv.ms/v/s!AosUddbhL2qpgtVR_WEHBj495grj_A

.