View Single Post
Old 4th December 2013, 10:55 PM   #8
jentron
Senior Member
Professional user
 
Join Date: Nov 2007
Posts: 139
Default Re: Request: Extrude in parallel

I think the math below will do the extrusion we're after, I just need to figure out how to write an Ac3d plug-in to do the work, after looking at the tcl commands available I don't think its sufficient to do much of anything.

Code:
d = distance to extrude, scalar
N[] //surface (plane) normal, vector

M[] // vertex normal vector, average (bisector) of adjoining plane normals
V0 // original vertex location, point
Vs // transformed vertex location, point

// Should replace V0 with average of all surface points?
Ps = V0+dN[] //transform point on surface vector math, point

// Helper variables

// k can live for the whole surface
k = N[x]Ps[x]+N[y]Ps[y]+N[z]Ps[z]

// t must be calculated per vertex
t=(k-N[x]V0[x]-N[y]V0[y]-N[z]V0[z])/(N[x]M[x]+N[y]M[y]+N[z]M[z])

// Vs new vertex location
Vs[x] = V0[x] + tM[x]
Vs[y] = V0[y] + tM[y]
Vs[z] = V0[z] + tM[z]
jentron is offline   Reply With Quote