Scaling an edge selection to a certian size?

Scaling an edge selection to a certian size?

Anonymous
Not applicable
242 Views
2 Replies
Message 1 of 3

Scaling an edge selection to a certian size?

Anonymous
Not applicable
I have an editable poly object with a loop of edges selected. I'm trying to set it's length to a new value, scaling the edges around a point. Does anyone have any suggestions on how to do this?

This code will select the loop and then return it's current length, but I'm not sure how to go about scaling it to match a specified value.

fn SelectLoop obj =
(
obj.buttonOp #SelectEdgeLoop
baSel = obj.GetSelection #Edge
total = 0.0
edgeCount = obj.GetNumEdges()
for i = 1 to edgeCount do
(
if baSel == true then
(
vert1 = obj.GetVertex(obj.GetEdgeVertex i 1)
vert2 = obj.GetVertex(obj.GetEdgeVertex i 2)
total += distance vert1 vert2
)
)
print (units.formatValue total) as string
)
0 Likes
243 Views
2 Replies
Replies (2)
Message 2 of 3

Steve_Curley
Mentor
Mentor
I don't think that will work. Your "length" is a sum of distances - a derived value - the only way to change the "length" would be to move the attached vertices which will, in turn, affect the length.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 3

Anonymous
Not applicable
Yes, that's essentially what I'm trying to do. Scale the edges up or down by a value to make them total a specific length.
0 Likes