"""Смещение только ротора собственной учебной модели; неподвижная ось статора."""
from build_series import build as centered_build


def build(api,machine,winding,materials,path,mesh,theta,currents,eccentricity_mm=0.):
    if abs(eccentricity_mm)>=machine['geometry']['air_gap_mm']/4:
        raise ValueError('Для этого опыта требуется |e| < зазор/4')
    result=centered_build(api,machine,winding,materials,path,mesh,theta,currents)
    if eccentricity_mm:
        api['mi_clearselected']()
        api['mi_selectgroup'](10);api['mi_selectgroup'](11)
        api['mi_movetranslate'](eccentricity_mm,0)
        api['mi_clearselected']();api['mi_saveas'](path)
    result['eccentricity_mm']=eccentricity_mm
    return result
