Can you create a rectangle with 2 rounded corners?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Tue Apr 02, 2013 10:56 pm

Hi there - can you tell me if it's possible to create a rectangle with 2 opposite rounded corners and the other 2 at 90 degree angles? :?

If so, how is this done? Darned if I can find out..

Many thanks for your help.

Caroline

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Can you create a rectangle with 2 rounded corners?

Postby Lazur » Tue Apr 02, 2013 11:29 pm

You cannot do that with having your rectangle still as a rectangle in your codes. But you can make it as a path.

A simple way to do that, is to draw a rectangle with all the corners rounded, then
convert the rectangle to path by pressing Ctrl++ when selected, and
use the node editor tool to sharpen the wanted corners like this way:
-select one of the starting points of the arch
-move it in horizontal-vertical direction -along the rectangle's side which it was on, by holding down Ctrl while moving
-move the other node of the arch as the starting point, resulting the path overlapping itself, with a 90° corner in the right position
after that, press Ctrl++
-press Ctrl+Shift+K
-hold down Shift and deselect the rectangle part with the should-be rounded corners
-delete unnecessary paths
-do over the same thing at the other corner

There are many other ways to draw that as well.

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: Can you create a rectangle with 2 rounded corners?

Postby Maestral » Wed Apr 03, 2013 11:13 am

Indeed there are...
Perhaps this one? ,)

Image

Later on, rounded ones would not be "editable", but fortunately it all can be easily repeated ,)
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Wed Apr 03, 2013 6:26 pm

Maestral & Lazur - many thanks for your answers here.

I must admit that I understood Maestral's answer :) and having a diagram really helped.

If anyone has any other ways, it would be interesting to see them. Thank You.

Caroline

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby brynn » Wed Apr 03, 2013 9:57 pm

Hi Caroline,
I would probably draw one rectangle, with sharp corners, then duplicate it. Then make rounded corners on the duplicate. Then select both and do Path menu > Object to Path.

Next, I would use node editing and snapping (set up to snap to cusp/corner and smooth nodes). On the corners that you want sharp, drag one of the nodes towards the sharp corner of the rectangle underneath until it snaps. Delete the other node.

Now click on the new corner node with the Node tool, to select it, which should also reveal the node handles. Hold your mouse over the node handle, which is the tiny circle at the end of a thin straight line. You'll notice it turns red when your mouse is in the right position. Then hold Ctrl key while you click. That retracts the handle and makes the line on that side of the node straight. Depending on which node you drag, you may or may not need to do the same to the other handle. If you see the other handle, do the same thing to it. If you don't see it, it's already retracted.

Then you can delete the underneath rectangle, when you're finished :D

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Wed Apr 03, 2013 10:28 pm

Hi Brynn - Nope, I can't see how to do it your way. So far Maestro's method is the simplest for this relative newbie.

thanks for the input though :)

Caroline

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby brynn » Thu Apr 04, 2013 2:22 am

If you can tell me where you get stuck, I'll be glad to help you sort it out.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby brynn » Fri Apr 05, 2013 2:05 am

As this discussion evolved into a potential new feature, I split it out into a new topic: viewtopic.php?f=28&t=13819 However, doing so may have stripped out 1 or more attachments. If so, I apologize. Would you please reattach?

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Sat Apr 06, 2013 6:06 pm

I say Gentlemen! thanks for the input here - Brynn, not too clever with the snapping tool, and it was the last para that I got a bit lost. I'm also more used to visual learning...

As for the new topic you started..ha ha, your'e all much too clever for me. :D

I shall report back!

Caroline

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Can you create a rectangle with 2 rounded corners?

Postby Lazur » Sat Apr 06, 2013 7:44 pm

Speaking of visual learning, here is my method depicted.
May cause 0,002 pixel like inacuracy thanks to the boolean function.
Image
Attachments
hlp18.svg
(10 KiB) Downloaded 846 times

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Sun Apr 07, 2013 1:48 am

Lazur! Thank you for attaching the svg file - that is SO helpful. I shall have a poke around and report back!

Thank You.

Caroline :)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby brynn » Sun Apr 07, 2013 2:22 am

Ah yes, snapping can be bit daunting for new Inkscapers. One good general rule, to start with, with snapping, is to have the control bar set up specifically for each situation. In some tools/features, people will find a particular configuration that works for them, and stick with it. But with snapping, it's important not to have too many snap targets (or else whatever you're dragging will try to snap to everything). Here's how to set up for my suggestions. Note that if you hover your mouse over a button, some little text will appear, which describes what that button does. So set these 4 buttons engaged, and all the others not.
1 - Enable snapping (top or left button, depending on how you have your window set up)
2 - Snap nodes or handles
3 - Snap to cusp nodes
4 - Snap to smooth nodes

You'll know that the snap was successful when you see the tiny text on the canvas, that tells you which element snapped to which target. In a simple drawing like this, it's not as helpful as it would be in a more complex drawing.

This reminds me, I've been meaning to write a newbies' guide to snapping. I should do that soon :D

Anyway, another problem, that perhaps is a little less common, is how you set the snap strength. And having that in Document Properties is a little frustrating. But that really is the best place for it, imo. Actually I call it snap "strength" because that how it seems to effect the physical "snap" on the canvas, to me. But it's really called snap distance. Until you have more experience with Inkscape, perhaps it would be better to have them all set to "Always Snap". And simple drawings, that may be all that's needed. But if you start to work in more complex drawings the snap distance can become important. At least that's my experience. And there are some more snap controls in Inskcape Preferences. But again, for new users, the defaults are probably just fine :D

After re-reading the last paragraph of my suggestion, I'm not sure how I could make them more clear. You just have to do one step at a time. Unfortunately, I haven't had much free time lately, so I can't really draw up a diagram right now. But if anyone else is game to make a diagram of my suggestion, I won't mind at all. :D

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Sun Apr 07, 2013 4:19 am

Brynn - thanks for your reply. I think a 'Newbie's Guide to Snapping' would be great. Nice title too.

So Lazur - I've delved into the svg, but see, you lost me at the 3rd diagram.
'Nodes edited by moving them whilst holding the Control ++'. Which nodes to edit, move them to where, what exactly is control ++.
I'm not as well up on the keyboard shortcuts as yet.
'Add nodes to the overlapping corners'? Again, this doesn't mean anything.

For cases like this, I have a feeling that videos are the only way for me to get it.

So, Maestral's 3 step process is for me, the easiest to do and understand so far.

Caroline :D

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Can you create a rectangle with 2 rounded corners?

Postby ragstian » Sun Apr 07, 2013 7:07 am

Hi

Lazur URH;
Tried to follow your guide - got lost at "add nodes to overlapping corners" -
Can you add nodes to the "sharp corners" automagically? In case how? The CTRL ++ does not work on my system (win7 - Inkscape 0.48+devel r12248)
The second step "Convert to path - CTRL ++ " - is this a typo? - on my system the keyboard shortcut for "convert to path" is CTRL + C.

Chockwrap;
By pressingCTRLwhile moving an object or node you limit the movement to be either horizontal or vertical - depending of which way you move the mouse.

Image

Good Luck!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Can you create a rectangle with 2 rounded corners?

Postby Lazur » Sun Apr 07, 2013 4:51 pm

The Ctrl++ calls for the add paths together, which will add new nodes to the topology if the outlines are overlapping.
Wasn't a typo either with the converting from the rectangle as it works that way as well on my machine -with Inkscape 0.48.4 r9939; had it work on every other versions I used.
But you are right, Shift+Ctrl+C is defined to convert to path instead of Ctrl++.
And thank's for your image, that's exactly what I was meaning!

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Can you create a rectangle with 2 rounded corners?

Postby ragstian » Sun Apr 07, 2013 10:23 pm

Hi.

Lazur URH;

Got it! :D
There are a difference between CTRL ++ and CTRL + (numpad) +.
It works with the plus on the numerical keypad but not with the plus on the "main part" of the keyboard.
Very nice way of doing it!! I did not realize that the union operation inserted the necessary nodes.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
chocwrap
Posts: 51
Joined: Sun May 01, 2011 6:55 pm
Location: Wales, UK
Contact:

Re: Can you create a rectangle with 2 rounded corners?

Postby chocwrap » Mon Apr 08, 2013 12:46 am

Right, so now I've got it as well. I think this is quite a quick way of doing this as well as Maestral's.

Thanks for everyone's input - very helpful.
Caroline :)


Return to “Help with using Inkscape”