panjakrejn Posted August 31, 2020 Share Posted August 31, 2020 I have a diagonal straight line that I would like to divide into 30 equal line segments, any advice on the most straightforward way to accomplish this? Edit: and fastest/easiest? Quote Link to comment Share on other sites More sharing options...
v_kyr Posted August 31, 2020 Share Posted August 31, 2020 There had been a bunch of such questions before, just search the forum for similar topics. Dividing an object into equal parts Dividing via lines How to cut a part out of a vertical line? ... etc. ... Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
panjakrejn Posted August 31, 2020 Author Share Posted August 31, 2020 I checked those out, but I couldn't figure out how to use those to help me. And I did search. The good news is, I think I figured it out, so will post my solution for anyone else who happens upon this topic! The trick is to use a long skinny rectangle instead of a line. make a long skinny rectangle (like 4 inches by .02 inches) that goes from the start point to the finish point (use the mid points of the short sides) duplicate the rectangle (select it, control-c, control-v) change the rectangle's height or width (whichever is greater depending on it's orientation) to 1/Xth of what it was, where X is the number of segments you want. you can do this in Designer quite easily but just adding a "/30" (for example) to the measurement you want to divide in the transform box. control-j to power duplicate move the duplicate such that the start of the new skinny rectangle touches the end of the one we duplicated, head to tail. Hit control-j a bunch more times until you get all the segments you need. delete the original long skinny rectangle (unless you still need it for something else). This will give you X perfectly divided straight line segments where you once had a single line (well, technically, skinny rectangle, but that's fine.) Woot! v_kyr 1 Quote Link to comment Share on other sites More sharing options...
R C-R Posted August 31, 2020 Share Posted August 31, 2020 4 hours ago, panjakrejn said: This will give you X perfectly divided straight line segments where you once had a single line (well, technically, skinny rectangle, but that's fine.) You can create diagonal lines instead of skinny rectangles using a slightly modified version of your method: Make & duplicate a rectangle the same way as in your first & second steps. Change both the width & height of the duplicate using the same "w/x" & "h/x" Transform panel method you used. Move this reduced size rectangle to one of the corners of the original one. Switch to the Pen Tool & use this smaller rectangle to draw a line from one of its corners to its diagonal corner. Duplicate this line & move it diagonally so it touches the end of the first one, head to tail. Power duplicate (control-j) to create the remaining diagonal lines, stopping when the last duplicate touches the opposite corner of the original rectangle. You can now delete or hide the two rectangles, leaving only the diagonal lines which can then be grouped if you want individual lines or selected & joined if you want one long multi-segment line. 30 diagonal lines.afdesign sfriedberg and panjakrejn 2 Quote All 3 1.10.8, & all 3 V2.5.6 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7 Link to comment Share on other sites More sharing options...
v_kyr Posted August 31, 2020 Share Posted August 31, 2020 Well the whole would be sooo... easy with the help of some scripting functions, or some UI based dedicated interpolation & split functionality. Below a simple Python example. ''' Here's a Python example of splitting a line string (x1=0, y1=0, x2=10, y2=10) into 4 equal length ''' parts with the Shapely geo lib. For the given line the interpolate func determines the splitting points, ''' which in turn are then passed over to a split func which splits the line at those points. ''' The result are the 4 lines in this case. from shapely.geometry import LineString, MultiPoint from shapely.ops import split line = LineString([(0, 0), (10, 10)]) splitter = MultiPoint([line.interpolate((i/4), normalized=True) for i in range(1, 4)]) split(line, splitter).wkt # Result: # 'GEOMETRYCOLLECTION (LINESTRING (0 0, 2.5 2.5), LINESTRING (2.5 2.5, 5 5), LINESTRING (5 5, 7.5 7.5), LINESTRING (7.5 7.5, 10 10))' S1monSays 1 Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
lacerto Posted August 31, 2020 Share Posted August 31, 2020 (...) Quote Link to comment Share on other sites More sharing options...
v_kyr Posted August 31, 2020 Share Posted August 31, 2020 3 minutes ago, Lagarto said: Isn't this a similar case as in this post ... Yip, it's pretty much the same case, just more segments here. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
R C-R Posted August 31, 2020 Share Posted August 31, 2020 55 minutes ago, Lagarto said: Isn't this a similar case as in this post It is. I agree that the clever solution proposed by @JimmyJack is probably the simplest & most straightforward way to divide a single line into segments. I was just trying to show that a relatively small change to the method @panjakrejn devised could be used to create any number of individual, diagonally aligned lines. In fact, as long as you can create a rectangle whose diagonal is the desired length of each line, you can use that to create the first diagonal line, after which you can duplicate it, align it to the end of the first one, & power duplicate as many more lines as you want. You can also come back later & use the same method to add more lines, even after deleting the rectangle(s). Quote All 3 1.10.8, & all 3 V2.5.6 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7 Link to comment Share on other sites More sharing options...
JimmyJack Posted August 31, 2020 Share Posted August 31, 2020 Hmmm 🤔. This does sound familiar 😝. 30 is starting to get up there. I wouldn't wan't to click 29 times on a line to get the # of nodes needed. And power dupe is equally as clicky. So, in this case I'd do things a little differently. (And, since the original question on how to divide an existing line expanded to include solutions of creating new objects....) How about making a 60 sided polygon and just using half of it: 30 even units new.mp4 David in Яuislip, R C-R, v_kyr and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
lacerto Posted September 1, 2020 Share Posted September 1, 2020 (...) Quote Link to comment Share on other sites More sharing options...
S1monSays Posted March 13, 2023 Share Posted March 13, 2023 ...two years later... Quickest way: Open Rhino 3D: Draw a line of the desired length Use "divide by" , enter "30" Export as SVG into Affinity Designer On 8/31/2020 at 3:45 AM, panjakrejn said: I have a diagonal straight line that I would like to divide into 30 equal line segments, any advice on the most straightforward way to accomplish this? Edit: and fastest/easiest? No, seriously: Just make a vertical line at the STARTING point of your line and make X+1 copies of it. Move the last element over, so it intersects with the END point of your line. Now just use the "Distribute horizontally" command on all the new vertical lines and your line is intersected by evenly spaced lines ...now just select them all and use DIVIDE... done! Oh, wait... we are in Affinity Designer where this simple operation will NOT result in a divided line but in all the lines disappearing!!! But not all is lost: just connect the first two intersecting points, creating a (diagonal) 1/X snippet of your line, CTRL+move it to effectively make an extension and then just keep hitting CTRL+J, each time adding another segment of the desired length until you reached the end of your original diagonal line, now consisting of X segments. BBG3 1 Quote Link to comment Share on other sites More sharing options...
BBG3 Posted August 30 Share Posted August 30 Here is another way I saw it on YouTube. https://youtu.be/xrlhU1wwJpo Quote Affinity Designer | Affinity Photo | Affinity Publisher V2 ▪️ Mac: 2021 M1 MacBook Pro 16", 32GB memory, macOS Sequoia 15 ▪️ iPad: iPad Pro, 12.9": iPadOS 16.7.10, Apple Pencil 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.