class Pointify
	def Pointify::start
	  # get the active model
	  model = Sketchup.active_model
	  #get currently selected objects
	  selection_set = model.selection
		vertices = []
		Sketchup.active_model.start_operation "Pointify edges"
		selection_set.each {|edge|
			if edge.typename == "Edge" then
				vertices = vertices + edge.vertices
			end
		}
		vertices.uniq!
		0.upto(vertices.length-1) do |i|
			Sketchup.active_model.active_entities.add_cpoint vertices[i]
		end
		Sketchup.active_model.commit_operation
	end #def
end #class
if( not $tooling_sub_menu )
	$tooling_sub_menu = UI.menu("Plugins").add_submenu("Qhull")
end
if( not $pointify_menu_loaded )
	$tooling_sub_menu.add_item("Pointify") { Pointify.start }
	$pointify_menu_loaded = true
end