#============ Stretch(v1).tcl ================= # (c)k-hiray@mvb.biglobe.ne.jp #自由曲面が伸びるアニメーションを作るスクリプトです。 #伸ばしたい自由曲面を選択して実行してください。 # 2000/11/09 (v1) Tcl版作成 proc Stretch {} { global number_of_anchor_points master_surface global S_P lid m_n select_by_handle $S_P select_child 1 set NAP $number_of_anchor_points set n_line 1 while {[select_brother]} { incr n_line } select_parent 1 create_morph_joint select_sister 1 place_child 1 if {$lid} {; # ふたをつけるなら create_part select_sister 1 place_child 1 select_parent 1 } for {set i 1} {$i <= [expr $n_line - 1]} {incr i} { copy_object translate {0 0 0}; # 自由曲面をコピー } for {set i 1} {$i <= [expr $n_line - 1]} {incr i} { select_sister 1 if {$lid} { select_child 1 } select_child 1 while {[select_brother]} {} for {set j 1} {$j <= $i} {incr j} { clear } for {set k 0} {$k <= [expr $NAP - 1]} {incr k} { set a_p($k) [anchor_point $k] set_lateral_outhandle $k to $a_p($k) } for {set j 1} {$j <= $i} {incr j} { copy_object translate {0 0 0} if {$j == 1} { for {set k 0} {$k <= [expr $NAP - 1]} {incr k} { set_lateral_inhandle $k to $a_p($k) } } } if {$lid} { copy select_parent 1 paste set master_surface $m_n } select_parent 1 message "$i/[expr $n_line - 1]終了" } if {$lid} { while {[select_brother]} {} select_child 1 select_child 1 while {[select_brother]} {} copy select_parent 1 paste set master_surface $m_n select_parent 1 } select_parent 1 } if {$object_type == 2 && $part_type == 1} { switch_ if {![select_child]} { show_message_box "自由曲面の中に線形状がありません。" return } if {$line_object_closed} { show_message_box "交差方向の線形状が閉じているので、開いた線形状に変換します。" inhibit_update set line_object_closed 0 while {[select_brother]} { set line_object_closed 0 } switch_ while {[select_sister]} {} copy while {[select_brother]} {} paste switch_ allow_update } select_parent 1 switch_ set S_P $handle begin_dialog 8947117 append_bool_dialog_item "ふたをつける" set_bool_property_value 0 to 0 if [ask_dialog] { set lid [get_bool_property_value 0] if {$lid} { create_master_surface as "ふた" set m_n $master_surface set browser_window 0 set surface_window 0 set browser_window 1 set surface_window 1 show_message_box "ふたの表面材質を設定してください。" } inhibit_update Stretch allow_update } end_dialog } else { show_message_box "自由曲面を選択してください。" }