Here is my solution, works well, but only with quads, connect a grid into the 0 input of a primitive wrangle://Vex 'extrude' function...Only works with 4 sided faces!!!
//pick a polygon face/primitive
int index = chi("Primitive_Index");
//this array will hold newly created points
i[]@newpt_list;
//let's extrude the selected primitive (using Primitive
//Index we created above)
if(@primnum == index){
//set selected prim color to white - just a visual aid
@Cd = {1,1,1};
//primpoints function gives us all the connected
//points, as index values
i[]@conn_pts = primpoints(0,@primnum);
//let's run through this points list, and then
//create a new point above them
foreach (int pt;@conn_pts) {
//get the connected points position vector
vector curr_pos = point(0,"P",pt);
//create an offset vector, this will be our extrude amount
vector offset = set(0,chf("offset"),0);
//calculate the new position, adding old pos with offset
vector new_pos = curr_pos + offset;
//create a new point at this new position vector
int newpt = addpoint(geoself(),new_pos);
//add the new point index to an array, will need these indexes
//to create the top and side faces
append(@newpt_list,newpt);
}
//create the 'side' poly faces - this bit needs more 'elegance'
addprim(0,"poly",@conn_pts[3],@newpt_list[3],@newpt_list[2],@conn_pts[2]);
addprim(0,"poly",@conn_pts[2],@newpt_list[2],@newpt_list[1],@conn_pts[1]);
addprim(0,"poly",@conn_pts[1],@newpt_list[1],@newpt_list[0],@conn_pts[0]);
addprim(0,"poly",@newpt_list[0],@newpt_list[3],@conn_pts[3],@conn_pts[0]);
//remove the original prim face
removeprim(geoself(),@primnum,0);
//create the new 'top' poly face
addprim(0,"poly",@newpt_list);
}
//color non-selected prims blue, visual aid
else{
@Cd = {0,0.5,1};
}
...well, it works...the tricky bit is creating the 'side' faces...if you know the extruded poly is a quad, you can 'cheat' by creating the faces in a predefined order:
//create the 'side' poly faces - this bit needs more 'elegance'
addprim(0,"poly",@conn_pts[3],@newpt_list[3],@newpt_list[2],@conn_pts[2]);
addprim(0,"poly",@conn_pts[2],@newpt_list[2],@newpt_list[1],@conn_pts[1]);
addprim(0,"poly",@conn_pts[1],@newpt_list[1],@newpt_list[0],@conn_pts[0]);
addprim(0,"poly",@newpt_list[0],@newpt_list[3],@conn_pts[3],@conn_pts[0]);
However, the code will break if the extruded face has more or less than 4 points...
The code that works for any n-gon will be something like:
1)calculate how many new points were created, say 'total points'
2)for i in the range of newly created points:
3)create a polygon(@conn_pts,@newpt_list,@newpt_list,@conn_pts....
4)and then the 'exception': create a polygon(@newpt_list,@newpt_list,@conn_list,@conn_pts