Drawing a rectangle inside a complex polyline using the "main four acute angles"

Drawing a rectangle inside a complex polyline using the "main four acute angles"

Anonymous
Not applicable
1,369 Views
8 Replies
Message 1 of 9

Drawing a rectangle inside a complex polyline using the "main four acute angles"

Anonymous
Not applicable

Hello everyone,

 

Drawing a rectangle inside a complex polyline using the "main four acute angles" that are curving to the side of closing the polygon. It does not matter if the new rectangle are crossing the original complex polyline boundaries.

 

 

My goal is to classify  the polyline segments in three categories (front, lateral and back) where the front side (that can be more than one when is in the corner) will be the segments closest to the orange polyline, the opposite side normally will be the back and others will be lateral sides. Check before and after images.

 

Tips, references and clues are welcome.

 

Thanks in advance + regards,

Lzucco

0 Likes
1,370 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant

"Rectangle" is not the right word, nor is "acute."  If you mean "quadrilateral," you need to decide what you really want -- your right-most example has five  sides/angles.  And only one of its angles might be acute [it looks like it could be a right angle].  All the examples also contain obtuse  angles.

 

But once that is cleared up, what do you mean by "classify the polyline segments"?  Do you want to mark them in some way in the drawing?  Put some kind of listing into a text or spreadsheet file, or a Table in the drawing?  Something else?

Kent Cooper, AIA
0 Likes
Message 3 of 9

Anonymous
Not applicable

Thanks for the interest on helping me.

 

Indeed it's difficult to identify as a rectangule using acute angles, but it was the way I found to say. But, you are right. Sorry for that. Sometimes the main angles to form the quadrilalateral will be five, sometimes four... Well, the important factor is to identify which one are the most importants that are making the form to close the polyline.

 

What do I want is to create a list that will have each coordinate and the category of it until the next vertice and so on.

0 Likes
Message 4 of 9

Anonymous
Not applicable

What do I want is to create a list that will have each coordinate and the category of it until the next vertice and so on.

I have posted categories.png image to explain it better.

0 Likes
Message 5 of 9

ВeekeeCZ
Consultant
Consultant

Using C3D's Simplify Drawing Cleanup Tool with tolerance set to 3 (or experiment yourself) I got almost the same result as you wanted.

Some manual check would be necessary, but considering plenty of dev-time saved you can do that in detail.

Message 6 of 9

Anonymous
Not applicable

Great for the drawing rebuilding, especially on the polygons with more than 4 vertex (using tolerance 5). It is possible to use MAPCLEAN simplify objects inside a LISP routine?

 

But, still missing the categorization part. Anyway, I already have some ideas of how to do it.


Many thanks

0 Likes
Message 7 of 9

Anonymous
Not applicable

I have figured out how to create a .dpf file. It's just SAVE the selection on the MAPCLEAN screen box.

(command "_-mapclean" "lead.dpf")

Now, how to also filter the selection to get only polyline with more than 4 vertices?

0 Likes
Message 8 of 9

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... how to also filter the selection to get only polyline with more than 4 vertices?


 

I don't know whether this will be usable in conjunction with MAPCLEAN, but in AutoLisp terms:

 

(setq ss (ssget '((0 . "LWPOLYLINE") (-4 . ">") (90 . 4))))

 

But be aware that if you have any 4-sided Polylines that are not "closed"  in AutoCAD's meaning of the word, but only "visually" closed, i.e. drawn around with a last vertex picked in the same place as the first, they will be "found" by that code, because they'll have 5 vertices.

Kent Cooper, AIA
Message 9 of 9

Anonymous
Not applicable

Thanks Kent,

 

I couldn't manage to include the "number of vertex" filter inside the .dpf file. So, I handle this issue allowing the "_-mapclean" command to do it's job on all polylines of the selected layer and after that deleting the polylines with 4 vertices or less.

 

Now I'm working on the categorization of the polyline segments.

 

Best regards

 

0 Likes