*Edit... I cleaned up the code for readability and fixed the relationship between the divots and the ball. There was no point in leaving bad code (not that this is good... just less-bad), so I replaced my original post with the fixed code below...
try this script CA...
you can scale the ball to get an elongated glande, but the divots will also stretch. It's a start anyway...
========================================================
//=============
// Parametric Golf Ball
// Written for Curious Aardvark
//
www.slinging.org//
//
//=============
//User-Settable Parameters
//========================================
ball_dia = 42;
divot_dia = 5;
divot_depth = 1;
//divots around the equator of a golf ball = 30
numdivots_ring = 30;
// number of rings of divots between the equator and the pole of the ball... total number of actual rings is 2*numrings+1
numrings = 6;
//Calculated Parameters - Do not change
//========================================
ball_rad = ball_dia/2;
divot_rad = divot_dia/2;
//virtual surface radius where the divot beads go
divot_surface_rad = ball_rad+divot_rad-divot_depth;
//angle between divot beads
angle_increments= 360/numdivots_ring;
$fn = 50;
module main()
{
difference()
{
positives();
negatives();
}
//This next line is just for visualization of how the divots are made... should be commented out most of the time
//%negatives();
module positives()
{
sphere(d=ball_dia);
}
module negatives()
{
for(j=[0:numrings])
{
working_ring_rad = divot_surface_rad*cos(j*90/(numrings+1));
ring_distance_from_center = divot_surface_rad*sin(j*90/(numrings+1));
numdivots_ring = floor(3.14159*2*working_ring_rad/divot_dia);
angle_increments = (360/numdivots_ring);
rotate([0,j*angle_increments/2,0])
for(i= [0:angle_increments:360])
{
//divots on right side
translate([0,ring_distance_from_center,0]) rotate([0,i,0]) translate([divot_surface_rad*-cos(j*90/(numrings+1)),0,0]) scale([1,1,1])sphere(d=divot_dia);
//divots on left side
translate([0,-ring_distance_from_center,0]) rotate([0,i,0]) translate([divot_surface_rad*-cos(j*90/(numrings+1)),0,0]) scale([1,1,1])sphere(d=divot_dia);
}
}
//cap the two ends with a single divot
translate([0,divot_surface_rad,0]) sphere(d=divot_dia);
translate([0,-divot_surface_rad,0]) sphere(d=divot_dia);
}
}
scale([1,1,1]) main();