Cycling colors would just mean repeating the rainbow more times over a given surface distance. More banding.
In my mind ... this probably means increasing the resolution of the underlaying mesh so that we have more discrete places to put rainbow bands. If were are both nativeEenglish speakers ... we need to stick to words and metaphors like RAINBOW and repeat. But is you really like code ... I can just send you the code snippet ... since it is very short.
In my mind ... this probably means increasing the resolution of the underlaying mesh so that we have more discrete places to put rainbow bands. If were are both nativeEenglish speakers ... we need to stick to words and metaphors like RAINBOW and repeat. But is you really like code ... I can just send you the code snippet ... since it is very short.
Code:
command({vertex,{manifoldlab,topo_bullseye}}, #st{sel=[{WeID,_}]}=St) ->
Qs =
[ {label, "Topological Units to run ... "},
{text, 36, [{width,10},{key,units},{range,{0, 720}}]},
separator,
{label, "Every 18 units is a rainbow cycle"}
],
wings_dialog:dialog("Rainbow Please ... ", Qs,
fun(Res) ->
{units,Units} = lists:keyfind(units, 1, Res ),
#we{} = We = gb_trees:get(WeID, St#st.shapes),
MyAcc = fun(Idx,#st{sel=[{WeID,AccSet}]}=AccSt) ->
Idx2 = Idx rem 18,
#st{sel=[{WeID,SetMore}]} = wings_sel_conv:more(AccSt),
SetNow = gb_sets:subtract(SetMore,AccSet),
H = Idx2 * 20.0,
S = 0.999, %% we are just throwing down rainbow colors ...
V = 0.999,
RGB = wings_color:hsv_to_rgb({H,S,V}),
AccSt2 = wings_vertex_cmd:set_color(RGB,AccSt#st{sel=[{WeID,SetNow}]}),
AccSt2#st{sel=[{WeID,SetMore}]}
end,
case Units of
0 -> Polycount = length(array:sparse_to_orddict(We#we.vp)),
Count = round(math:sqrt(Polycount*1.0));
_ -> Count = Units
end,
lists:foldl(MyAcc, St, lists:seq(0,Count))
end);