Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: August/September Entry: Portolan Chart

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Wip August/September Entry: Portolan Chart

    I'm trying a Portolan Chart: http://en.wikipedia.org/wiki/Portolan_chart

    So far I've vectorized, cleaned up, and tweaked the base image in Inkscape, and written a little program to generate the web of Rhumb Lines.

    ### LATEST WIP ###

    Click image for larger version. 

Name:	aug-sept-outline.png 
Views:	262 
Size:	564.3 KB 
ID:	28224

  2. #2
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Cleaned up extraneous rhumb lines and rotated them slightly, and added a neatline.

    ### LATEST WIP ###

    Click image for larger version. 

Name:	aug-sept-outline.png 
Views:	172 
Size:	419.3 KB 
ID:	28251

  3. #3
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    hello you... any chance you`d share that little rhumb program?? me wants it very bad!
    -Sigurd Sigurd Brutus Motor-



  4. #4
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by sigurdbjohansson View Post
    hello you... any chance you`d share that little rhumb program?? me wants it very bad!
    Code:
    #!/usr/bin/ruby1.9.1
    
    require 'matrix'
    
    p=4
    
    n=2**p
    
    d1=600
    d2=4*d1
    
    
    
    points=Array.new(n) do |k|
      theta=2*Math::PI*k/n
      
      x=d1*Math.cos(theta)
      y=d1*Math.sin(theta)
    
      Vector[x,y]
    end
    
    def line(p1,p2,style)
      "<path d=\"M#{p1.to_a.join " "} L#{p2.to_a.join " "}\" style=\"#{style}\" />"
    end
    
    puts <<EOS
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    
    <svg version="1.1"
    xmlns="http://www.w3.org/2000/svg">
    EOS
    
    n.times do |k|
      p1=points[k]
      (k...n).each do |l|#<path d="M250 150 L150 350 L350 350 Z" />
        style=(k+l)%2==0? "stroke:black;stroke-width:0.5px;":"stroke:red;stroke-width:0.5px;"
    
        opacity="opacity:#{rand*0.5+0.5}"
        p2=points[l]
        v=p1-p2
        v=v*d2*(1.0/v.r)
        p3=p1+v
        p4=p2-v
    
        # p4 - p2 - p1 - p3
    
        print line(p1, p2, style+opacity)
        
        print line(p4, p2, style+opacity)
        
        puts line(p1, p3, style+opacity)
    
      end
      style="stroke:black;stroke-width:0.5px;"
    
      theta=2*Math::PI*(k+n/4)/n
    
      x=d2*Math.cos(theta)
      y=d2*Math.sin(theta)
    
      v=Vector[x,y]
      
      p2=p1+v
      p3=p1-v
    
      opacity="opacity:#{rand*0.5+0.5}"
    
      print line(p1, p2, style+opacity)
      puts line(p1, p3, style+opacity)
      
    end
    
    puts "</svg>"

  5. #5
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    thank you very much.

    now i just need to know how to make all this code work?? heh heh..... where do i use it?? (total n00b, yes)

    -Sigurd Sigurd Brutus Motor-



  6. #6
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by sigurdbjohansson View Post
    thank you very much.

    now i just need to know how to make all this code work?? heh heh..... where do i use it?? (total n00b, yes)

    Well, you need a Ruby runtime to run it: http://www.ruby-lang.org/en/

    If it's easier, here's the SVG file output, zipped because the forum software refuses to allow SVG files. With the program you can change the number of directions, but most real portolans seem to have 16 directions.
    Attached Files Attached Files

  7. #7
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    I`m sorry, but i haven`t got a clue here!
    Where do I use the SVG file?? I tried it in Firefox, but I only got some of the image (three stars in the upper left corner)...
    Is there somewhere in the code I can change the amount of "stars"?
    -Sigurd Sigurd Brutus Motor-



  8. #8
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    AHA! I`m such a dumbass! You just copy and rotate the things??



    But is there anyway I can get the image bigger than in my browserwindow??
    Last edited by sigurdbjohansson; 08-21-2010 at 06:36 PM.
    -Sigurd Sigurd Brutus Motor-



  9. #9
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Default

    Quote Originally Posted by sigurdbjohansson View Post
    AHA! I`m such a dumbass! You just copy and rotate the things??
    You should be able to load it into any vector graphics program like Inkscape, Corel Draw, Adobe Illustrator, or Xara X. Then you can move it around, scale it, delete lines, etc.

  10. #10
    Guild Member sigurdbjohansson's Avatar
    Join Date
    Aug 2010
    Location
    Oslo, Norway
    Posts
    88

    Default

    Thanks alot! I think I`ve got the hang of it now....
    -Sigurd Sigurd Brutus Motor-



Page 1 of 3 123 LastLast

Posting Permissions

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