Jump to content
WalterBeiter

How to draw a shape with multiple stroke interruptions?

Recommended Posts

I want to draw a shape like you can see in the first image. The black stroke should go around the shape but interrupt at multiple points. The filling should be everywhere within that shape.

 

I use shapes with the same background color which cover the stroke part (second image) but that does not always work. Is there a better way to do this? 

 

I know I can use the "erase" blend mode but I think this causes rasterization on export.

 

If anyone knows how to draw a shape like in the first image please let me know... I dont want to draw a separate curve and place it on top the grey shape. It has to be one shape for easy editing. 

 

Bildschirmfoto 2018-01-10 um 18.37.11.png

Bildschirmfoto 2018-01-10 um 18.37.39.png

Share this post


Link to post
Share on other sites

The only idea that comes to my mind is:

  • Draw the figure you want
  • Then, duplicate it
  • The figure at the bottom will have the fill and the other one will have the outline
  • Finally break the curves according to your needs

Figure.png

 

This way you will have the fill with the shape you want.

Best regards!


You'll never know what you can do until you get it up as high as you can go!   

AMD FX 8350 :: Radeon HD 7870 :: Windows 10 ::  http://mithferion.deviantart.com/

Oxygen Icons :: Free Quality Fonts :: Public Domain Pictures :: iOS 11 Design Resources :: iOS App Icon Template :: Hot to do High Quality Art :: Mesh Warp / Distort Tool Considerations

Share this post


Link to post
Share on other sites
11 minutes ago, Mithferion said:

The only idea that comes to my mind is:

  • Draw the figure you want
  • Then, duplicate it
  • The figure at the bottom will have the fill and the other one will have the outline
  • Finally break the curves according to your needs

Figure.png

 

This way you will have the fill with the shape you want.

Best regards!

 

 

Hey Mithferion,

 

thank you for your quick response. Yep, that would work, however this would mean that I can never edit the original shape without duplicating it again and breaking the curves again. Even slight adjustments would mean a lot of work (I want to draw a map). I hoped that i could break the curves on multiple places and still have the fill that I want..

Share this post


Link to post
Share on other sites

I'm afraid I'm out of ideas that don't involve reworking. I'll see if I can think about an alternative.

Best regards!


You'll never know what you can do until you get it up as high as you can go!   

AMD FX 8350 :: Radeon HD 7870 :: Windows 10 ::  http://mithferion.deviantart.com/

Oxygen Icons :: Free Quality Fonts :: Public Domain Pictures :: iOS 11 Design Resources :: iOS App Icon Template :: Hot to do High Quality Art :: Mesh Warp / Distort Tool Considerations

Share this post


Link to post
Share on other sites
Guest

Good evening WalterBeiter,

 

Here's a method that may be right for you:
Convert the shape to curves if it isn't already, then with the node tool select the two nodes where the contour should disappear, select "Break Curve" and delete the contour portion between them.
If you want to edit the curve here, select both nodes again and choose "Close Curve". You can then change the direction of the intersection.
If you remove these two nodes, the intersection disappears and you just have to choose "Close Curve" on the bottom track to close the curve.

Yours sincerely.

Contour forme.png

Share this post


Link to post
Share on other sites

I think there is no way to create a single vector shape like that -- a vector shape is defined by a path that can either be closed (one continuous, unbroken path) or open (continuous everywhere except for the beginning & end points of the path). So for example if you try the break curve method suggested by @reglico, it will work fine for creating one break in the shape, but it won't for creating more than one break because you can't create a single open path with more than one beginning & end point.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites
1 hour ago, R C-R said:

no way to create a single vector shape like that

 

But no problem if we would get advanced control of dash lines. But before that we get beaming (teleportation), right? Countdown starts now … for Matt or …

Share this post


Link to post
Share on other sites

No one mentioned masking yet. Just make a shape that crops out the edges.

 

5a56ca25564a6_ScreenShot2018-01-10at9_23_29PM.thumb.png.82c56681815bc2a6c9f766fc62685248.png

 


The website is still a work in progress. The "Comics" and "Shop" sections are not yet ready. Feel free to connect with me and let me know what you like or what can be improved. You can contact me here, on my contact page, YouTube channel, or Twitter account. Thanks and have a great day!

Share this post


Link to post
Share on other sites
12 hours ago, reglico said:

Good evening WalterBeiter,

 

Here's a method that may be right for you:
Convert the shape to curves if it isn't already, then with the node tool select the two nodes where the contour should disappear, select "Break Curve" and delete the contour portion between them.
If you want to edit the curve here, select both nodes again and choose "Close Curve". You can then change the direction of the intersection.
If you remove these two nodes, the intersection disappears and you just have to choose "Close Curve" on the bottom track to close the curve.

Yours sincerely.

Contour forme.png

 

This only works when you want to interrupt the stroke on one place. It does not work if you interrupt the stroke on multiple places.

Share this post


Link to post
Share on other sites
6 hours ago, Bri-Toon said:

No one mentioned masking yet. Just make a shape that crops out the edges.

 

5a56ca25564a6_ScreenShot2018-01-10at9_23_29PM.thumb.png.82c56681815bc2a6c9f766fc62685248.png

 

 

Masking would be exactly what I want, but vector masks are rectangles only. 

 

The shape that I deal with looks like the following screenshot (it is a map):

I dont want / need to draw all streets. So for small and unimportant streets I would only draw the very first meters of that streets and leave the shape open at that place. Indicating that the street goes further. Therefore the shape has to be open and the stroke has to be interrupted.

 

The method I normally choose is that I just place white shapes top of those "street beginnings" (third screenshot). But the just work if you have a white and consistent background. You could use the same background an fill it in the white shapes, but that only works if you background is a single element. 

 

 

I endet up using the method @Mithferion provided, but that resulted in not so clean edges. I can use rounded stroke endings, which kinda work (screenshot 4). But if I choose rectangular stroke endings, there is now way to have a clean cut like when you use cropping or masking (screenshot 5).  

 

 

Bildschirmfoto 2018-01-11 um 10.18.51.png

Bildschirmfoto 2018-01-11 um 10.22.29.png

Bildschirmfoto 2018-01-11 um 10.24.31.png

Bildschirmfoto 2018-01-11 um 10.28.39.png

Bildschirmfoto 2018-01-11 um 10.29.03.png

Share this post


Link to post
Share on other sites
2 minutes ago, MEB said:

Hi WalterBeiter,

This is not posible to do directly with just one shape.

 

I this what the upcoming knife tool will do, which is mentioned in the feature roadmap for AD? 

 

Share this post


Link to post
Share on other sites
54 minutes ago, WalterBeiter said:

Masking would be exactly what I want, but vector masks are rectangles only.

 

I’m not sure where you got that impression! You can place any shape on the layer above the layer you want to mask, right-click the new shape layer in the Layers panel and choose 'Mask to Below'.

 

46 minutes ago, MEB said:
I don't have much details at this point on how the Knife Tool will work so i can't give you a definite answer, but if i had to guess i would say no.

 

I would also guess not. I expect that the Knife Tool in the Affinity apps will do what the tool of the same name does in DrawPlus, where lines (unclosed curves) can be divided into multiple lines, and shapes (closed curves) can be divided into multiple shapes. If I wanted a shape bordered by a 'stroke' with gaps in it, I would achieve that as @Mithferion has described: make a copy of the shape, apply a stroke but no fill, and then break open the unfilled shape and cut it.


Alfred online2long.gif
Affinity Designer/Photo/Publisher 1.7.3.481 • Windows 10 Home (4th gen Core i3 CPU)
Affinity Photo for iPad 1.7.3.155 • Designer for iPad 1.7.3.1 • iPadOS 13.2.2 (iPad Air 2)

Share this post


Link to post
Share on other sites
1 minute ago, WalterBeiter said:

I this what the upcoming knife tool will do, which is mentioned in the feature roadmap for AD? 

Like @MEB, I can only guess but I doubt it. You can't get around the requirement that an open vector path can have only one beginning & one end node, so no matter where you cut it, you are creating more beginning & end nodes, which forces the vector object to split into multiple paths.

 

As I understand it, this is not just an Affinity thing. To my knowledge, SVG & all the other common file formats that support vector objects have the same, 'one start & one end' limitation for open paths, so if you are exporting your Affinity document to any of them you still will have to use one of the workarounds mentioned in this topic to avoid rasterizing anything.

 

Overall, for maps & similar projects, I think the method @Mithferion mentioned works best. If you start with filled shapes that have no stokes, duplicate them, change the dups to have no fill & a suitable stroke width, you should be able to cut them into the required sections. Change their cap type to Butt to minimize (but admittedly not totally eliminate) the edge effects, something like in this road segment.afdesign file.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites
9 minutes ago, Alfred said:

I’m not sure where you got that impression! You can place any shape on the layer above the layer you want to mask, right-click the new shape layer in the Layers panel and choose 'Mask to Below'.

 

 

This is something I did not know. I was referring to the vector crop tool which is rectangular.

The problem is, though, that I will get rasterized on export ( I do not know why).

 

THIS ACTUALLY WORKED!

I created a mask shape which is roughly the same as the street map. But then I left out the street beginnings (screenshot 1). I then placed it on top of the street shape (screenshot 2). Then i did what you said and masked it out using right click and "mask to below" (screenshot 3). This is exactly what I was searching for as it cuts the shape cleanly (screenshot 4 and 5).

 

BUT AD was not able to retain vector and rasterizes this (screenshot 6). This is strange, since I tested this in an other document which worked fine on export (screenshot 7).

If I get this method to work properly without rasterization, this would be the solution for my problem.  

 

I just don't know why AD rasterizes some stuff that is vector only, sometimes it seems to be buggy. 

 

Bildschirmfoto 2018-01-11 um 11.32.06.png

Bildschirmfoto 2018-01-11 um 11.32.22.png

Bildschirmfoto 2018-01-11 um 11.39.12.png

Bildschirmfoto 2018-01-11 um 11.32.33.png

Bildschirmfoto 2018-01-11 um 11.32.46.png

Bildschirmfoto 2018-01-11 um 11.43.39.png

Bildschirmfoto 2018-01-11 um 11.26.47.png

Share this post


Link to post
Share on other sites
34 minutes ago, MEB said:

Check the alignment, join and caps of the strokes. To what format are you trying to eexport?

 

I am trying to export to pdf, so that I can print my map. 

 

 

I figured it out:

A stroke on the mask will cause rasterization. Just make your the mask shape has no stroke width (see screenshots). Select the mask shape and change the stroke width to zero (screenshot 2). Then voila, nothing gets rasterized (screenshot 3: "nichts wird gerastert").

 

So to recap: 

The solution is to draw a mask shape and then place it like you see in screenshot 1 (or right click - > mask to below, when you place it on top of the actual layer).

 

I am so happy that it works now, I made a crappy gif (which is way to large in file size..).

 

Thank you all for you participation and support. 

 

 

Bildschirmfoto 2018-01-11 um 12.00.42.pngBildschirmfoto 2018-01-11 um 12.00.37.pngBildschirmfoto 2018-01-11 um 12.01.06.png

it_workes.gif

Share this post


Link to post
Share on other sites
51 minutes ago, WalterBeiter said:

I figured it out:

A stroke on the mask will cause rasterization. Just make your the mask shape has no stroke width (see screenshots). Select the mask shape and change the stroke width to zero (screenshot 2). Then voila, nothing gets rasterized (screenshot 3: "nichts wird gerastert").

At first, I was going to say that does not work for me on a hastily drawn test file that (sort of) duplicated a few of the features of your map. But where you had created a "Kurven" (in English "Curves") container object for the collection of curves representing the roads, I created mine as a "Compound" container object instead.

 

(For those that might not know, Compound objects are created the same way as Curves objects, except that the alt/option key is held down when applying one of the Geometry operations like "Combine" to them.)

 

As it turns out, exporting the Compound version to PDF always seems to cause rasterization, whether the mask has a stroke or not. The two attached test files, roads (compound).afdesign & roads (combined).afdesign (I hope) demonstrate the difference.


Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.3.155 & Affinity Designer 1.7.3.1 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post


Link to post
Share on other sites
21 minutes ago, R C-R said:

At first, I was going to say that does not work for me on a hastily drawn test file that (sort of) duplicated a few of the features of your map. But where you had created a "Kurven" (in English "Curves") container object for the collection of curves representing the roads, I created mine as a "Compound" container object instead.

 

(For those that might not know, Compound objects are created the same way as Curves objects, except that the alt/option key is held down when applying one of the Geometry operations like "Combine" to them.)

 

As it turns out, exporting the Compound version to PDF always seems to cause rasterization, whether the mask has a stroke or not. The two attached test files, roads (compound).afdesign & roads (combined).afdesign (I hope) demonstrate the difference.

 

Thanks for pointing that out. I could reproduce this issue.

Share this post


Link to post
Share on other sites
5 hours ago, WalterBeiter said:

Masking would be exactly what I want, but vector masks are rectangles only. 

 

Alfred beat me to the punch. This is only the case if you use the Crop Tool. Please see this attachment for a clear example for custom shapes.

 

Masking.mp4


The website is still a work in progress. The "Comics" and "Shop" sections are not yet ready. Feel free to connect with me and let me know what you like or what can be improved. You can contact me here, on my contact page, YouTube channel, or Twitter account. Thanks and have a great day!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.