Jump to content
  • 0
Sign in to follow this  
Alan w

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

Share this post


Link to post

4 answers to this question

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.

Share this post


Link to post
  • 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); 

Share this post


Link to post

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.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...