Inkscape.org
Beginners' Questions How to Match Corner Radius on squares/rectangles?
  1. #1
    mhall17 mhall17 @mhall17

    HI,

    I want to create a rectangle/square with rounded corners, and then create a border within that perfectly "matches" the rounded corners of the outer shape.ย  Is there a way to do this other than by eyeballing it? If I eyeball it, I can get it much closer than the the pictures below, but there has to be a better way to do this, right?? I've tried toggling the "scale corner radii" button, tried using inset/offset, tried a bunch of different stuff but I just can't figure it out.ย  I'm sure its fairly simple but it just isn't clicking for me; any help is appreciated!

    ย 

    ย 

    ย 

    ย 

    Screen Shot 2024 10 19 At 8.58.14 Am
    Screen Shot 2024 10 19 At 8.58.07 Am
  2. #2
    Polygon Polygon @Polygonโš–๐ŸŒถ
    *

    Start with the white square; white color stroke no fill.

    Duplicate send to background: set blue color for Fill and Stroke. Adjust stroke thickness. If you want it as a single shape go Path->Stroke to Path - Path->Break apart - Path->Union.

    ย 

  3. #3
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Draw a rectangle and set the stroke width to 4mm.
    [ctrl+d] to duplicate. [shift+ctrl+7] opens the Path Effects dialog.
    [Add Live Path Effect > Offset]. Set [Join: Rounded] and set [Offset: 4mm] same as the stroke width.
    [ctrl+d] to duplicate again and set [Offset: 8mm].
    [ctrl+d] to duplicate again and set [Offset: 12mm].
    Repeat as much as you want, increasing the offset each time.

  4. #4
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Slight clarification. For the inner rectangle, open the Fill and Stroke dialog [shift+ctrl+f] and set [Stroke style] [Join: Round join].

    The second example uses [Path > Path Effects...] [Clone original] linked to the inner rectangle. Use the node tool [n] or rectangle tool [r] to move the inner control points. I guess I'm showing off here.

  5. #5
    Paddy_CAD Paddy_CAD @Paddy_CAD
    *

    Simpler workflow.

    Draw a rectangle, filled but no stroke. Fill colour A.
    [Path > Linked Offset] or [alt+ctrl+j]. Fill colour B. Click the control point and [up_arrow] x 4. [Object > Lower to Bottom]
    [Edit > Duplicate] or [ctrl+d]. Fill colour A.
    Click the control point and [up_arrow] x 4. [Object > Lower to Bottom]
    [ctrl+d]. Fill colour B.
    Click the control point and [up_arrow] x 4. [Object > Lower to Bottom]
    [ctrl+d]. Fill colour A.
    Click the control point and [up_arrow] x 4. [Object > Lower to Bottom]
    [ctrl+d]. Fill colour B.
    Click the control point and [up_arrow] x 4. [Object > Lower to Bottom]

    I'm sure you see the pattern here. Editingย the original rectangle updates the duplicated linked shapes.

    Edit: The third group renders perfectly in Inkscape but looks wrong in my browser.

  6. #6
    mhall17 mhall17 @mhall17

    thanks very much, great answers!

  7. #7
    David248 David248 @David248

    Notice that, as Papy_octet explained in another topic, you can set the exact amount of offset with xml editor.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How to Match Corner Radius on squares/rectangles?