hehe :] this is actually fun!
the curve must be quite clean to make it a poly plane. But there is everything aboard to make it so:
CODE
{ // to make the curve flat
string $curveSel[] = filterExpand -sm 9;
select ($curveSel[0] + ".cv[*]");
move -a -moveY 0;
select $curveSel;
}
CODE
{ // to uniformly rebuid the curve
string $curveSel[] = filterExpand -sm 9;
rebuildCurve -ch 0 -rpo 1 -rt 0 -end 1 -kr 0 -kcp 0 -kep 1 -kt 0 -s 30 -d 3 -tol 0 $curveSel;
select $curveSel;
}
CODE
{ // to close the curve: // mind: this toggles closed/open
string $curveSel[] = filterExpand -sm 9;
closeCurve -ch 0 -ps 1 -rpo 1 -bb 0.5 -bki 0 -p 0.1 $curveSel;
select $curveSel;
}
Now it seems building the surface cannot be setup so easily:
CODE
{
string $curveSel[] = filterExpand -sm 9;
planarSrf -ch 0 -d 3 -ko 0 -tol 0 -rn 0 -po 1 $curveSel;
select $curveSel;
}
it can be performed this way, but at the first look it seems you have to adjust the Initial Tessellation Controls by yourself. I set U and V type to "Per Span # of Iso Params" and 10.
Now here is rayIntersect for Maya 7 (I have to admit feel bad about giving this around this way. But seems the autor didn't update it for Maya7 by now. This is still the one compiled by Naughty! credits to him too!). Its sometimes a bitch. If it refuses to work set it to autoload and restart maya.
rayIntersect always works with centimeters: so here a little helper:
CODE
global proc float toCm(float $curUnitValue)
{
string $unit = currentUnit -query -linear;
string $curUnitValueString = $curUnitValue;
string $centimeterString = convertUnit -fromUnit $unit -toUnit "cm" $curUnitValueString;
return substitute("cm", $centimeterString, "");
}
and now the fun part:
CODE
{
int $count = 1600;
string $polySel[] = filterExpand -sm 12;
if (size($polySel))
{
float $bboxMin[] = getAttr ($polySel[0] + ".boundingBoxMin");
float $bboxMax[] = getAttr ($polySel[0] + ".boundingBoxMax");
int $i;
int $hit = 0;
for ($i = 0; $i < $count; $i += $hit)
{
$hit = 0;
float $rPosX = rand($bboxMax[0], $bboxMin[0]);
float $rPosZ = rand($bboxMax[2], $bboxMin[2]);
if (rayIntersect -ip (toCm($rPosX)) 100 (toCm($rPosZ)) -di 0.0 -1.0 0.0 -q -i1 $polySel[0])
{
$hit = 1;
spaceLocator -p $rPosX 0 $rPosZ;
// refresh;
}
}
}
}
uncomment // refresh; to see it place the locators on your surface instantly 
I mean .. this is all messed up but put into a little UI and streamline it a little this can be as simple as a buttonclick.

1600 locators in curve. took less than 3 seconds.