Skip to content

Commit

Permalink
Fixed axis offset when it was not set. Thanks to ivla
Browse files Browse the repository at this point in the history
  • Loading branch information
Micheus committed Nov 12, 2024
1 parent c17b3d9 commit ad03d4f
Showing 1 changed file with 11 additions and 4 deletions.
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

0 comments on commit ad03d4f

Please sign in to comment.