Implementing a specific algorithm - doable or not?

Implementing a specific algorithm - doable or not?

Anonymous
Not applicable
461 Views
4 Replies
Message 1 of 5

Implementing a specific algorithm - doable or not?

Anonymous
Not applicable

Hello to all,

 

unfortunately I couldn't be more specific in the subject, so I'll try to be in the post. I have only written some basic AutoLISP scripts so far, so I'm not really sure if one could implement the following procedure in a simple way. The procedure is basically this:

 

1) get a specific point P1 from the user, where P1 lies on a polyline P which exists in a drawing

2) given P1, draw the line of a specific length (also given by the user) to another point P2 on the same polyline

3) P1 and P2 define a line L1, and let P3 be a point with a fixed constant distance to L1

4) place a block B so that the distance between a reference point P4 on the block and the point P3 is minimized (this could in principle be done

iteratively) - also, the block B can be placed only so that it is constrained with respect to the polyline P (for example, one of the block's lines

are always tangent to P, so the block B can only be "rotated along" the polyline P)

 

I'm interested if this type of problem could be solved with AutoLISP / Visual Lisp. I assume so, but I don't really have the feeling how complicated this is. The application of this problem is to cover certain spans with beams which need to be placed on head beams, but these beams should folow the

polyline P in a "secant"-manner, since the spans which need to be covered are following a curve defined by P.

 

Certainly this is easily done by simply drawing, but I would like to know if such a procedure could be automatized in general.

 

Thanks in advance for any advice.

 

 

 

 

 

 

 

0 Likes
462 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

It probably could, but clarify something for me:

 

>>  3) P1 and P2 define a line L1, and let P3 be a point with a fixed constant distance to L1

 

No point has "a fixed constant distance to" a line unless it's infinitely far away.  Can you describe that differently, or attach an image or drawing showing what you mean?

Kent Cooper, AIA
0 Likes
Message 3 of 5

Anonymous
Not applicable

You can think of P3 as a part of a block composed of L1 and P3. I tried to make things simpler by considering only points, lines and their constrained relations, but basically we could talk about blocks all the time. I.e., I could reformulate the problem:

 

Given a polyline P on the drawing, and some arbitrary point T on it, place a block B (whose shape is rectangular, and which contains a point of importance to us in its interior, for example, girder bearings - denote this point PT1) on P fo that one side of the rectangular outline of B is secant to P. This is now fixed. Then, take another block B1 (whose shape is also rectangular, but also contains some interesting interior point PT2). This block B1 can be only tangent to the polyline P (i.e. one of its sides is always tangent to P, so basically it can only "rotate along P" - this is its constrained "motion").

 

The problem is: Place B1 so that the distance from PT1 (contained in B) to PT2 (contained in B1) is minimized.

 

I hope this is less confusing now. I didn't have the time to make sketches yet.

 

 

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

I will await an image, but in the meantime:

 

Is the idea that Blocks B and B1 do not overlap?  Obviously, if the insertion points of both Blocks are at the point along their Polyline-side edge that's closest to their internal Point, the distance from PT1 to PT2 would be minimized if the two Blocks were both Inserted at T, but they would presumably then overlap, and I kind of assume that's not allowed.

 

Do these ever go along arc segments in P, or only line segments?  If line segments only, might they ever need to be around a corner from each other?

Kent Cooper, AIA
0 Likes
Message 5 of 5

Anonymous
Not applicable

I finally found the time to draw an image, sorry I didn't do this earlier.

 

So, in the image, the polyline is white, the girder is green, and the head beam on which the girder should be placed is red. Now, the point P1 is chosen by the user. The girder block should then be placed in a "secant" manner on the polyline, as displayed in the image. Then, the problem is to find the location of the red head beam so that the green "X"-points on the beam should be as much centrally as possible placed on the two red bearing pillows on the head beams. For example, in the image this is no optimal arrangement - the left bearing point "X" is OK, but the right one looks a bit off. Now, the important constraint on the red head beam is that its axis, the cyan line, should always be perpendicular to the polyline. Further on, the head beam can also be moved in the radial direction, i.e. shifted in the direction of its axis. So, we have two possible motions to minimize the wanted bearing points distance - a "rotational" motion (in case the polyline is a curved segment, as I have chosen to display on the image), amd a "radial" motion, in the direction of the cyan axis of the head beam. Also, the geometry of the head beam, specially the position of the rectangular bearing pillows is fixed.

 

I hope the problem is presented in a more clear manner now.

 

P.S. In general, the green girder and the red head beam are blocks (possibly dynamic blocks). Also, it would be great if the length of the green girder could also be provided as user input.

 

Clipboard01.jpg

0 Likes