Thinking how to find edges in a Sketch which are 'open-ended' - e.g. see highlighted edges below.
[EDIT - not necessarily a Sketch Object, but maybe say a list of Edges]
1. The 2 end edges for the wire on the left
2. The edge within rectangle
3. After finding those 'open-end edges', they are removed, and find if there are still 'open-end edges
4. Now the remaining edge in the middle of the wire on the left is found 'open-end'
(and should be removed further then).
Thanks for any idea
Finding 'Open-end' Edges
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Finding 'Open-end' Edges
The edge on the right side with the point-on-object constraint is complicated, because it doesn't enforce to lie between the endpoints. While exactly this condition can be checked with straight lines, it can be a problem with arcs.
All three lines have the same set of constraints; are they all open-ended or none of them or only the lower two?
All three lines have the same set of constraints; are they all open-ended or none of them or only the lower two?
- Attachments
-
- SnipScreenshot-dd5eb8.png (6.37 KiB) Viewed 2628 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Finding 'Open-end' Edges
Thanks for bringing up this situation.chrisb wrote: ↑Fri Oct 01, 2021 5:33 pm The edge on the right side with the point-on-object constraint is complicated, because it doesn't enforce to lie between the endpoints. While exactly this condition can be checked with straight lines, it can be a problem with arcs.
All three lines have the same set of constraints; are they all open-ended or none of them or only the lower two?
In fact, for clarification, I assume all the edges with intersection would be broken up - like the topic 'Creating a Puzzle' by running Boolean Fragment in https://wiki.freecadweb.org/Part_Slice
Maybe I make an model based on your example...
So only the sector (or is it another term) on the top should remains.
Re: Finding 'Open-end' Edges
'Fragments' highlighted 'alternatively.
Re: Finding 'Open-end' Edges
Maybe alternatively, those edges which can enclose / form a face can remains, other to be discarded.
Re: Finding 'Open-end' Edges
Hi,
I do something similar with wires. You can use the vertex information , if a vertex occurence is 1 it must be a single ended edge. I guess you can use the vertex.isSame or some of the identity functions for comparing. I did it with creating a list of hashcodes. I dont know how sketches behave and if it creates a wire. But i guess you can use the vector information as well and calculate distances between the vectors, but it will be much slower if you have a big number of edges.
best regards jbi
I do something similar with wires. You can use the vertex information , if a vertex occurence is 1 it must be a single ended edge. I guess you can use the vertex.isSame or some of the identity functions for comparing. I did it with creating a list of hashcodes. I dont know how sketches behave and if it creates a wire. But i guess you can use the vector information as well and calculate distances between the vectors, but it will be much slower if you have a big number of edges.
best regards jbi
Re: Finding 'Open-end' Edges
That doesn't work for the example with the line endings on the arc from above.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- ragohix769
- Posts: 568
- Joined: Sat Jul 18, 2020 7:04 am
- Location: Rome - Italy
Re: Finding 'Open-end' Edges
Here are too some suggestions on how to approch the problem:
https://forum.freecadweb.org/viewtopic. ... 92#p527492
(IMHO, not yet solved, especially if you read the last message by me... The checker, IMHO, it's not so useful to find open vertex and helping closing where needed)
https://forum.freecadweb.org/viewtopic. ... 92#p527492
(IMHO, not yet solved, especially if you read the last message by me... The checker, IMHO, it's not so useful to find open vertex and helping closing where needed)
After #ElonMuskBuyTwitter I'm no more on Twitter, that's really enough
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same
=> Now you can find me here on #Mastodon: https://mastodon.uno/@opensoul - I hope more people do the same
Re: Finding 'Open-end' Edges
Thanks all for the suggestions
Not sorted out yet, though I am thinking to use Part.getSortedClusters (or Part.sortEdges ?), to check the first and last edges if they are closed, vertex are of single occurrence, isSame() may be useful ...
BTW, any idea how to use hashcodes ?
Thanks for any idea !
Not sorted out yet, though I am thinking to use Part.getSortedClusters (or Part.sortEdges ?), to check the first and last edges if they are closed, vertex are of single occurrence, isSame() may be useful ...
BTW, any idea how to use hashcodes ?
Thanks for any idea !