The pattern as a border problem

Post questions on how to use or achieve an effect in Inkscape.
User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 4:39 am

Lets say i want to make a border from a pattern. This is easy as long as the shape of my border is a square, but as soon as i have a rectangle that is made of two sides that are not a multiple of my pattern it gets problematic.

Basically i need a grid and careful pre-planning, right ?

For my example i used the basic A4 template in landscape format. My pattern is 30x30, 30px from the edges.
Obviously the math wont work on this.
Attachments
Borderproblem.png
Borderproblem.png (16.97 KiB) Viewed 2672 times

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 4:58 am

I guess i kind of answered the question by myself (grid and pre-planning).

But still, how would i find the correct patternsize for the above example ?

What i need is a common divisor for both, the horizontal and vertical pixelsize, that is a full number, right ?
How would you do that mathematically ?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: The pattern as a border problem

Postby Moini » Wed Feb 17, 2016 5:04 am

I'll leave the maths to Lazur ;)

For an alternative: can you use CSS? There's an option that stretches the border patterns if they don't fit exactly...
https://css-tricks.com/almanac/properti ... der-image/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 5:13 am

Moini wrote:I'll leave the maths to Lazur ;)

Good to hear, i was just beginning to question my intelligence, lol

For an alternative: can you use CSS? There's an option that stretches the border patterns if they don't fit exactly...
https://css-tricks.com/almanac/properti ... der-image/

No i cant. Isnt CSS for programming websites ?
Also i dont want the pattern to be stretched.

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

Re: The pattern as a border problem

Postby Lazur » Wed Feb 17, 2016 5:35 am

In general you need to adjust the pattern's length to the A4 format. Would use mm units for easier calculations.
For a continuous repeating the circumference has to be divided to equal lengths, 120 would fit in scale to the 30 px.
That would call for a 8,45 mm (1014/120) long pattern ~~29,941 px.

But that's right, all the corners at once cannot be tessellated with the pattern's starting/ending.
You need to make a compromise.

  • Change the layout from A4 format-, like 211,25 mm / 295,75 mm would fit with 120 samples. OR
  • Decide in which phase you will break the pattern sample.
  • OR don't care much about the small imperfection, eyeball it and stretch one of the samples/use the pattern along path lpe already.


Like you can make the overall A4 shape symmetric to horizontal and vertical axises if the tessellation starts at the middle of the side
(with 120 repeats at least, 119 wouldn't fit for this choice).
Or have two "nice" corners diagonally without an axis-symmetric result.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 5:43 am

Hm, i think i get it.
But from a conceptual point of view, i find it very hard to pull off.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: The pattern as a border problem

Postby Moini » Wed Feb 17, 2016 7:07 am

Off topic:
No i cant. Isnt CSS for programming websites ?


Inkscape uses inline CSS in the style attribute of every object, and on the web, you can even style your SVGs using an external .css file: http://tavmjong.free.fr/INKSCAPE/MANUAL ... Style.html
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 2:40 pm

Im wondering if the Stitch Sub-Paths LPE could be helpful as a measurement tool. Every time four sub-paths hit the corners, you found a pattern to work with.

(My initial idea was to divide an angled path (a half so to speak) with the Add Nodes Extension, but that didnt work.)
Attachments
helper.png
helper.png (15.82 KiB) Viewed 2571 times

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

Re: The pattern as a border problem

Postby Lazur » Wed Feb 17, 2016 4:25 pm

Good idea on displaying a dividing, but it won't be possible to hit every corner at once when using an A4 layout.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Wed Feb 17, 2016 4:41 pm

Why not ?

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

Re: The pattern as a border problem

Postby Lazur » Wed Feb 17, 2016 4:57 pm

Because it divides the sides in equal long distances and theoretically the width/height ratio of A4 format is one/square root two, which is irrational.
Since the values are rounded you can try by dividing in the least common multiple number of 210 and 297. But would that really work?
Way more than 120 repeats.


297=3*3*3*11,

210=3*7*10;

--->least common multiple=3*3*7*10*11=6930, meaning the pattern should be (210+297)/6930~~0,73 mm long.

in svg

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 4:00 am

:(

Im going back to origami. Fold to conquer.

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 12:16 pm

I doubt if I can give you a good answer. I run into this problem a LOT, since I enjoy drawing border patterns. My solution is to let the pattern unit dimensions determine the page size.

But if you want to do the math, you could scale the pattern unit to the right size, that will fit any page size you want.

Actually....are you talking about a pattern fill, or just combined paths? I wouldn't use a pattern fill for a border....just my personal preference, I guess. But you could.

(hhmm.... 8-) ....look for a border pattern challenge/contest at Inkscape Community, in the next couple of weeks :D )

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 12:32 pm

brynn wrote:But if you want to do the math, you could scale the pattern unit to the right size, that will fit any page size you want.

Thats still a math problem.

Actually....are you talking about a pattern fill, or just combined paths? I wouldn't use a pattern fill for a border....just my personal preference, I guess. But you could.

Not a pattern fill. Actually, i never use that.

A pattern in the sense of a design, But could be as simple as a square/rectangle/circle, etc.

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 12:48 pm

Are you asking for a non-math way to scale patterns to fit a given page size? I don't think you can avoid the math completely. I was thinking you could create a custom grid, but you'd need some math to figure out the custom grid.

I'll bet there's some kind of tool...somewhere...on the internet, that will do the math for you!

Edit
Well actually, the math wouldn't be very hard. Just take your page size and divide by the number of units you want to use.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 12:55 pm

The point of this thread is the concept side of things. The design.

Lets say i want to do a card. Its A4 (or whatever).
I have to work with a fixed size.

I want a border and i have to design a pattern.
As you can see above, thats a complex matter when you have two different sides.

EDIT:

or look at this pattern, try to fit this into a design for an A4 page size.

Image

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 1:38 pm

I don't think that would fit into an A4 page -- it's too long and too narrow.

For me, I would figure out what part is the pattern unit. I wouldn't figure it out like this, but the attached is just to show the unit. But for example, that rectangle pretty much determines the unit size.

pf.png
pf.png (38.02 KiB) Viewed 2450 times


First, I would decide whether there's going to be any margin between the border and edge of the page. Then I would take the page height and divide by the unit width, to find out how close it is to fitting. Do the same for width. And note that if there's a margin, you would use the margin size, rather than the page size. Then I would scale the unit so that an even number (whole number) of units fits. How do I know what size to scale to?

! :idea: I wonder if Moini's extension could be used for this?? ....rats, what did I do with that link? I'll post back as soon as I find it.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 1:41 pm

Well actually the image comes from this thread:
viewtopic.php?f=6&t=21708&start=25

and the pattern goes like this (but you also need a cornerpiece)

Image

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 1:44 pm

Here it is: https://github.com/Moini/inkscape-realscale-extension/ Instead of resizing an architectural drawing, couldn't you resize the pattern border?

Oh, ok about the pattern unit. But you get the idea.

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 1:55 pm

I dont understand how the extension is supposed to help. Isnt that some kind of ruler tool ?

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 2:03 pm

Yep. Isn't that what you need?

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 2:07 pm

Do i ?

I guess what i want is not doable.

My goal is to fit a certain pattern into a defined area.
Lazur already answered what the options are.

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

Re: The pattern as a border problem

Postby brynn » Thu Feb 18, 2016 2:22 pm

Well, to be honest, I'm not sure if it would work. My brain's still a bit addled by flu. But it seems like it should by theory. I was hoping you'd be able to put it to use. But maybe it's not quite right. Ohh, I've got it now. What you need is the opposite of that. Instead of having the size of a unit, and scaling everything to that size, you have the size (page size) and you need the units scaled to fit.

Well still, just like that extension, I wouldn't be surprised if there's some kind of tool, somewhere on the internet, that will do the math for you. But my energy's a bit too limited to search right now.

This is why I don't set a page size, when I make a pattern border. I let the pattern determine the size of the page. (Of course I only do it all for fun. If it was my day job, I'd purchase the right kind of tool to do the calculations. Hhmm.....not that I know how to use one, but isn't this how a sliderule works?)

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: The pattern as a border problem

Postby Espermaschine » Thu Feb 18, 2016 2:31 pm

The frame is to work with a certain size and thats the problem at the same time.

So either the math just works, or you have to "cheat" a bit.
Stretch or compress the pattern slightly to make it fit.

If there wasnt the problem of a fixed size, it would be easy, as you said.

In my example that wouldnt be too bad.
Attachments
tostretchornottostretch.png
tostretchornottostretch.png (23.97 KiB) Viewed 2405 times

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

Re: The pattern as a border problem

Postby Lazur » Thu Feb 18, 2016 4:39 pm

Personally I don't think the certain size is that strict. Even the standard containing the page sizes deals with the size of the error, there is ±2.0 mm tolerance for dimensions in the range 150 to 600 mm.
Also the mentioned printing to paper edge problem, some margin would need to fit in for a safe area.


On the pattern, it much looks like trochoids made with the spirograph extension. Probably you can use the parametric curves extension too to generate that.


Return to “Help with using Inkscape”