# Eneroth Cylindrical Coordinates

# Copyright Julia Christina Eneroth, eneroth3@gmail.com

# Usage
#	  Menu: Extensions
#		  Eneroth Cylindrical Coordinates... :
#       Move all vertices inside selected group/component by letting the old X
#       represent a radius and old Y an angle. Useful for creating spiral shapes. 
#
# Sine the plugin only moves existing vertices the group/component needs to be
# sliced along its y (green) axis. To do this, create a face on the x (red) z
# (blue) plane. Move it onto one end of the group/component. Copy it to other
# side using the move tool and spread it evenly by entering slash and a number 
# to the VCB after copying it. Enter the group or component, select all its
# content and intersect it with model.

# Known issues:
#
# The model validity check will found invalid edges and faces on the next save.
# These seems impossible to remove from the model by the plugin.
#
# Horizontal faces should be avoided since the vertices are moved horizontally
# by the plugin and may be dragged over the face and interfere with its edges.

# Load support files.
require "sketchup.rb"
require "extensions.rb"

module EneCylCoords

AUTHOR      = "Julia Christina Eneroth"
CONTACT     = "#{AUTHOR} at eneroth3@gmail.com"
COPYRIGHT   = "#{AUTHOR} #{Time.now.year}"
DESCRIPTION =
  "Move all vertices inside selected group/component by letting the old X "\
  "represent a radius and old Y an angle. Useful for creating spiral shapes."
ID          =  File.basename __FILE__, ".rb"
NAME        = "Eneroth Cylindrical Coordinates"
VERSION     = "1.0.0"

PLUGIN_ROOT = File.expand_path(File.dirname(__FILE__))
PLUGIN_DIR  = File.join PLUGIN_ROOT, ID

ex = SketchupExtension.new(NAME, File.join(PLUGIN_DIR, "main"))
ex.description = DESCRIPTION
ex.version     = VERSION
ex.copyright   = COPYRIGHT
ex.creator     = AUTHOR
Sketchup.register_extension ex, true

end
