[solved] Merge multiple polylines into one large polyline

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
yetanotheruser
Active Member
Posts: 26
Joined: Sat Dec 30, 2017 2:49 pm

[solved] Merge multiple polylines into one large polyline

Post by yetanotheruser » Sat Dec 30, 2017 3:55 pm

Hello,

I am quite new on using QCAD and started by importing an SVG file that I previously created with Inkscape.
This SVG file contains two drawings, one consisting of 2 polylines (number 1 and 2 in the screenshot below), the other one of 5 polylines (number 3 to 7). Each polyline has a different color, so it's easy to see that the dawing consist of multiple polylines.
(Hint: right click the graphic and then choose show graphic or similiar to view it full-sized)
Image

For each of the two drawings I want to join the multiple polylines to one. So in the end I still want to have two drawings, but each drawing shall only consist of one polyline. I tried Draw - Polyline - Create From Segments but it didn't work, though the polylines in each drawing are close together / adjacent. I also tried with a larger tolerance like 50. Still no success.

I attached the dxf file and would highly appreciate any support on this.
Thanks!


Operating system: Windows 10 x64
QCAD version: Qcad Pro 3.19.2
Attachments
back.png
back.png (50.51 KiB) Viewed 930 times
back.dxf
(187.27 KiB) Downloaded 21 times
Last edited by yetanotheruser on Sun Dec 31, 2017 4:13 pm, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 5554
Joined: Fri Mar 30, 2007 6:07 am

Re: Merge multiple polylines into one large polyline

Post by andrew » Sat Dec 30, 2017 6:40 pm

The polylines (or at least some of them) are closed loops rather than segments. There are duplicate segments on top of each other. Take for example the red polyline in the middle. It starts in the center, goes to the right, to the center again, to the left and to the center again. That's why there are no connections between the segments.

yetanotheruser
Active Member
Posts: 26
Joined: Sat Dec 30, 2017 2:49 pm

Re: Merge multiple polylines into one large polyline

Post by yetanotheruser » Sat Dec 30, 2017 7:02 pm

andrew wrote:The polylines (or at least some of them) are closed loops rather than segments. There are duplicate segments on top of each other. Take for example the red polyline in the middle. It starts in the center, goes to the right, to the center again, to the left and to the center again. That's why there are no connections between the segments.
Thanks for the hint. For polyline 1 and 2 I set the closed property to false, then again used Draw - Polyline - Create From Segments.
So polyline 1 and 2 are now joined in one polyline. I tried the same (closed property = false, follow by Create From Segments) for the remaining polylines, but without success. Do you have any idea what I could do about these? And how did you see that the red polyline has a loop? Thanks!

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2098
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Merge multiple polylines into one large polyline

Post by Husky » Sat Dec 30, 2017 7:04 pm

Hello yetanotheruser - welcome to the QCAD forum.
yetanotheruser wrote:I tried Draw - Polyline - Create From Segments but it didn't work, though the polylines in each drawing are close together / adjacent. I also tried with a larger tolerance like 50. Still no success.
It can't work because gaps are not the problem. This shapes are not "clean" shapes what means they are overlapping in a few areas. This screenshot shows the situation of the lower left corner at the big shape.
Husky-2017.12.30-02.png
Husky-2017.12.30-02.png (11.15 KiB) Viewed 917 times
There is no routine which could mathematically solve the situation.

You need to clean the shape manually to get what you are looking for. Not a big deal but it needs to be done. :wink:
Work smart, not hard: QCad Pro

yetanotheruser
Active Member
Posts: 26
Joined: Sat Dec 30, 2017 2:49 pm

Re: Merge multiple polylines into one large polyline

Post by yetanotheruser » Sat Dec 30, 2017 7:23 pm

OK, so I checked again, found and removed an overlapping part between the white and the yellow curve (is there any easy way to see overlapping parts?. In the next step I tried to fix the problem that Husky showed. I found one end of the problem, but failed finding the other one. I also check the other lines, the have the same problem. I have no clue how I can clean this up though, not even finding the other end of it. What would be the best way to clean this up? Thanks!

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2098
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Merge multiple polylines into one large polyline

Post by Husky » Sat Dec 30, 2017 8:22 pm

yetanotheruser wrote:I have no clue how I can clean this up though, not even finding the other end of it. What would be the best way to clean this up? Thanks!
Is this drawing one part of a sewing pattern? If yes then there is no need to talk about 1/1000 mm accuracy, correct?

In this case I would trace the shape with a new polygon or spline - properly faster and exacter than overhaul the existent shape. Add a new layer / keep it active and trace the given shape. When you are done delete the layer with the old shape and you are ready to go.
Work smart, not hard: QCad Pro

yetanotheruser
Active Member
Posts: 26
Joined: Sat Dec 30, 2017 2:49 pm

Re: Merge multiple polylines into one large polyline

Post by yetanotheruser » Sat Dec 30, 2017 8:57 pm

Husky wrote:
yetanotheruser wrote:I have no clue how I can clean this up though, not even finding the other end of it. What would be the best way to clean this up? Thanks!
Is this drawing one part of a sewing pattern? If yes then there is no need to talk about 1/1000 mm accuracy, correct?

In this case I would trace the shape with a new polygon or spline - properly faster and exacter than overhaul the existent shape. Add a new layer / keep it active and trace the given shape. When you are done delete the layer with the old shape and you are ready to go.
Yes, you correctly recognized it and I think the idea to retrace it is likely the best one. I will do so, thanks :-)
btw, it's actually the back of a shirt (half of the back, as it gets cut out on the fabric fold)

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2098
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Merge multiple polylines into one large polyline

Post by Husky » Sat Dec 30, 2017 9:18 pm

You're welcome!
Work smart, not hard: QCad Pro

yetanotheruser
Active Member
Posts: 26
Joined: Sat Dec 30, 2017 2:49 pm

Re: Merge multiple polylines into one large polyline

Post by yetanotheruser » Sun Dec 31, 2017 4:04 pm

So, tracing was easy and worked fine. I traced in parts and then used Draw - Polyline - Create From Segments which also worked nice. However, when I now outset the polygon I am having troubles. I opened a new topic for the new problem: viewtopic.php?f=32&t=5323

Post Reply

Return to “QCAD 'How Do I' Questions”