Plotting a curve for a Tractrix Horn in Adobe Illustrator with Javascript.

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Sorry in advance for the long read but,

I figured this out yesterday and I thought that other people might find it helpful/interesting.



If you happen to have Adobe Illustrator CS4 and a little bit of computer knowledge you can run a script to draw the curved sides of a tractrix horn using X and Y coordinates.

Open up a new file in notepad and paste in something like this,

var myDoc = app.activeDocument;
var myLine = myDoc.pathItems.add();
myLine.stroked = true;
myLine.setEntirePath([[0,82.5] , [2.6,84] , [6,88]]);




Then click on File Save As and name it something like tractrix.js

The .js extension tells illustrator that it is a Javascript file so it can know how to handle it.



The numbers in brackets[ in the lastline are the X and Y coordinates for each point on our line.

Obviously you would want more than three points in your line.

What I did is use Erik Forkers spreadsheet at volvotreter.de to calculate my X and Y coordinates.

The X coordinate for each point in our line comes from the Sidewall Stretched [mm] column, the Y coordinate comes from a column I made that takes the values of the height [mm] column and multiplies it times .5 to give me my width(keeping in mind that his spreadsheet is setup to make a horn rotated 90 degrees from most midrange horns).

I cut each of those columns into another spreadsheet and added the the brackets in the adjacent columns.

Then I used the concatanate function to join the cell with the opening bracket [ and the X coordinate into a single cell and I did the same so I had the Y coordinate followed by the closing bracket ] in another cell.

I moved both sets of coordinates so that they were in the A and B columns and clicked File Save As and chose .csv as the file type.



Then I opened the .csv file I had just created with notepad and I saw that I had a number of rows of the following format [number,number]

This is great however we can't just paste this into our .js file just yet as there is still some slight formatting that must be done.

I clicked Ctrl+A to select all.



Go back into Excel and on a new spreadsheet I clicked in the top left cell and right clicked and clicked on paste.

Now I had all my values running down off the screen in a SINGLE column.

I selected all of the cells that had my coordinates in them and right clicked and clicked Cut.

Then I right clicked in a cell in the first row to the right of the cells I had just cut and clicked on Paste Special.

At the bottom of the little Paste Special menu that pops up click Transpose.

Suddenly all of our coordinates are on the same line.

Reselect our new row of coordinates and right click and click copy.



Open up Word and click paste.

Select the blank space between the first and second PAIR of coordinates, the space between the closing and opening brackets ]this space[ and hit Ctrl+C to copy this blank space.

Then hit Ctrl+F to bring up the find menu, click on the second tab which should be the find and replace menu.

in the find field click and hit Ctrl+V to paste in the funny blank space we have between our coordinate pairs.

In the Replace field put a comma and then a space.

Click replace all.

You should now see a comma and a space between all your pairs of coordinates like in the last line of the example up top.

Hit Ctrl+A to select everything and then go over to your .js file and paste it in between the opening and closing brackets ([paste here]);

Make sure that each pair of coordinates is seperated by a comma and then at the end we must have the second closing bracket ] and the closing perenthesis ) and semicolon ; to close out our line of script.



Make Sure the .js file is saved.

Open up a new blank document in Illustrator CS4.

click on File, Scripts, Other Script and then browse to your saved tractrix.js file.

Once you click on your file to select it click on open.

Pretty immediately you should have a nice looking tractrix curve plotted out in your main window.



Now there is one problem.

The the scripting engine doesn't use mm as it's unit of measure.

So you just need to click on View, show Rulers. and then right click on the rulers once they appear and set them to mm.

Then click on the rulers and drag out some guides to the appropriate measurements and then scale your curve accordingly.

If you click on your curve with the selection tool remember to hold down shift while you are scaling to constrain the proportions.



Then you'll have to figure out how to get it printed out to scale.



Anyways,

Perhaps somebody will find this useful.



Peace,
Josh
 
Sorry for the above post with all the text.
Here are some pictures,

First off, a nice smooth curve for the Tractrix horn as plotted by the Javascript in AI CS4.

An externally hosted image should be here but it was not working when we last tested it.


Some more bad camera phone pictures.



Measuring before I rip the plywood to the desired depth for the horn.
300hz_tractrix01.jpg





After I have ripped the plywood to the correct depth, tracing the curve onto the wood.
300hz_tractrix02.jpg



Getting ready to make the first curved cut. I cut two boards at a time and keep these pieces matched as a top and bottom pair.

Also if I cut more at once I get a little bit of blade deflection when turning the saw and they don't come out as even.
300hz_tractrix03.jpg



The first cut is done.
300hz_tractrix04.jpg



The second cut is done.
300hz_tractrix05.jpg



Here are all four tops and bottoms clamped together to minimize warping. It's been very humid here.
300hz_tractrix06.jpg



Here's the jig we will be using to assemble them. Not finished in this picture, I added crosspieces between the top of the trapazoid members to allow the top and bottom to be clamped to the jig as well as some built on clamps at the bottom to hold the mouth of the tractrix horn in place.
300hz_tractrix07.jpg





-Josh
 
Thanks for the tips, I did this the long way

I did that the long way in Illustrator--I wish I would have seen your post first. I measured and plotted my way to a 320 Hz tractrix curve. You can check it out my progress building round 320 Hz baltic birch tractrix horns at diyfirefly.blogspot.com Feel free to email me for a PDF if you're planning to build 320 Hz tractrix horns--it'll save you a lot of time.

320HZ+Tractrix.jpg
 
I did that the long way in Illustrator--I wish I would have seen your post first. I measured and plotted my way to a 320 Hz tractrix curve. You can check it out my progress building round 320 Hz baltic birch tractrix horns at diyfirefly.blogspot.com Feel free to email me for a PDF if you're planning to build 320 Hz tractrix horns--it'll save you a lot of time.

320HZ+Tractrix.jpg

Hi,

Great job! I built a 340 Hz tractrix horn in the past and now would like to build a bigger one - 320. I know there isn't much of a difference, but I enjoy the process. PDF or plotting point would be highly appreciated.

Ed
egindinm@hotmail.com
 
ask for pdf

I did that the long way in Illustrator--I wish I would have seen your post first. I measured and plotted my way to a 320 Hz tractrix curve. You can check it out my progress building round 320 Hz baltic birch tractrix horns at diyfirefly.blogspot.com Feel free to email me for a PDF if you're planning to build 320 Hz tractrix horns--it'll save you a lot of time.

320HZ+Tractrix.jpg

Hi green heron

Now I have a plan to build 320 Hz for Beyma compression so please sent PDF or plotting point would be highly appreciated.

First

xp1st@hotmail.com
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.