diyAudio (http://www.diyaudio.com/forums/index.php)
-   Multi-Way (http://www.diyaudio.com/forums/multi-way/)
-   -   Plotting a curve for a Tractrix Horn in Adobe Illustrator with Javascript. (http://www.diyaudio.com/forums/multi-way/152314-plotting-curve-tractrix-horn-adobe-illustrator-javascript.html)

 jpbturbo 22nd September 2009 09:32 PM

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

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;
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

 jpbturbo 24th September 2009 09:46 PM

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.

http://jpbturbo.com/images/tractrix_plot.jpg

Some more bad camera phone pictures.

Measuring before I rip the plywood to the desired depth for the horn.
http://jpbturbo.com/images/300hz_tractrix01.jpg

After I have ripped the plywood to the correct depth, tracing the curve onto the wood.
http://jpbturbo.com/images/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.
http://jpbturbo.com/images/300hz_tractrix03.jpg

The first cut is done.
http://jpbturbo.com/images/300hz_tractrix04.jpg

The second cut is done.
http://jpbturbo.com/images/300hz_tractrix05.jpg

Here are all four tops and bottoms clamped together to minimize warping. It's been very humid here.
http://jpbturbo.com/images/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.
http://jpbturbo.com/images/300hz_tractrix07.jpg

-Josh

 green heron 17th February 2010 03:23 AM

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.

http://1.bp.blogspot.com/_n4ZLzjY5qW...Z+Tractrix.jpg

 soongsc 17th February 2010 02:40 PM

Neat way of doing it.

 green heron 17th February 2010 03:20 PM

Here's my completed round 320 Hz tractrix horn

http://im1.shutterfly.com/procsrserv...9ZsWobl5etGTAA

Here's my result. So far, I only have one finished, and I still need to make the mid-bass horns. But, I tested it with my Korneff 45SE and it sounds great!

I detailed every step of the building process here:

DIY Firefly

 Egindin 28th July 2013 07:04 PM

Quote:
 Originally Posted by green heron (http://www.diyaudio.com/forums/multi-way/152314-plotting-curve-tractrix-horn-adobe-illustrator-javascript-post2088110.html#post2088110) 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. http://1.bp.blogspot.com/_n4ZLzjY5qW...Z+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

 green heron 28th July 2013 08:01 PM

PDF sent, good luck!

nt

 planet10 28th July 2013 08:12 PM

Just saw this. If you have the numbers already you can just copy & paste them into an Illustrator graph and it will generate the curve.

dave

 jwmbro 29th July 2013 11:03 AM

I used a similar method for building my paraline, except I plotted the contour in MATLAB.

http://i.imgur.com/OllmYj7.jpg

I did have to use adobe to make sure it prints out to scale though.

 first_1st 17th October 2016 05:59 PM

Quote:
 Originally Posted by green heron (http://www.diyaudio.com/forums/multi-way/152314-plotting-curve-tractrix-horn-adobe-illustrator-javascript-post2088110.html#post2088110) 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. http://1.bp.blogspot.com/_n4ZLzjY5qW...Z+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

 All times are GMT. The time now is 10:41 PM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.