How can I use the "distance"?
num_knot = numKnots $ 1
seg_len = getSegLengths $ 1
num_seg = num_knot-1
for i=1 to num_knot do
(
pt1 = getKnotPoint $ 1 i
pt2 = getKnotPoint $ 1 i+1
knot_len = distance pt1 pt2
messageBox ((knot_len as string)+","+(seg_len[i+num_seg] as string))
)
why the"knot_len" was always equal to "1.73205"?and the"knot_len" is same.so I need help.
Comments
Who did use Base64 Image for Button?
global Logo_image = "...."
local ConvertClass = dotnetclass "system.convert"
local ImageClass = dotnetclass "system.drawing.image"
fn ConvertBase64StringToImage string =
(
bytearr = convertclass.FromBase64String string
memstream = dotnetobject "System.IO.MemoryStream" bytearr
DecodedImg = ImageClass.fromstream memstream
memstream.close()
DecodedImg
)
btn_image = ConvertBase64StringToImage Logo_image
button Align_Right width:45 height:45 image:#(btn_image, undefined, 1,1,1,1,1)
-----Why didn't the image show?
.
The knot_len depends of the position of the knots. If they are placed so the distance between them is always "1.73205" then you will see "1.73205" as knot_len value.
The seg_len will be the same as knot_len if all segments are straight lines(itheir type is Line not Curve).
Tools and Scripts for Autodesk 3dsMax
.
maybe...
pt2 = getKnotPoint $ 1 i+1
should return topt2 = getKnotPoint $ 1 (i+1)
, alsofor i = 1 to num_seg do
to avoid out of range.