Maybe I misunderstood the task, but at least just for fun, I did a test â€¦ how do I imagine snapping on opengl points: (I have no idea influencing the performanceâ€¦)

```
class Tool_test_snapto_gl_points
###dirty!!###
def initialize
p_cloud = spiral_sphere( 1000 )
@segments = p_cloud.map{|p| p.transform!( Geom::Transformation.scaling(10) ) }
end
def onMouseMove(flags, x, y, view)
ph = view.pick_helper
ph.init(x, y, 10)
@picked = ph.pick_segment(@segments)
if( @picked && @picked >= 0 )
@point_to_draw = @segments[@picked]
end
view.invalidate
end
def draw(view)
view.tooltip = @picked.to_s if( @picked && @picked >= 0 )
view.draw_points( @segments, 5, 2, "peru" ) if @segments
view.line_width = 2
view.draw_points( @point_to_draw, 15, 4, "green" ) if @point_to_draw
end
#-----------------------------------------------------------------------------
# Borrowed from:
# Thomas Thomassen
# thomas[at]thomthom[dot]net
# TT_Lib2
def spiral_sphere( number_of_points, origin=ORIGIN )
t = Geom::Transformation.new( origin )
n = number_of_points
node = Array.new( n )
dlong = Math::PI * (3-Math.sqrt(5))
dz = 2.0/n
long = 0
z = 1 - dz/2
(0...n).each { |k|
r = Math.sqrt( 1-z*z )
pt = Geom::Point3d.new( Math.cos(long)*r, Math.sin(long)*r, z )
node[k] = pt.transform( t )
z = z - dz
long = long + dlong
}
node
end
# Thanks
#-----------------------------------------------------------------------------
end
Sketchup.active_model.select_tool(Tool_test_snapto_gl_points.new)
```