• 0

# How do you get the perimeter length of a 3D polygon?

## Question

When you draw a 2D polygon it tells you the perimeter length in the object info window, as soon as you convert that into a 3D polygon it only tells you the Surface area and the perimeter length disappears

## Recommended Posts

• 0

Yes, so it seems. There is no "perimeter" for a 3D poly but surely the OI should report the actual "length" of one, shouldn't it?

Yes, yes: the sum of lengths of 3D edges...Do you really think that I don't have a script for quantifying this? Unfortunately Mr. NNA finds this too hard.

• 0

Hi Is there a workaround to get this infomation.Thanks

• 0

Well, a script is definitely a workaround.... The only good thing is that one can copy & paste the value. I wrote the original one to measure 3D-polys that were on the surface of DTMs and represented eg. walking paths.

Added handling of closed 3D-polys just now.

```PROCEDURE LengthOf3DPoly; { ? Petri Sakkinen 1995-2008 }

VAR
x, y, z, x1, y1, z1, x2, y2, z2, d, h, l, total : REAL;
n, i : INTEGER;
obHd : HANDLE;

BEGIN
obHd := FSACTLAYER;
IF GETTYPE(obHd) = 25 THEN BEGIN
n := GETVERTNUM(obHd)-2;
FOR i := 0 TO n DO BEGIN
GETPOLYPT3D(obHd, i, x1, y1, z1);
z := z+z1;
GETPOLYPT3D(obHd, i+1, x2, y2, z2);
d := DISTANCE(x1, y1, x2, y2);
h := z2-z;
l := SQRT(d^2+h^2);
total := total+l;
END;
IF ISPOLYCLOSED(obHd) THEN BEGIN
GETPOLYPT3D(obHd, i, x1, y1, z1);
z := z+z1;
GETPOLYPT3D(obHd, 0, x2, y2, z2);
d := DISTANCE(x1, y1, x2, y2);
h := z2-z;
l := SQRT(d^2+h^2);
total := total+l;
END;
END;
total := REALDIALOG('Length', NUM2STRF(total));
END;

RUN(LengthOf3DPoly);

```

• 0

Now that is a very clever & concise script !

Let it be an example to all ... ; )

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×