Catenary Script

 From: bemfarmer 30 Aug 2011  (1 of 13)
 Attached is a simple Catenary Script. It makes a nice revolve. Catenary or Arch script for MoI August 26, 2011 By Brian McMillin The procedure for creating a Catenary or Arch script for MoI began to become clear after a lot of google searches. A Catenary curve is the shape produced by a wire or chain or rope, or other material, which is inelastic and flexible, and is suspended from two supports. It resembles a parabola, but is a different curve. In an X,Y coordinate system, when the catenary is oriented symmetrically about the Y axis, vertex intersecting the Y axis, with gravity in the negative Y direction, the equations for the catenary are as follows: Y = a*cosh(x/a) = ( a/2)* ( e^(x/a) + e^(-x/a) ) Where the a parameter is the minimum Y value, at the intersection of the Y axis. (See Wikipedia for graphs, mathematics, and further information.) The parametric equivalent equation for the catenary, where t = 0 at Y axis vertex, is: x(t) = t Y(t) = a*cosh(t/a) = ( a/2)* ( e^(t/a) + e^(-t/a) ) Here is my first rudimentary effort to create a script for half of a catenary, “CatenaryHalfDraft” It is based upon modifying the existing “ToroidHelix” script. Enter a maximum value for X. (positive) Enter a value for a. (positive Y vertex) Enter a value for Points per X unit. Checkbox for Arch. (Haven’t figured out check boxes yet. Not really needed. CatenaryHalf is a rudimentary script for MoI, which creates half of a catenary. Mirror other half of catenary. Rotate and move for an Arch. A more professional script would interactively hang a catenary by selecting two points of different heights, given either a Length of catenary arc, or a third point on the catenary, and perhaps behave similarly to the Conic command. Internet search revealed non-copyrighted posts by elbarto and opalg (mathematics), as well as Grasshopper script posts by Giulio Picentino, and Daniel Davis. A MoI script should be possible, without copying any of the scripts, by using mathematics described by opalg and others. As the equations are not analytically solvable, this requires numerical methods, such as Newton-Raphson, and “hill climbing.” EDITED: 20 Feb 2018 by BEMFARMER Image Attachments:

 From: Frenchy Pilou (PILOU) 30 Aug 2011  (2 of 13)
 Cool try of coding! Seems perfect for bullets, warhead or suppository :)

 From: bemfarmer 30 Aug 2011  (3 of 13)
 4454.3 In reply to 4454.2 :D

 From: Michael Gibson 30 Aug 2011  (4 of 13)
 4454.4 In reply to 4454.1 Hi Brian, that's great that you've been able to get it all working! The way that you would do a checkbox is to add a element to the .htm file that contains the UI for the command. You need to give it an id="" attribute and fill in the inside of the tag with the text that will go in the button, so it will look something like this: code:`Text label goes in here` Basically when you have a control (any kind of button or input control) in the UI that has an id assigned to it, when that control gets activated it will trigger a UI event that your .js file can then respond to. The event will have the name of the id="" attribute of that control and you can retrieve the current true/false property for whether it is checked or not by using the .value property of the control - that works similar to how the script is currently retrieving the .numericValue property from the edit fields. And actually in MoI v3 you can use just plain .value for those numeric fields as well. Let me know if you are still stuck trying to use a check box and I can help you get it set up. - Michael

 From: bemfarmer 30 Aug 2011  (5 of 13)
 4454.5 In reply to 4454.4 Thankyou Michael. More to come, later after work...

 From: bemfarmer 23 Mar 2012  (6 of 13)
 Attached is an unofficial Catenary curve creation script. It works well in the TOP view. Catenary2PtXY is a script which produces a catenary in the xy plane, from two points picked by the user. Gravity is in the negative y direction. In the event that the z coordinates of the two points are not equal, an alert requiring equal z coordinates is given. This script uses the Opalg math, and most of the elbarto code. Nearly all of the MoI Distance script is used to select the two points, and measure the distance between the two points. The user inputs the chain length, which must be greater than the distance between the two points, or a catenary will not form. In the event that a catenary does not form, even though the chain length is greater than the distance between the two points, OR if the catenary is upside down, the Newton-Raphson method has failed, and the user can adjust the GuessRadius parameter, to be smaller or greater than 1.0. For a chain length that is long in relation to the x-axis distance between, try a fractional GuessRadius. For a chain length that is slightly longer than the x-axis distance, try a GuessRadius greater than 1. An ARCH seems to be formed if a negative GuessRadius is used. An explanatory PDF titled "Catenary Suspension from Two Points" is being edited, and may be posted later, if anyone is interested. Edit: 3/23/2012 Replaced Catenary2PtXY with slightly modified htm. Now works with MoIversion 2 (Windows) Do not have a Mac... Still working on a version which will also accept different z coordinate values, by using a coordinate frame... EDITED: 23 Mar 2012 by BEMFARMER Attachments: Image Attachments:

 From: Michael T. (MICTU_UTCIM) 23 Mar 2012  (7 of 13)
 4454.7 In reply to 4454.6 Very cool. Thanks for the great script bemfarmer. Just to clarify, this only works with the Beta V3 version, correct? I tried it with V2 and I get a script error. Michael T. Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle

 From: bemfarmer 23 Mar 2012  (8 of 13)
 4454.8 In reply to 4454.7 I never tried version 2......should have...

 From: bemfarmer 23 Mar 2012  (9 of 13)
 Edit: 3/23/2012 Replaced Catenary2PtXY with slightly modified htm. Now works with MoI version 2 (Windows) (Had an extraneous line of code in the htm.) Do not have a Macintosh. Perhaps someone will try it out there?

 From: Michael T. (MICTU_UTCIM) 23 Mar 2012  (10 of 13)
 4454.10 In reply to 4454.9 Just downloaded it bemfarmer, I'll give it a spin. Thanks, Michael T. Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle