Message 1 of 3
Scaling an edge selection to a certian size?

Not applicable
10-30-2009
09:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
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
)