4
$\begingroup$

Can't quite figure out how to draw the shape below with Lines and make them play nice at the vertices where they meet. I currently have three lines of different thicknesses, but it's clearly not working.

Any suggestions on how make it work so in a way that survives changes in range, resolution, etc?

enter image description here

$\endgroup$

2 Answers 2

8
$\begingroup$

How about this using rectangles instead of Lines?

paren[t1_, t2_, p_, h_] := {Rectangle[{0, 0}, {t1, h}], 
  Rectangle[{0, 0}, {t2 + p, t2}], Rectangle[{0, h}, {t2 + p, h - t2}]}
Manipulate[
 Graphics[paren[t1, t2, p, h], PlotRange -> {{0, 1}, {0, 1}}],
 {{t1, .1}, 0, .3}, {{t2, .1}, 0, .3}, {{p, .2}, 0, .5}, {{h, 1}, 0, 2}
 ]

bracket anim

$\endgroup$
3
  • $\begingroup$ Good idea, but I want horizontal lines to be thinner than vertical lines $\endgroup$
    – Wynne
    Jun 2, 2020 at 2:09
  • 1
    $\begingroup$ @Wynne you can definitely add that parameter to what is in this answer. Give it a shot yourself. $\endgroup$
    – b3m2a1
    Jun 2, 2020 at 2:18
  • $\begingroup$ @Wynne I added a second param. $\endgroup$
    – flinty
    Jun 2, 2020 at 2:18
2
$\begingroup$

You can use your favorite font:

Manipulate[Style["[", FontSize -> t, FontFamily -> "Al Bayan"], {t, 1, 500}]

enter image description here

$\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.