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.
@Anonymous 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.
@Anonymous 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?
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.
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.
@Anonymous 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.
Can't find what you're looking for? Ask the community or share your knowledge.