As a result of drawing something with more operations I am often left with overlapping elements. Since they overlap perfectly they usually go unnoticed. However, if I later try something like stretching a part of the drawling the helper elements that I've used often remain.
Is there a way to 'optimize' a drawing and remove such elements that don't contribute to the render of a layer ? Thanks!
Detect and unify overlapping elements ?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
- petevick
- Premier Member
- Posts: 392
- Joined: Tue May 19, 2020 9:34 am
- Location: North Norfolk coast UK
Re: Detect and unify overlapping elements ?
you can delete all duplicated lines by using Menu: Modify > Detect Duplicates
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Linux Mint 21.2 Cinnamon, Qcad Pro 3.29.6
Re: Detect and unify overlapping elements ?
I know, but this functionality currently will detect only complete duplicates, not partial ones.
Re: Detect and unify overlapping elements ?
Yes and no.
Yes: If you play with the tolerance you can catch a lot of partial duplicates.
No: I've to admit that that is a world with many unknown factors - I've still not figured out which mathematically rules are used for that function ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: Detect and unify overlapping elements ?
Hello,
Indeed, a feature that is missing for long.
Just as Husky ... I can't get my mind around the functionality of MD.
On top, I need that functionality to finish Tile2Hatch.
Overlapping, but also just touching.
Catch 22: Coding touching in-line hatch segments leads to a spacing of 0 and a zero is a Dot.
Large tolerances are no solution either.
This is even rather or very dangerous in complex designs!
In this example the horizontal is not selected by angle tolerance but by distance !!!
I presume 'angle tolerance' is for arc segments ... ?!
In Husky's example a value of 35 or so would select almost every entity.
'Overlapping elements' also means that only two ends overlap.
MD doesn't catch those.
'Unify overlapping elements' means they are converted to one single entity.
MD only selects those found by the fuzzy criteria.
One can erase duplicates found in one (too easy) click.
Unifying is something totally different.
Usually my approach is to transfer those found to a temporary layer.
Same with MZ.
Then I run OG/OC on copies and isolate dropouts (those not part of the poly)
OC will merge/unify some arc segments, OS can merge line segments.
After several recursive processing, back and forth, I get neat polys that explode to neat segments...
Then the human decides in what to keep and what to throw away.
In fact, I usually don't throw away much ... I rather isolate them ... The safest way so far.
Regards,
CVH
Indeed, a feature that is missing for long.
Just as Husky ... I can't get my mind around the functionality of MD.
On top, I need that functionality to finish Tile2Hatch.
Overlapping, but also just touching.
Catch 22: Coding touching in-line hatch segments leads to a spacing of 0 and a zero is a Dot.
Large tolerances are no solution either.
This is even rather or very dangerous in complex designs!
In this example the horizontal is not selected by angle tolerance but by distance !!!
I presume 'angle tolerance' is for arc segments ... ?!
In Husky's example a value of 35 or so would select almost every entity.
'Overlapping elements' also means that only two ends overlap.
MD doesn't catch those.
'Unify overlapping elements' means they are converted to one single entity.
MD only selects those found by the fuzzy criteria.
One can erase duplicates found in one (too easy) click.
Unifying is something totally different.
Usually my approach is to transfer those found to a temporary layer.
Same with MZ.
Then I run OG/OC on copies and isolate dropouts (those not part of the poly)
OC will merge/unify some arc segments, OS can merge line segments.
After several recursive processing, back and forth, I get neat polys that explode to neat segments...
Then the human decides in what to keep and what to throw away.
In fact, I usually don't throw away much ... I rather isolate them ... The safest way so far.
Regards,
CVH
Re: Detect and unify overlapping elements ?
That's why I was thinking of a brute force algorithm - select any element that does not change the render in model space when removed. I might try to hack something up on it, time permitting.
Re: Detect and unify overlapping elements ?
spaskalev,
Indeed the goal of whole my approach.
Left alone that deleting any element that does not change the render in model space by brute force ...
... won't detect and delete neither of two overlapping elements.
If only 'Detect and unify overlapping elements' was that easy.
What you are proposing is 'Remove Redundant' like what MD does not as mentioned in the 3e post.
I'm looking forward to it on the 'QCAD Developers and Contributors' forum.
I would be glad to help you there for the mentioned reasons.
Regards,
CVH
Indeed the goal of whole my approach.
Left alone that deleting any element that does not change the render in model space by brute force ...
... won't detect and delete neither of two overlapping elements.
If only 'Detect and unify overlapping elements' was that easy.
What you are proposing is 'Remove Redundant' like what MD does not as mentioned in the 3e post.
I don't want to discourage you, but knowing that scripting under QCAD can be very difficult,
I'm looking forward to it on the 'QCAD Developers and Contributors' forum.
I would be glad to help you there for the mentioned reasons.
Regards,
CVH