This Plugin allows to draw physically accurate wires and ropes (catenary curves) between two points with only two clicks.

preview.png

ae_WireTool_1_4_1.rbz

Version: 1.4.1

Date: 06.03.2013

Usage: (Menu) Plugins → Draw Wires

Type a number + s to change the number of curve segments: 24s

Type a number + % to set an arc length (relative to the distance between source and target point): 120%

Type a length to set a fixed arc length: 72.5m 30.66"

History: version 1.4.1: 06.03.2013 - added Spanish translation - fixed non-convergent numerical approximation for curve lengths near 100% of distance version 1.4.0: 01.03.2013 - converted into a SketchUp Extension - image and cursor added version 1.3: 03.06.2012 - fixed wrong segment length (only noticeable with big sag like 200%) - changed segments to have equal angles (visually best result, but not all segments have the same length) - added optional parameter @@segment_distribution_mode in the script to toggle back to equal length segments (edit the ruby file) version 1.2: 30.05.2012 - now all segments have equal arc length (no more equal x length) - error with translation in activate didn't properly activate the tool - @state=0 fixed version 1.1: 27.05.2012 - translations - better precision (changed threshold for numerical calculations) version 1.0: 27.05.2012

Aerilius wrote:Type a length to set a fixed arc length:

!!! I tried on this a couple of years ago! Never worked out how to do a fixed length curve. I need to snoop around in your code. I wanted to make a tool that would anchor the end point to other geometry so when you moved of the the object it was attached it the curve would update.

Remus' plugin is the Simple Catenary Curve. It "just" calculates the curve for a given set of 17 points but it put me on the right path to look on Wikipedia after I had a paper full of integrals that didn't want get further simplified.

When I tried the plugin, I kept getting a canatnary drawn from the origin to my first pick point. Adding a @state = 0 to the def initialize method fixed this problem.

0

Nothing is worthless, it can always be used as a bad example.

Hi Sam, thanks for the tip. I wonder why this happens, although the initialize method does not have @state=0, this should be set when the activate method calls reset. Is someone else having this problem?

create_geometry and draw_geometry can be refactored into one method that returns an array of point3d objects - the only difference between these methods are the final statement. DRY

Tools normally don't have weird behavior without reason. Running it with the Ruby console open gives often more definable results. So I found and fixed an unobvious bug with the translations that stirred up all methods and I changed that the x-width of segments is variable to give always the same segment length.

0

Last edited by Aerilius on Thu May 31, 2012 4:32 pm, edited 1 time in total.

@Michaelv: Thanks for noticing this! It was not much visible with little sagging (110%) but with big sagging. Sorry that it took some time (it's not easy to do math with curve lengths). I fixed it now.

I also thought about the problem and find that the corners/endpoints a even less noticeable when I use equal angles between the segments. If you prefer equal segment lengths, you can change the parameter @@segments_distribution_mode to 1 inside the script.