Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Feb 2021
    Location
    Huntsville, AL
    Hammock
    Dutchware Chameleon
    Tarp
    Hammock Gear Quest
    Insulation
    HG Incubator
    Suspension
    Beetle Buckles
    Posts
    57

    Catenary Curve Generator

    I'm finally getting around to making tarps for my kids. I see multiple references to catenary curve templates and generators here and elsewhere on the internet, but most of those seem to either be broken or don't produce printable templates. I put the attached Matlab script together to create printable pdf files that are all sized accurately. The sequence of pdfs can be printed, cut out, and taped together to create a single contiguous template for arbitrary catenary curve parameters (with some caveats: If the sag is larger than 10", it won't fit neatly on a single page). So is case there is anyone besides me out there that both use Matlab and want to generate catenary curve templates, here you go.

    Unfortunately, I can't upload .m files, so I'll drop the text of the script inline:

    Code:
    %%% Specify Catenary Parameters
    h = 6;  % sag
    H = 60; % width between catenary endpoints
    unitsStr = 'inches'; % units for sag and width - options are {'inches','centimeters'}
    
    %%% Output pdf file parameters
    pdfFilename = '.\catCurve';
    plotWidth = 9; % width of single plot on page (in current units)
    pageOrientation = 'landscape'; % options are {'landscape', 'portrait'}
    
    % The following code computes the catenary curve matching the inputs
    aGuess = H^2 / (8*h);
    a = fzero(@(x)(2*x*acosh((h+x)/x)-H), aGuess);
    x = -(H/2):0.1:(H/2);
    y = h + a - a*cosh(x/a);
    
    % Create plots sized appropriately to fit the specified page width
    p0 = min(x);
    curPlt = 1;
    while p0 < (H/2)
        figure; plot(x,y,'LineWidth',2);
        % force axes to have the correct size
        axis equal; grid on;
        xlim([p0,p0+plotWidth]);
        ylim([0,h]);
        set(gca,'LooseInset',get(gca,'TightInset'));
        set(gcf,'units',unitsStr,'position',[1,1,plotWidth,h]);
        axesPos = get(gca,'Position');
        set(gcf,'position',[1,1,plotWidth/axesPos(3),h/axesPos(4)]);
        % print current figure to pdf
        set(gcf,'PaperOrientation',pageOrientation);
        set(gcf,'PaperPositionMode','auto');
        newFname = sprintf('%s%d.pdf', pdfFilename, curPlt);
        print(newFname, '-dpdf');
        close(gcf);
        fileList{curPlt} = newFname;
        p0 = p0 + plotWidth;
        curPlt = curPlt + 1;
    end

  2. #2
    Senior Member
    Join Date
    Jul 2023
    Location
    grand junction, colorado
    Hammock
    DIY MTN 1.7 XL
    Tarp
    DIY Black Crow
    Insulation
    DIY Climashield
    Suspension
    Becket
    Posts
    110
    Thanks for this by the way. I'm making yet another tarp but this time based on Shug's black crow and I've been trying to find a way to print out the cat curve and this worked perfectly. I made a free account with matlab (never used it before) and just did a simple cut and paste of your code

  3. #3
    New Member
    Join Date
    Jul 2022
    Location
    SoCal
    Hammock
    Dutchware Chameleon Hexon 1.2
    Tarp
    UGQ Custom 11' Hex
    Insulation
    UGQ UQ/TQ
    Suspension
    SuperiorSuspension
    Posts
    24
    Oh, this is interesting!

    I am working on a tarp design as well, and just did the sketch in on-shape last night using conic curves since that's the tool they provide. If the curvature math is different enough it probably would be worth my time to try and convert your matlab algorithm into an onshape Featurescript.

    Unfortunately the math here is a little beyond my level of comfort, do you happen to know if there is much difference there is between a conic and catenary curve?

  • + New Posts
  • Similar Threads

    1. Catenary / Parabola Curve Calculator
      By XTrekker in forum DIY Stickies
      Replies: 60
      Last Post: 04-12-2021, 16:31
    2. True Catenary Curve
      By jellyfish in forum Do-It-Yourself (DIY)
      Replies: 56
      Last Post: 10-12-2017, 22:10
    3. Catenary Curve Template Pdf Creator
      By rammsteini in forum Do-It-Yourself (DIY)
      Replies: 22
      Last Post: 10-26-2016, 10:13
    4. Catenary Curve - Easy spreadsheet
      By MAD777 in forum Do-It-Yourself (DIY)
      Replies: 6
      Last Post: 02-08-2011, 11:19
    5. Cat generator
      By gunn parker in forum General Hammock Talk
      Replies: 21
      Last Post: 08-16-2007, 08:58

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •