#選択辺の隣接面を選択 #選択している辺に隣接している面を選択状態にします #アルゴリズム変更(2010.01.30) #選択ミスする事があったのでさらに変更(2010.01.30) def return_henlist(face): #面番号から面を構成する辺の番号を返す #前後にsetup_winged_edgeとclean_winged_edgeが必要 tempvlist=xshade.scene().active_shape().face(face).vertex_indices henlist=[] for i in tempvlist: tempf=xshade.scene().active_shape().eccwfv(face,i,False) henlist.append(tempf) return henlist dousasuru=0 if xshade.scene().selection_mode==1 and xshade.scene().is_modify_mode==True and xshade.scene().active_shape().type==7: dousasuru=1 if dousasuru==1: xscene=xshade.scene() ashape=xshade.scene().active_shape() #面の方向を統一 ashape.adjust_face_direction() #選択されてる辺の辺番号リストをつくる totaledge=xshade.scene().active_shape().number_of_edges activeedgelist=[] for i in range(totaledge): if xshade.scene().active_shape().edge(i).active_order>0: activeedgelist.append(i) xshade.scene().active_shape().setup_winged_edge() eflist=[] felist=[] for i in range(ashape.number_of_faces): felist.append([]) for i in range(ashape.number_of_edges): eflist.append([]) #すべての面で面を構成する辺の情報を得てリストに格納していく ashape.setup_winged_edge() for i in range(ashape.number_of_faces): henlist=return_henlist(i) felist[i]=henlist for gg in henlist: temp=eflist[gg] temp.append(i) eflist[gg]=temp menlist=[] for i in activeedgelist: for gg in eflist[i]: menlist.append(gg) xshade.scene().active_shape().clean_winged_edge() #面選択モードに移行し、面を選択 xshade.scene().selection_mode=0 for i in menlist: xshade.scene().active_shape().face(i).active=True