Hi Guys,
I have a large Image of Polygons generated in Matlab in SVG Format. I need to delete some paths which look like lines. have almost or 0 area. Any ideas how to do it. I have been struggling with it for a couple of days now. For the curious, the lines are Polygons which were perpendicular to the viewing direction, they have more than 2 Points, and i dont want them in my Image.
Also there are two Polygons one over the other. How do I handle them to make them one single one.
I have attached the file along. This is a small part of the larger Image. So deleting them manually is impossible.
Thanks a lot
--Nithin
Delete unwanted paths
Delete unwanted paths
- Attachments
-
- Polygon problem.svg
- (9.53 KiB) Downloaded 338 times
Re: Delete unwanted paths
Hello
Is there a chance for you that those polygons which are perpendicular to the view, assign them, in Mathlab, a different style (a different color or thickness of line)?
That in order to use the search command (Ctrl + F). When you search, for example the same color of objects, those are selected, and then erased.
After that, those duplicated paths can be proccesed (I believe). Just select them all and apply a boolean operation (maybe union, or intersection)... mmm ... well, they could disapear... so save before.
Greetings
Is there a chance for you that those polygons which are perpendicular to the view, assign them, in Mathlab, a different style (a different color or thickness of line)?
That in order to use the search command (Ctrl + F). When you search, for example the same color of objects, those are selected, and then erased.
After that, those duplicated paths can be proccesed (I believe). Just select them all and apply a boolean operation (maybe union, or intersection)... mmm ... well, they could disapear... so save before.
Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.
Re: Delete unwanted paths
Hi.
With such same attributes I can only think of a manual way.
You want to keep the closed paths on top and delete the rest, so
why not to select those first (Shift+Click on each, or if anything unselected, hold Alt and draw a line crossing the paths),
add a different fill to them, then use the find tab (Ctrl+F) and search style: "fill:#66c3ea" and delete those after.
Not sure how large the original file is, a few thousand paths can be selected in a day's time.
But if possible, I would also suggest Hulf's solution.
With such same attributes I can only think of a manual way.
You want to keep the closed paths on top and delete the rest, so
why not to select those first (Shift+Click on each, or if anything unselected, hold Alt and draw a line crossing the paths),
add a different fill to them, then use the find tab (Ctrl+F) and search style: "fill:#66c3ea" and delete those after.
Not sure how large the original file is, a few thousand paths can be selected in a day's time.
But if possible, I would also suggest Hulf's solution.
Re: Delete unwanted paths
Hi.
One method to "delete" all overlapping objects;
Make sure you are in object mode - ( F1 )
Select all ( Ctrl A );
Note the number of objects in the status field at the bottom of the Inkscape main window. (In your example file; 32 objects)
a. Perform Path union ( Ctrl + )
(Use the plus key on your numerical keypad)
( The objects is reduced to 1 in your file.)
b. Perform Path Break Apart ( Shift Ctrl K )
( The number of objects are now 14 )
To delete all the paths with (near) zero area a small python script in the form of an Extension would do the job.
Chime back if you want/need such a script.
RGDS
Ragnar
One method to "delete" all overlapping objects;
Make sure you are in object mode - ( F1 )
Select all ( Ctrl A );
Note the number of objects in the status field at the bottom of the Inkscape main window. (In your example file; 32 objects)
a. Perform Path union ( Ctrl + )
(Use the plus key on your numerical keypad)
( The objects is reduced to 1 in your file.)
b. Perform Path Break Apart ( Shift Ctrl K )
( The number of objects are now 14 )
To delete all the paths with (near) zero area a small python script in the form of an Extension would do the job.
Chime back if you want/need such a script.
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Delete unwanted paths
Hi Ragnar
Thanks for the Suggestion, and yes it would be of great help if you could write a python script for it. Also is it later possible to assign random colours to the Polygons after that.
What I observed is that is we unstroke then the area measured is Zero.
--Nithin
Thanks for the Suggestion, and yes it would be of great help if you could write a python script for it. Also is it later possible to assign random colours to the Polygons after that.
What I observed is that is we unstroke then the area measured is Zero.
--Nithin
Re: Delete unwanted paths
Hi Ragnar,
I found another way to solve the same. I put a Black background and create a 300dpi bmp file. Then run a BMP trace on it which create the Polygons. Thats good enough for me atleast for now.
But will have to do it on the large Image and check how it comes up. But still no clue with assigning random colours to the Polygons.
--Nithin
I found another way to solve the same. I put a Black background and create a 300dpi bmp file. Then run a BMP trace on it which create the Polygons. Thats good enough for me atleast for now.
But will have to do it on the large Image and check how it comes up. But still no clue with assigning random colours to the Polygons.
--Nithin
Re: Delete unwanted paths
Hi Ragnar,
In the large Image the edges are still creating the Problem. Is there a way to Export BMP without Antialiasing.
Thanks
--Nithin
In the large Image the edges are still creating the Problem. Is there a way to Export BMP without Antialiasing.
Thanks
--Nithin
Re: Delete unwanted paths
Hi Nithin.
Clever way of deleting the unwanted black parts!
To assign random colors to the polygons, Select all the objects - use Extension - Color - Randomize.
If this solves all your problems no need for an Extension?
RGDS
Ragnar
Clever way of deleting the unwanted black parts!
To assign random colors to the polygons, Select all the objects - use Extension - Color - Randomize.
If this solves all your problems no need for an Extension?
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Delete unwanted paths
Hi Ragnar!
Like, selecting all objects, that have "d without a z"?
Might be handy for some cases.
Let me add an extension idea just recently came to my mind -when thinking of how to visualize descriptive geometry construction, like for a tutorial in perspective:
an extension that would chew the z-order of all the objects, and put the objects into a jessyink bullet-point accordingly.
That way a construction could be followed literally step by step through a browser.
ragstian wrote:If this solves all your problems no need for an Extension?
Like, selecting all objects, that have "d without a z"?
Might be handy for some cases.
Let me add an extension idea just recently came to my mind -when thinking of how to visualize descriptive geometry construction, like for a tutorial in perspective:
an extension that would chew the z-order of all the objects, and put the objects into a jessyink bullet-point accordingly.
That way a construction could be followed literally step by step through a browser.
Re: Delete unwanted paths
Hi
Lazur;
The z-order of objects are determined by the position of the object in the SVG file where the first object in the file are of the bottom of the "z-stack"
No need to "strip" the order off as the object does not have a separate "z-order" property. I have not used Jessyink - could you copy & paste from Inkscape to Jessyink?
RGDS
Ragnar
Lazur;
an extension that would chew the z-order of all the objects, and put the objects into a jessyink bullet-point accordingly.
That way a construction could be followed literally step by step through a browser.
The z-order of objects are determined by the position of the object in the SVG file where the first object in the file are of the bottom of the "z-stack"
No need to "strip" the order off as the object does not have a separate "z-order" property. I have not used Jessyink - could you copy & paste from Inkscape to Jessyink?
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Delete unwanted paths
Jessyink is part of the regular inkscape extensions. Works quite ok and self explanatory but the "amateurish looking" bullet-points needs to be set one by one.
http://www.timteatro.net/2010/08/12/a-tutorial-introduction-to-jessyink-presentations-in-inkscape/.
http://www.timteatro.net/2010/08/12/a-tutorial-introduction-to-jessyink-presentations-in-inkscape/.