topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 11:34 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Auto draw 2 lines about 1 inch apart & curve around but not overlap.  (Read 7230 times)

dartgame

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Hi,

I'm after program that will automatically draw two thin lines about one inch apart. The lines would curve around randomly and parallel but not cross over previously drawn lines and would eventually return to the starting point and join up. Varying the length would also be desirable. Outside the lines should be white and inside the lines should also be white. I want to be able to print off the results after enlarging it with a paint program. In effect, it will be a racetrack for my sons Hot Wheels cars.

Hope this is practical.

Cheers,

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
I reckon the easiest way to do this is with a vector programme -
Inkscape is open source/free, will probably do the job.

Draw one line, make it a heavy line.
Then duplicate it/clone it - but make the second line thinner and make it white.

The result will be like this:

Screenshot - 2012-11-30 , 12_35_38.pngIDEA: Auto draw 2 lines about 1 inch apart & curve around but not overlap.

if you want, I could produce a vector PDF for you -
but give me some more details.
I can make it any size you want - in the latest Adobe Reader (version 'X') you can print an extra large image on as many pages as it needs -
you get a bit of a jigsaw puzzle after :)
Tom

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
you may want an app similar to this demo ?
http://www.stencyl.com/game/play/15306

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
this seems a nice project to make a procedural river/racetrack generator with "surprising outcomes" as explained by mouser on his post about coding something emergent

The input of such program could be:
-number of curves
-distance
some code useful to make bezier interpolations:
http://www.antigrain...rpolation/index.html
http://polymathprogr...ering-bezier-curves/
I encourage anyone to try to make this project  ::)

-
« Last Edit: November 30, 2012, 01:26 PM by kilele »

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member

dartgame

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
@ tomos - "Draw one line, make it a heavy line. Then duplicate it/clone it - but make the second line thinner and make it white."

I was thinking the exact same thing last night. I'll give it a try before anything else.

Thanks all,



tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
@ tomos - "Draw one line, make it a heavy line. Then duplicate it/clone it - but make the second line thinner and make it white."

I was thinking the exact same thing last night. I'll give it a try before anything else.

Thanks all,

I dont know what app you're using, but if you want to print it big - it's definitely worth printing to pdf
(setting the page size to desired print size e.g. A0w and using Adobe Reader X, i.e. avoid Paint like the plague ;) )

best of luck :)
Tom
« Last Edit: November 30, 2012, 04:21 PM by tomos »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Let's assume for a minute that the request is for an automatic random track generating tool, rather than a tool to let you draw such tracks manually.  Drawing them by hand in the manor Tomos described might be the most practical solution but let's say you wanted a tool for making random tracks..

For anyone who was interested in an excuse to experiment with the "Processing" graphics-focused programming language, this idea would probably be perfect for it.

I'm thinking that the desire to have the track be a "loop" means that your best strategy might be to start with a circle and basically add curves to it, rather than just drawing a random path and trying to connect the ends up at the end.

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member

For anyone who was interested in an excuse to experiment with the "Processing" graphics-focused programming language, this idea would probably be perfect for it.


precisely the other day searching for cellular automata and graphics I run into this site about processing:
http://natureofcode.com/

kilele

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 243
    • View Profile
    • Donate to Member
I remembered my days playing scalextric! and did a quick search to see if there were track editors.
You may want to take a look at these programs:
Slot Car Race Manager - Track Layout Editor
PC SlotCarz (track editor)
Scalextric Track Designer
snaptrack-j
« Last Edit: November 30, 2012, 08:26 PM by kilele »

dartgame

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
This is great guys. I'm overwhelmed by the number of ideas  :Thmbsup: and don't know where to start. :)

Regarding printing big, I think I can use a program called The Rasterbater or another called Poster Forge to do that.

Yes, as per my "IDEA", it would be interesting to see a "track" being drawn automatically. I'm sure my son would love it.

Looks like I've got some work to do.

Thanks.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Regarding printing big, I think I can use a program called The Rasterbater or another called Poster Forge to do that.
that's an option too,
but -
(I think I said this above but I will emphasise!)

You're probably going to create a vector drwaing.
If you do create a vector:

  • you can scale it to *any* size (set page size; enlarge)
  • you will lose *no* quality in the enlargement
  • you can easily create a vector PDF with (I think) any of the common PDF printers (simply print to PDF)

compare that with messing around with enlarging bitmaps:
huge file sizes, and no sharp print at the end...

Then printing - here's the Adobe Reader X print dialogue:

Screenshot - 2012-12-01 , 16_48_06.pngIDEA: Auto draw 2 lines about 1 inch apart & curve around but not overlap.

the printer selected is A4 - you can see 'tile' options under 'Poster' and that the print-preview is automatically divided into whatever your maximum page size is.

PS I promise I'll shut up about that now :-[ :D
Tom