@@ -223,7 +223,7 @@ def check_headings(m_headings,c_heading,rad_buff):
223223 return ([])
224224
225225
226- def head_adjust (att ,heading ,rad_buff = np .radians (30 ),endA_dir = 1 ):
226+ def head_adjust (att ,heading ,rad_buff = np .radians (30 ),endA_dir = 1 , adj_dir = 1 ):
227227 '''
228228 function to adjust heading of cable based on angle buffer from mooring lines
229229
@@ -264,11 +264,12 @@ def head_adjust(att,heading,rad_buff=np.radians(30),endA_dir=1):
264264 #attheadings.extend(atmh)
265265 attheadings .extend (np .pi / 2 - atmh ) # convert to 0 rad at East going CCW
266266 flipheads = True
267+
267268 interfere_h = check_headings (attheadings ,headnew ,rad_buff )
268269 # if the headings interfere, adjust them by angle buffer
269270 for mhead in interfere_h :
270271 ang_diff_dir = np .sign (headnew - mhead ) if headnew != mhead else 1
271- headnew = mhead - rad_buff * endA_dir * ang_diff_dir #headnew + np.sign(ang_diff)*(rad_buff - abs(ang_diff))*endA_dir
272+ headnew = mhead - adj_dir * rad_buff * endA_dir * ang_diff_dir #headnew + np.sign(ang_diff)*(rad_buff - abs(ang_diff))*endA_dir
272273 interfere_hi = check_headings (attheadings ,headnew ,rad_buff )
273274 for i in interfere_hi :
274275 # try rotating other way
@@ -282,6 +283,7 @@ def head_adjust(att,heading,rad_buff=np.radians(30),endA_dir=1):
282283 newbuff = rad_buff / 2
283284 headnew = mhead + newbuff * endA_dir * ang_diff_dir
284285 return (headnew )
286+
285287 return (headnew )
286288
287289def getCableDD (dd ,selected_cable ,cableConfig ,cableType_def ,connVal ):
0 commit comments