3
$\begingroup$

I am designing a mechanical arm and would like to manipulate it in points {0,0} and {100,0}.

But I'm finding it difficult to define the first arm as the black profile and the second arm as the red profile.

braço[r1_,r2_,comprimento_]:={Disk[{0,0},r1],Disk[{comprimento,0},r2],Polygon[{{0,-r1},{0,r1},{comprimento,r2},{comprimento,-r2}}]};

Graphics[{With[{x=30},{braço[25,20,100],Red,Translate[braço[20,15,50],{100,0}],Translate[{Disk[{0,0},x],White,Disk[{0,0},x/2],Rectangle[{0,-x},{x,x}]},{180,0}]}]},Axes->True]

How could I create this manipulation more conveniently?

enter image description here

$\endgroup$
6
  • $\begingroup$ More "conveniently"? What's wrong with the one you give? What more do you want? $\endgroup$ Commented Aug 29, 2018 at 3:35
  • $\begingroup$ I believe that to facilitate the Manipulate function, this geometry could be obtained in another way $\endgroup$
    – LCarvalho
    Commented Aug 29, 2018 at 3:41
  • $\begingroup$ I believe that the white disk and the white rectangle can be replaced by something better, obtaining the same result $\endgroup$
    – LCarvalho
    Commented Aug 29, 2018 at 3:44
  • 1
    $\begingroup$ "another way"? Well sure. But how and why would that "facilitate the Manipulate function"? Just use GraphicsGroup and be done with it! $\endgroup$ Commented Aug 29, 2018 at 3:45
  • $\begingroup$ I have not used the software for many time, I did not remember this function $\endgroup$
    – LCarvalho
    Commented Aug 29, 2018 at 3:49

1 Answer 1

1
$\begingroup$

I try this:

braço[p1_, p2_, r1_, r2_] := {Disk[p1, r1], Disk[p2, r2], 
   Polygon[{{p1[[1]], -r1}, {p1[[1]], r1}, {p2[[1]], 
      r2}, {p2[[1]], -r2}}]};
Manipulate[
 Graphics[{
   Rotate[{braço[{0, 0}, {100, 0}, 25, 20]}, θ, {0, 0}],
   Rotate[
    Translate[{Red, 
      braço[{0, 0}, {50, 0}, 20, 15]}, {100*Cos[θ], 
      100*Sin[θ]}], α, {100*Cos[θ], 
     100*Sin[θ]}]},
   Axes -> True,
  PlotRange -> {{-30, 200}, {-50, 150}}],
 {α, 0, π/2}, {θ, 0, π/2}]
$\endgroup$

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.