100 |
def link(self, *args): |
def link(self, *args): |
101 |
self.links.append(args) |
self.links.append(args) |
102 |
|
|
103 |
def _linkReally(self, direction, anchorCS, otherNode, linkId, otherAnchor): |
def _linkReally(self, direction, anchorCS, otherNode, linkId, otherAnchor, shift=0): |
104 |
"""Create the real buoy. |
"""Create the real buoy. |
105 |
""" |
""" |
106 |
if dbg: pa('link really') |
if dbg: pa('link really') |
107 |
|
|
108 |
|
### Shift the anchorCS for some degrees |
109 |
|
if shift > 0: |
110 |
|
# evens 2,4,6 -> 1,2,3,4,.. |
111 |
|
# odds 1,3,5,7 -> -1,-2,-3,-4 |
112 |
|
if shift%2 == 1: |
113 |
|
shift += 1 |
114 |
|
shift *= -1 |
115 |
|
shift *= 0.5 |
116 |
|
shiftedAnchorCS = self.vs.translateCS(anchorCS, 'Shift',0, shift*18) |
117 |
|
|
118 |
### Buoy coordinate system |
### Buoy coordinate system |
119 |
buoy = self.vs.coords.buoyOnCircle2(self.buoyinto, anchorCS, |
buoy = self.vs.coords.buoyOnCircle2(self.buoyinto, shiftedAnchorCS, |
120 |
direction, 10) |
direction, 10) |
121 |
self.vs.matcher.add(self.buoyinto, buoy, linkId) |
self.vs.matcher.add(self.buoyinto, buoy, linkId) |
122 |
|
|