What do the numbers 25 and 45 represent after round Corner? Like what is the range and what do larger numbers mean?

0 votes
asked Aug 5, 2020 in Closed feature request by Amber

2 Answers

0 votes
answered Aug 28, 2020 by The-Lu (12,780 points)

Hello A.,

What do the numbers 25 and 45 represent after round Corner?
Like what is the range and what do larger numbers mean?

That represent the degree or radius of curvature. [Link to Wikipedia: Curvature or Degree of curvature]

See some examples from value 0 to 200...


[Code on PlantUML server]

See also on the PlantUML doc.:


If that can help,
Regards,
Th.

0 votes
answered Aug 31, 2020 by Martin

To add to The-Lu's great visual answer with some extra technical detail for SVG format.  

If you use that example SVG picture:  http://www.plantuml.com/plantuml/svg/VT91oeGW5C3nlQSGJw1Ft4N4zvr4J6AeT7ZPQfYxZsdI39YkYl_l2JqQjg0nxEj2jldXdXhrIl-qcIVqknkDNppIWDfjCLaNo1T3Qu9sqsBfYz1uqiI_HsUnwz3mlgV7uRK8PuHQ57bKr2TpX6gKESfgL3cgQXJyg89N8wG8ARu9kJwSnKVsytuDKixYJUScxWmK0_T6S9QDQ5rK43IGB4Wsa2f8DP3WKPMztIee2f8Qh1lZd_O1

Then a modern browser (I tried Edge and Opera) will let you right-click and 'inspect element'.  You can then highlight the different 'rect' components in the text sidebar and it will highlight the rectangle it refers to in the graphic.  You'll see that the rects with rounded corners have parameters 'rx' and 'ry' that are both set to half the roundCorner value.  rx and ry define the radii of an ellipse at the corner - and since both are set the same you get a circle (until you max one out).  The value is an absolute amount (as opposed to being relative to the shape size) and I think the default unit for svg is pixels.  The maximum meaningful size for rx is half the width of the rectangle at which point you get no straight line part.  Similarly for ry and the height.

Take the "roundCorner 50" example:

rect[Attributes Style] {

  1. fill: rgb(254, 254, 206);
  2. filter: url(#fi4dkuyxad8cj);
  3. height: 52.5938;
  4. rx: 25;
  5. ry: 25;
  6. width: 132;
  7. x: 7;
  8. y: 233;

}

rx and ry are set to half of 50.  Since that is almost exactly half the height , you get no perceivable straight line at the sides.

commented Sep 1, 2020 by The-Lu (12,780 points)
Thanks Martin,

I was not going up to this technical level.
Thanks for your addition which completes well, down to the xml SVG element level.

Regards,
Th.
...