0
$\begingroup$

I can easily produce rectangles with rounder corners using RoundingRadius. However, I am unable to do for an open curve

Graphics[Line[{{1, 0}, {2, 1}, {3, 0}, {4, 1}}]]

Any help will be appreciated.

EDIT: I want to generate the underlined part of the following rectangle:

Graphics[{EdgeForm[{Thickness[0.01], Black, Dashed}], 
FaceForm[GrayLevel[1]], 
Rectangle[{0., 0.}, {1, 1}, RoundingRadius -> .2]}, 
AspectRatio -> 1, ImageSize -> 200]

enter image description here

$\endgroup$
8
  • 2
    $\begingroup$ maybe BezierCurve? $\endgroup$
    – kglr
    Commented May 3, 2020 at 3:28
  • $\begingroup$ How about CapForm? demonstrations.wolfram.com/StylingLineCapsAndLineJoins $\endgroup$
    – bill s
    Commented May 3, 2020 at 3:33
  • $\begingroup$ @kglr BezierCurve curves too much. I have edited the question showing what I want. $\endgroup$ Commented May 3, 2020 at 4:28
  • 2
    $\begingroup$ You could place a white arc of a disk over the rounded rectangle to obscure the parts you don't want to see - but would that satisfy your requirements ? $\endgroup$ Commented May 3, 2020 at 11:40
  • 2
    $\begingroup$ You write that you want to show only part of a rectangle, but it looks as if you want to show only part of the boundary of a rectangle. In another context I might call that a line, one with a few straight segments and a few circular arcs ... which is the conclusion you've already come to. But I think we've also come to the conclusion that Mathematica does not have an intrinsic graphic routine for that and you'll have to write your own. $\endgroup$ Commented May 5, 2020 at 7:29

0

Your Answer

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

Browse other questions tagged or ask your own question.