Ask Your Question
1

Create a polygon form line intersection (Draw) [closed]

asked 2014-05-08 18:34:54 +0200

Alan2 gravatar image

updated 2014-05-09 23:39:25 +0200

How to get a poligon from intersecting lines?

I have tryed the shape->intersect but it behaves completly unpredictably with lines. All the tutorials on the net used full 2d objects like intersecting two circles etc...

The image explains it better.

image description

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-03 17:14:52.366399

1 Answer

Sort by » oldest newest most voted
1

answered 2014-09-10 00:15:53 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello, I just read this question. For my own purposes I wrote a quite complex macro to . intersect any lines in a drawing . create the polygons and give different colors to the Polygons (to be clearer, to the created polypolygonshapes PPS) (the color depends on, how many adjacent PPS the polygon has)

The question, when you intersect any number of lines, is quite complex. (example: if you have another polygon INSIDE the first one, you have to take care, that the color has to be different)

So my question: is your problem still open?

If yes, I am open to answer your question / specification (Think, it took me months to have the macro, as it is now

10/09/2014: following the administrators comment and my short reply I extend my answer:

my macro contains several different geometrical problems/ideas. The code is not beautyfied and would be a bad example presently. and it is about 3.000 loc. So I do not want to post it. I try a better description. Take a drawing. place a lot of lines (presently up to 100) the macro reads all lines, computes all intersections (and deletes lines, which have only one (1) connection line) now you may have up to 1.500 lines then the algorithm is searching all closed polygons and for each creates a polygonshape the shapes can have a different number of edges (triangle, square, polygons with n lines) each shape gets a colour depending on the number of edges and so, that adjacent shapes have different color

this works, but there are a lot of open questions, in which scenario you would like to run such an idea/macro. so it is presently not generlly usable. to illustrate it a little bit: sorry: i tried to create an image. LO --> export to jpeg. but here the inclusion of an image AND the upload fail. both give me the dialog to select the file, but the filename is not transferred to the corresponding field in the upload-dialog. sorry

edit flag offensive delete link more

Comments

@JohannF, please edit your answer to include the indicate detail (or upload / link to the macro). This would be a great help. The question is still open. Thanks.

oweng gravatar imageoweng ( 2014-09-10 05:24:46 +0200 )edit

my macro contains several different geometrical problems/ideas. The code is not beautyfied and would be a bad example presently. and it is about 3.000 loc. So I do not want to post it. I try a better description by expanding my response

JohannF gravatar imageJohannF ( 2014-09-10 09:17:59 +0200 )edit

Thanks @JohannF. That does sound complex and I am unsurprised at the size of the code.

oweng gravatar imageoweng ( 2014-09-10 10:31:59 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-08 18:34:54 +0200

Seen: 683 times

Last updated: Sep 10 '14