3
$\begingroup$

enter image description here

How I can hide the points ouside of blackbox? I want make a video moving the black box. like this: https://youtu.be/o5aNBKvay-M

StepA = 1;
LimA = 20;
StepB = 4;
LimB = 6;
Raio = 0.5;
EspSetas = 0.01;
Pos1[x_, y_] := -x
Pos2[x_, y_] := y + If[OddQ[(x)], 0, StepB/2]
t = 0;

myring[a_, b_] := 
  Graphics[Rotate[
    Arrow@Table[{-Pos1[a, b] + Raio*Cos[u], 
       Pos2[a, b] + Raio*Sin[u]}, {u, 0, 2 π + t*2 π/180, 
       2 π/180}], {{-1, 0}, {1, 0}}]];

myRingSet = 
  Show[Table[myring[a, b], {a, 0, LimA, StepA}, {b, 0, LimB, StepB}]];

IM1 = Show[
  Graphics[{{Red, Opacity[1], 
     Table[Circle[{Pos1[a, b], -Pos2[a, b]}, 0.8*Raio], {a, 0, LimA, 
       StepA}, {b, 0, LimB, StepB}]}, {Thickness[0.01], 
     Table[Arrow[{{Pos1[a, b], -Pos2[a, b]}}], {a, 0, LimA, 
       StepA}, {b, 0, LimB, StepB}]}}], myRingSet, ImageSize -> 1500, 
  BaseStyle -> Arrowheads[0.014], Frame -> True, FrameTicks -> None, 
  Axes -> False]

I want this video: https://youtu.be/1NTKaqW6vpQ I did this through ImageTrim, I want know if there is a command to plot only the part I want like PlotRange

 x = 0;

 While[x < 100,
  IM2 = ImageTrim[IM1, {{0 + x, 0}, {750 + x, 538}}];
  Show[IM2, Frame -> True, FrameTicks -> None, Axes -> False]

   Export["C:\\Users\\Cliente\\Desktop\\Video movimento \
 fluxoides\\Teste2\\" <> ToString[x] <> ".jpg", IM2, 
    ImageResolution -> 200]

  ; x = x + 10]

Solution for my code:

StepA = 1;
LimA = 22;
StepB = 4;
LimB = 6;
Raio = 0.5;
EspSetas = 0.01;
Pos1[x_, y_] := x
Pos2[x_, y_] := y + If[OddQ[(x)], 0, StepB/2]
t = 1;


 myring[a_, b_] := 
  Graphics[Arrow@
    Table[{Pos1[a, b] + Raio + Raio*Cos[u], 
      Pos2[a, b] + Raio + Raio*Sin[u]}, {u, 0, 
      2 \[Pi] + t*2 \[Pi]/180, 2 \[Pi]/180}]];
  myRingSet = 
  Show[Table[myring[a, b], {a, 0, LimA, StepA}, {b, 0, LimB, StepB}]];

  Temp1 = Graphics[{{Thickness[0.003], Red, Opacity[1], 
     Table[Circle[{Pos1[a, b] + Raio, Pos2[a, b] + Raio}, 
       0.8*Raio], {a, 0, LimA, StepA}, {b, 0, LimB, 
       StepB}]}, {Thickness[0.01], 
     Table[Arrow[{{Pos1[a, b] + Raio, Pos2[a, b] + Raio}}], {a, 0, 
       LimA, StepA}, {b, 0, LimB, StepB}]}}];

  Temp2 = myRingSet;

  IM = Show[{Temp1, Temp2}, BaseStyle -> Arrowheads[0.014], 
    Frame -> True, FrameTicks -> None, Axes -> False, 
    PlotRange -> {{0 - 0.1 Raio + (2*t/180), 
       20 + 0.1 Raio + (2*t/180)}, {0 - 0.1 Raio, 7 + 0.1 Raio}}, 
    ImageSize -> 1500]
$\endgroup$
6
  • 1
    $\begingroup$ Please edit your code so that it can be run. $\endgroup$
    – bill s
    Commented Mar 10, 2016 at 3:47
  • $\begingroup$ Please take the time to (learn to) format your code. In your first post, you will find some tips on how to do that. $\endgroup$
    – Michael E2
    Commented Mar 10, 2016 at 4:04
  • $\begingroup$ Please explain "I want to make a video with moviment, so I want to put a limit in the frame plot and move the area of the plot." better $\endgroup$ Commented Mar 10, 2016 at 4:30
  • $\begingroup$ Learn how to vote on good answers and questions. Please read the following comment $\endgroup$ Commented Mar 10, 2016 at 16:12
  • 1
    $\begingroup$ Please do not sabotage your original question after receiving an answer. Future readers will not understand the context of the original problem and the relevance of the answers. I've rolled the question back to the previous revision. If you have found a good solution to your problem, you can post it as another self-answer. Multiple answers and self-answers are encouraged on the SE network. $\endgroup$
    – LLlAMnYP
    Commented Mar 10, 2016 at 19:21

1 Answer 1

4
$\begingroup$
r = Graphics[{Red, Table[Circle[{n, 0}, n/10], {n, 1, 100, 5}]}];
b = Graphics[{Blue, Table[Circle[{n + 1, 0}, n/10], {n, 1, 100, 5}]}];

Manipulate[Show[{r, b}, PlotRange -> {{pr, pr + 20}, {-10, 10}}, AspectRatio -> 1],
           {pr, 0, 100}]

enter image description here

$\endgroup$
11
  • $\begingroup$ @garej Perhaps you are right. I confess I don't quite understand the OP saying "I want to calculate all points, but plot in the frame only the black box and then i will move the box to make the moviment" $\endgroup$ Commented Mar 10, 2016 at 6:13
  • $\begingroup$ whatever OP means, it is very interesting question per se: how to make an area, not just a mouse pointer, that would get alive when activated. I cannot find a duplicate and up to the moment feel unable to solve it myself (and I also not sure what OP wants :). $\endgroup$
    – garej
    Commented Mar 10, 2016 at 8:01
  • $\begingroup$ I put a video showing what I want, but with this new model. I did the video variating the plot range but keeping the same dimensions of the frame. Like this PlotRange is {{ x + 0 , x + 20 }, {y + 0 , y + 10}}, exporting each frame, when I make a loop in x since 0 to 20 with step 0.01 I could make a moviment, but I need all points calculated even if they doesn't appear in the frame.. $\endgroup$ Commented Mar 10, 2016 at 12:54
  • $\begingroup$ @JoaoVictorGomesFreire can you clarify the "all points calculated" bit? From your code, it would seem, they are calculated, though not rendered, as they are outside of the PlotRange. $\endgroup$
    – LLlAMnYP
    Commented Mar 10, 2016 at 13:02
  • 1
    $\begingroup$ @JoaoVictorGomesFreire That's because your code is a little mess :). Try this pastebin.com/BDVFtGRP $\endgroup$ Commented Mar 10, 2016 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.