GUI.Rectangle cannot achieve semicircular fillet

As shown in the following figure:
https://playground.babylonjs.com/#XCPP9Y#14829

A semicircular shape cannot be achieved with cornerRadius
rect
What I want to achieve:
circle

PR up: Rectangles couldn’t get correctly rounded because -2 was subtracted f… by carolhmj · Pull Request #12863 · BabylonJS/Babylon.js (github.com)

2 Likes

I took a look and used the test environment for testing, but the effect did not meet my expectations,
The semicircle is not reached
rad

https://playground.babylonjs.com/?snapshot=refs/pull/12863/merge#XCPP9Y#14908

Yes, I agree that it is not reached. Something around the x-value, may be?
If I scale the container on X, I am that close to reaching it.

If you split the rectangles both are rounded:
image

But when they are overlaid on top of each other some pixels from the bottom bleed through and give the impression of a less rounded shape.

Hmm :face_with_monocle:. No (sry), I’m afraid this example does not match a semicircle shape. Just draw a circle on top of it and you will see that it isn’t.

I reviewed the maths for drawing rectangles, now we can get a circle! Draw rectangles with properly rounded corners by carolhmj · Pull Request #12876 · BabylonJS/Babylon.js (github.com). Thanks for double checking the fix ya’ll :smiley:

1 Like