# Shapes.rb Sketchup Plugin to draw parametric 3D shapes

##v1.1 J W McClenahan 2013-09-14
Added parameter for number of segments to draw for Cylinder, Cone, Torus andTube, replacing fixed n=24.
Changed Box default height 

##v1.2 J W McClenahan 2013-09-15
Added code to detect model length units, and set different default sizes for imperial and metric units 
  in round numbers in each unit system - e.g, substituting 300mm for 1 foot
Tricky bit was finding where to set module-wide values accessible within each class - copied example 
  of points_in_a_circle function to define a function which returns length_unit as a value (now unit_length)

##v1.3 J W McClenahan 2013-09-20
Make initial default sizes one unit in each dimension in model units and format, 
  or simple x10 multiple of one unit (for mm and cm units)
Now remembers last size chosen for shape and presents it as default next time
  Extended Pyramid to n-gon base, not just square base (requires 3 sides or more in base polygon)
  Added Class to construct Sphere as well as Dome.

##v1.4 J W McClenahan 2013-09-22
Redefined torus big radius so it becomes the overall outer radius defaulting to one unit, 
  not as at present where it is the radius to the centre of the smaller radius. 
Amended torus validation check so that small radius must be no more than half outside radius.
Changed small radius default to one quarter outer radius, giving a torus with one half unit central hole

##v1.4.1 J W McClenahan 2013-12-31
Adapting to SU2014 Beta - Ruby changed to v2.0 and shapes.rb crashes - won't load

All lines like: 
  defaults = {"r", 2.feet, "h", 4.feet, "n", 6}  #Original values 
failed with syntax error 

Changed all such lines to the now necessary syntax form, with remembered default values:
  defaults = {"w" => @@dim1, "d" => @@dim2, "h" => @@dim3} 

##v1.4.5 2014-02-14 (modified in stages saved as v1.4.2 ... 1.4.5)
Ruby style cleanup to fix code not in accordance with GitHub Ruby Style Guide
  https://github.com/styleguide/ruby
  including replacing highly abbreviated variable names with more descriptive names

##v1.4.6 2014-02-16
Fixed a few if statements with overlooked parentheses round condition. 

Replaced the few remaining cryptic abbreviations with more descriptive names
  e1, e2 to edge1, edge2
  pts to points

##v1.5 2014-03-23
Added new Shape - Helix, based on adaptation of Jim Foltz's DrawHelix14.rb (ca. 2008), which in turn
was based on Peter Brown's DrawHelix13.rb (2004). The adaptation allows negative Pitch (to draw helix downwards) and/or negative No. of rotations, to draw left hand helix instead of right hand, and adds another editable parameter for the angle from the X-axis at which to start drawing the helix.

##v2.0 2014-03-24
Merged further code clean-up changes, mainly in parametric.rb and mesh_additions.rb, from Thomas Thomasson, into version which he will publish on Extension Warehouse

##v2.1 2014-03-25
Added another new shape, Helical Ramp. Still to do: reverse faces if rotations < 0 for left hand helix.

##v2.1.1 2014-03-28
Fixed reversed faces for left handed helix by drawing them clockwise instead of anti-clockwise. 

Tidied up code for drawing faces.

##v2.2 2014-04-18
Added new Shape - Helical Ramp with Sides. Added sides, with option for angle of slope of sides. 

Fixed minor bug - number of rotations was being reset to default value of 1.0 on editing or redrawing helix-based shapes, not remembering previous value.

##v2.2.1 2014-04-19
Added parameter for starting height of helical ramp with sides

## v2.1 
Added HelicalRamp class

## v2.2 
Added HelicalRampWithSides class

## v2.2.1 
Added starting height parameter for helical ramp with sides

## v2.2.2
Changed to specifying start and end heights, not pitch, for Helical Ramp with Sides, and calculating pitch from those

## v2.2.3 
Bug fixes - a validation rule for Helix was wrongly specified (number of rotations must allow at least one segment to be drawn); a validation rule for Helical Ramp required only 2 segments per rotation: changed to 3

## v2.2.4 
Changed Helical Ramp to ask for start and end heights instead of start height and pitch

## v2.2.5 
Changed Helix to ask for start and end heights instead of start height and pitch

## v2.2.6 
Fixed bug in all helical shapes where negative (end - start) height and negative rotations drew 'height' upside down.

## v2.2.7 
Changed module name (namespace) from CommunityExtensions to JWM, to avoid possible conflict with SketchUp Extension Warehouse version.

## v2.2.8 2014-11-21
Changed name of plugin from shapes.rb to jwm_shapes.rb since there was still a name conflict with the Extension Warehouse version of the plugin, and also changed module name from JWM::Shapes to JWM::JWMShapes. Changed Draw menu to read 3D Shapes (JWM) again to avoid confusion with Sketchup/Trimble version

## v2.2.9 2014-11-22
Added missing validation for minimum number of segments for Tube, Torus and Pyramid

## v2.5 2014-11-22
Converted the plugin to draw each shape as Component Definition (not a Group), and allow the user to place the shape at any pickable point, not just at the world origin. Based on Jim Foltz's adaptation of the code for a staircase stringer posted in the Plugins forum thread for this plugin.

## v2.51 2014-12-01
Corrected version number in jwm_shapes loader and jwm_shapes.rb files to match published version number

## v2.5.2 2014-12-01
Fixed typo in parametric.rb which gave error on loading

## v2.5.3 2014-12-03
Fixed incorrect naming of modules which resulted in Torus, Dome and Sphere not working because they couldn't find the mesh_additions.rb modules. 
