=begin
Copyright 2013, Chris Fullmer
All Rights Reserved

Disclaimer
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

License
This software is distributed under the Smustard End User License Agreement
http://www.smustard.com/eula

Information
Author - Chris Fullmer
Offset code written by Rick Wilson @ smustard.com
Organization - www.ChrisFullmer.com and distributed on the SketchUp Extension Warehouse
Name - Greeble
SU Version - 2013, 8, 7

Description
This script adds Greebles to all selected faces or to all loose geometry if nothing is selected

Usage
Select the faces you would like to be Greebled.  Then run the script (Plugins>Greeble).  
Put in min/max height for Greebles.  You can also add an offset to be used. A negative value is 
an inset face.  The Greeble offset or original face will change which face gets greebled.  I think 
that playing with that option will help explain it.  You can also specify a scale amount as a percent.  
100 is no scale, 20 is smaller, 200 is twice as large as the original.

History
0.01:: 2009-02-01
   * Original release. Plenty of bugs.  Some known, probably lots of unknown.
0.011:: 2009-02-01
   * Upgrade to the original script.  Now it supports the SketchUp 7 ruby speedboost.
0.02:: 2009-02-02
   * Added min/max options to the offset. (super buggy apparently)
   * Added some checks on the menu inputs to help make sure that useable values are entered.
   * Added rough metric support.
0.025:: 2009-02-03
   * Fixed a bunch of errors in previous version including the random # generator, offset distances work consistently.
   * Added a face normal check to make sure new faces created with offset match the original face direction.
0.03:: 2009-02-06
   * Added a validity check on the face about to be push/pulled to reduce breakage.
   * Ability to Set min/max offset distances is now much more stable.
   * Correctly uses the speed up capability of SU 7.
   * Works with SU 6 (and lower).
   * Uses (and requires) ProgressBar.rb to show its working and estimate how much time it will take.
0.04:: 2009-02-09
   * Added "Happy Greeble-ing" to the status bar
2.00:: 2009-02-11
   * First non beta release, and we'll just skip version 1 altogether!
   * Added the ability to scale the greebles
   * Propmts to group greeble "roofs" all together in one group.  Useful for some applications of the script.
2.10:: 2009-02-13
   * The first Smustard release!
   * Update rdoc compatiblity
   * New license info to conform to Smustard's EULA
2.11:: 2009-03-09
   * Organizer.rb support. If you place this script into an organizer directory, it will appear in the correct submenu.  If its just in the plugins folder, it will appear in "Chris Fullmer Tools" submenu of the Plugins Menu."
2.2:: 2009-08-31
   * Fixed a MAJOR bug that would cuase SketchUp to crash when greeble was used inside a group or component.  So yes, you can now safely use Greeble inside a group or component! 
   * Changed some code that should theoretically speed things up ever so slightly....frankly I don't think it helped.
   * Changed some code to make it run smarter, skip certain methods if they were not being executed.
   * Fixed some code that could cause problems when faces would overlap.
2.21:: 2009-08-31
   * Now user input settings are rembered between script uses.
2.3.0 - 2013-5-7
  * Updated for EW
  * Remove Dependencies
=end

module CLF_Extensions_NS

  module CLF_Greeble

    require 'sketchup.rb'
    require 'extensions.rb'
    
    NAME = "clf_greeble"
    UNAME = "CLF Greeble"
    MENU_NAME = "Greeble"
    version = "2.3.0"     
    desc = "This plugin adds basic greebles to a face. These are inset faces that get push/pulled."
    copy_year = "2013"
    author = "Chris Fullmer with offset from Rick Wilson"
    
#------edit above--------------------------------------------------------------- 

    
    extension = SketchupExtension.new UNAME, NAME+"/"+NAME+"_menus.rb"

    #The name= method sets the name which appears for an extension inside the Extensions Manager dialog.
    extension.name = UNAME

    # The description= method sets the long description which appears beneath an extension inside the Extensions Manager dialog.
    extension.description = desc + "  Access it via Plugins > Chris Fullmer Tools > "+MENU_NAME

    # The version method sets the version which appears beneath an extension inside the Extensions Manager dialog.
    extension.version = version

    # Create an entry in the Extension list that loads a script called
    # stairTools.rb.
    extension.copyright = copy_year
     
    # The creator= method sets the creator string which appears beneath an extension inside the Extensions Manager dialog.
    extension.creator = author

    # The register_extension method is used to register an extension with SketchUp's extension manager (in SketchUp preferences).
    Sketchup.register_extension( extension, true )
    
  end
end