Align Verts - With Constraints

Does anyone know of any script that aligns verts but constrains the 2 end verts of the selection. See image for better explanation.

Select a column of verts and have the first and last verts in the selection remain unmoved,(highlighted green in the image) but have the other verts (highlighted yellow in the image) align on the x,y or z, axis.

Thanks
JokerMartini

AttachmentSize
Align-Verts.jpg75.48 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Graph's picture

afaik, no but you can easily

afaik, no but you can easily write one if you know wich one the "outer verts" are, based on what rules they are supposed to be first and last in 3d space

like so:

(
 
 
	fn pointLineProj pA pB pC = --gets the closest point on a line to a point in space
	( 
		local vAB=pB-pA ; local vAC=pC-pA ; local d=dot (normalize vAB) (normalize vAC) ;
		return (pA+(vAB*(d*(length vAC/length vAB)))) ;
	)
 
 
	local firstVert = 3
	local lastVert = 23
	local vertsToAlign = #(18, 13, 8)
 
	local obj = $Plane013
 
	local vert1Pos = polyOp.getVert obj firstVert node:obj
	local vert2Pos = polyOp.getVert obj lastVert node:obj
 
	for v in vertsToAlign do
	(
		local vPos = polyOp.getVert obj v node:obj
 
		local tPos = pointLineProj vert1Pos vert2Pos vPos
 
		polyOp.setVert obj #{v} tPos node:obj
	)
 
 
)

Raphael 'Insanto' Steves
http://Graph.Net84.Net

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.