Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Polygon from distance between point

8 REPLIES 8
Reply
Message 1 of 9
antonijo
1570 Views, 8 Replies

Polygon from distance between point

Hy,

 

I need a lisp that creates a polygon of N points, so to enter a only the distance between these points, after choosing N points in the drawing for approximately creating polygons.

8 REPLIES 8
Message 2 of 9
Kent1Cooper
in reply to: antonijo


@antonijo wrote:

Hy,

 

I need a lisp that creates a polygon of N points, so to enter a only the distance between these points, after choosing N points in the drawing for approximately creating polygons.


If I understand correctly what you want, that's what the Edge option in the Polygon command does.

Kent Cooper, AIA
Message 3 of 9
antonijo
in reply to: Kent1Cooper

No, it is not an option Edge. I send an attachment.

Message 4 of 9
antonijo
in reply to: Kent1Cooper

I missed the mark a point between pt3 and pt4.

Message 5 of 9
Kent1Cooper
in reply to: antonijo


@antonijo wrote:

.... 

I need a lisp that creates a polygon of N points, so to enter a only the distance between these points, after choosing N points in the drawing for approximately creating polygons.

....

No, it is not an option Edge. I send an attachment.


[I had assumed you meant a regular polygon, such as the Polygon command makes.]  For irregular polygons with more than three edges, there are a mathematically infinite number of possible polygons with any particular sequence of edge lengths.  Even with the User giving points "for approximately creating" it, there would be unlimited slightly-different-shaped possibilities -- there can never be only one solution.  But a routine could possibly find one of the infinite possible solutions.  How do you imagine the steps involved?  What would the User be asked for, and in what sequence?

Kent Cooper, AIA
Message 6 of 9
antonijo
in reply to: Kent1Cooper

Maybe that the asked a number of points, then in the drawing determine the approximate position of the point (to help approximate direction) and then determine the distance between PT1 and PT2, PT3 and PT2, PT3 and pT4, ..... up to the given number of points.

This is an idea.

If there is another way and the goal is irregular polygon with given distance between point (mean pline with a certain length), is welcome.

Message 7 of 9
antonijo
in reply to: Kent1Cooper

Or that the first draft of an irregular closed polyline and then the lisp asks for distance from point to point and corrects the entire polyline.

Message 8 of 9
Kent1Cooper
in reply to: antonijo


@antonijo wrote:

Or that the first draft of an irregular closed polyline and then the lisp asks for distance from point to point and corrects the entire polyline.


That I can figure out a way to do.  See the attached, which seems to work in limited testing.

 

It adjusts the length of the first segment to the specified length in the original direction from the starting vertex to the second one.  Then it adjusts the length of the second segment to the specified length in the direction from the new location of the second vertex to the original location of the third vertex, which will almost always be a different angle than the second segment had originally.  And so on....  That means that if the roughed-out lengths are off by very much from the specified lengths, distortion of angles will accumulate, and the result could be quite different in shape from the original, and it may not be possible to get the last two segments to be the correct lengths.  [That may not be possible for other reasons, too, such as entry of some lengths that just don't add up.]

 

It would be possible for it to save all the original angles of the segments, and maintain those [except for the last two segments], if that would be a better approach.  That would also be subject to rather different results than might be expected in some situations.

 

But see what you think.

Kent Cooper, AIA
Message 9 of 9
antonijo
in reply to: Kent1Cooper

I have set a redefinition issue on the forum (Irregular room).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost