• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: random walk AS — blocking out the moves
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: random walk AS — blocking out the moves


  • Subject: Re: random walk AS — blocking out the moves
  • From: Gil Dawson <email@hidden>
  • Date: Tue, 29 Jul 2014 17:28:51 -0700

Hi, Alastair--

I don't know InDesign and I don't know what is "AI", but I do have a math note you night find useful.

The notion of someone driving down a road at high speed has been implemented by a random generator (representing the bumps in the road) passed through a low-pass filter (representing the tires and suspension) added to the vertical (and not horizontal) origin of the scene (and not its frame).

A simple low-pass filter analogous to y = 1-e^(-RCt)  can be simulated iteratively with y(n+1) = ay(n) + (1 - a)r(), where y(n)  is the number to add to frame n's vertical origin, 0 < a  < 1 is a number to adjust the frequency response (smaller is slower), and 0 <  r() < 1 is a random number.  Play with the values until you get a good-looking ride.

--Gil

On Jul 25, 2014, at 2:20 AM, Alastair Leith wrote:

Hi list

I would like to write an AppleScript to change a page element on every spread of an InDesign document. The element is a rolling curve, a bit like the outline of hills in the distance where the appear to meet the sky.

I ideally like to have a script that does a random walk on the {(x, y)} coordinates of anchors and handles of an open path over a sequence of pages. Like you would see if you were animating a film of someone driving down a road at high speed and the hills of the 'horizon' (I'm sure that's the wrong use of that word) would move from the centre of image to the periphery.

To keep things more simple, I made a few curves in AI and made blends between them so there is one path object for each spread when the blend is expanded.

That way I can manually get the curves how I want (but miss out on the fun of it making something I never would have though of)

So the question is how to get the curves out of AI into ID and pasted in place on each spread with the correct co-ordinates. I can make a box element for each curve to deal with any variations if co-ordiantes wander due to anchor points wandering.

A picture tells a thousand words so I will follow up this email in a few hours with an AI file and a ID showing what I mean. (Had this email drafted for three days and keep not sending…)

Any ideas about best way to move forward much appreciated. I did a bit of scripting of AI a few years back in _javascript_ so I'm game to have ago but am unfamiliar with ID object/property tree or DOM or whatever it's called.

Best
Alastair

Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users This email sent to email@hidden
References: 
 >random walk AS — blocking out the moves (From: Alastair Leith <email@hidden>)

  • Prev by Date: Re: Weird behavior of text in Pages
  • Next by Date: Re: Read a text file
  • Previous by thread: random walk AS — blocking out the moves
  • Next by thread: Re: AppleScript-Users Digest, Vol 11, Issue 277
  • Index(es):
    • Date
    • Thread