Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue in Duplicate Radial command #597

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions plugins_src/commands/wpc_duplicate_radial.erl
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ command(_, _) -> next.
radial_duplicator(pick, St) ->
wings:ask(selection_ask([axis,center,point]), St, fun radial_duplicator/2);
radial_duplicator(Dir, St) when is_atom(Dir) ->
SelRef = wings_sel:center(St),
radial_duplicator({Dir,e3d_vec:zero(),SelRef}, St);
{X,Y,Z} = SelRef = wings_sel:center(St),
Center =
case Dir of
x -> {X,0.0,0.0};
y -> {0.0,Y,0.0};
z -> {0.0,0.0,Z}
end,
radial_duplicator({Dir,Center,SelRef}, St);
radial_duplicator({_,_,_}=Params, #st{sel=Sel}=St) ->
Qs = readial_dup_dlg(Params,length(Sel)),
wings_dialog:dialog_preview({body,radial_dup}, true, menu(caption), Qs, St);
Expand All @@ -79,7 +85,7 @@ readial_dup_dlg(Dir, SelCount) ->
case Key of
4 ->
Shift = wings_dialog:get_value(7,Sto),
if (abs(Value) > 360.0) and (abs(Shift) == 0.0) ->
if (abs(Value) > 360.0) and (abs(Shift) == +0.0) ->
wings_dialog:set_value(4,360.0,Sto),
wings_dialog:update(4,Sto);
true -> ignore
Expand Down Expand Up @@ -116,7 +122,7 @@ duplicate_rotate([{Axis, Center, SelRef}, Seed, Count0, Angle, Oriented, RandRot
AngOfs = Angle/Count0
end,

AxisOfs = AxisShift/(Count0),
AxisOfs = AxisShift/Count0,
RadOfs = RadShift/(Count0),
clone_add_sel(We, Count0, [Center,wings_util:make_vector(Axis),SelRef,
Oriented,RandRot,AngOfs,AxisOfs,RadOfs], Acc).
Expand All @@ -126,6 +132,7 @@ clone_add_sel(#we{name=Name0,vp=Vtab0}=We0, Count,
[Center,Axis,SelRef,Oriented,RandRot,
AngOfs,AxisOfs,RadShift]=Params, {Id,Shs0}) ->
Name = new_name(Name0, Id),

Vtab = do_rotate(Center, Axis, SelRef, Oriented, RandRot,
AxisOfs*Count, RadShift*Count, AngOfs*Count, Vtab0),
We = We0#we{id=Id,name=Name,vp=Vtab},
Expand Down