global newwin_roll global arr_bmp,pointtcpick global unique
fn unique ori_sel=( ins=#() while ori_sel.count>0 do ( for e in ori_sel do( num=InstanceMgr.GetInstances e &instances temp=instances for o in temp do ( if finditem ori_sel o!=0 then ( append ins o exit ) ) – append ins temp[1] for j in temp do( num2=finditem ori_sel j try deleteitem ori_sel num2 catch() ) ) ) return ins ) fn import_sp str= ( new_obj = splineShape name:(uniquename (getfilenamefile str)) ext_file=openFile str try( trans=readValue ext_file new_obj.transform=trans num_splines = readValue ext_file spline_verts = #() spline_closed= #() for s = 1 to num_splines do ( append spline_verts (readValue ext_file) append spline_closed (readValue ext_file) ) for s = 1 to num_splines do ( addNewSpline new_obj for v = 1 to spline_verts[s] do ( readValue ext_file addKnot new_obj s (readValue ext_file) #curve (readValue ext_file) (readValue ext_file) (readValue ext_file) ) if spline_closed[s] then close new_obj s ) updateShape new_obj new_obj )catch() close ext_file return new_obj ) fn scale_sp curve sw sh=( for n in 1 to curve.NumSplines do ( num_verts = (numKnots curve n) for i = 1 to num_verts do ( local poi=in coordsys curve getKnotPoint curve n i poi.x*=sw;poi.y*=sh local get_in=in coordsys curve getInVec curve n i get_in.x*=sw;get_in.y*=sh local get_out=in coordsys curve getOutVec curve n i get_out.x*=sw;get_out.y*=sh in coordsys curve setKnotPoint curve n i poi in coordsys curve setInVec curve n i get_in in coordsys curve setOutVec curve n i get_out )–end v loop )–end c loop updateshape curve return curve )—缩放曲线 fn w_to_c sys pos=( -----------------世界点转换为自定义坐标系统点------------ ve=(pos-sys.translationpart) vec=normalize ve x=(length ve)(dot vec sys[1]) y=(length ve)(dot vec sys[2]) z=(length ve)(dot vec sys[3]) retu
global newwin_rollglobal arr_bmp,pointtcpickglobal uniquefn unique ori_sel=(ins=#() while ori_sel.count>0 do(for e in ori_sel do(num=InstanceMgr.GetInstances e &instancestemp=instances...