Wire not closed, gap finder tool?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
llll
Posts: 173
Joined: Fri Nov 12, 2021 1:56 am

Wire not closed, gap finder tool?

Post by llll »

Update: Sorry!! I didn't realise sketcher_validate sketch was the tool I should be using. Was using Part_ValidateSketch


Original post:
It's only ever come up automatically I think? The tool where it finds leaks in the geometry and you specify the minimum gap size? Not talking about Part_ValidateSketch, unless that tool does same thing without the GUI interface?

If this mystery tool doesn't turn up anything, is the last option to delete every line because there's a double-up of lines somewhere?

No file, just want to know the correct process to solve these types of problems.
Last edited by llll on Wed May 18, 2022 6:39 am, edited 1 time in total.
drmacro
Veteran
Posts: 8866
Joined: Sun Mar 02, 2014 4:35 pm

Re: Wire not closed, gap finder tool?

Post by drmacro »

What's wrong with Validate sketch?

In stubborn cases, open the sketch, disable a few dimensional constraints and wiggle the lines.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Wire not closed, gap finder tool?

Post by heda »

hm, gap in wire as in error when using sketches to pad/extrude?
not easy to understand the context from your post.

do not think there is a magic tool for that, validate sketch will find vertexes that are not connected but reasonably should be. for double lines, I would just go with arrow up/down in the sketch edit mode, and if one cannot see something getting marked, then it is probably an entity that is not needed because it is behind another entity, or it is too small so one should ask oneself why it is needed at all...

probably stings a bit, no harm intended though, but the advise is to seek ways in your own "modelling process" to minimize the likely-hood of ending up in these situations. (which one suppose your question really is about, but there is no way to understand your way of thinking and what trips your specific models from the post...)

one way can be to only start with geometric constraints, do not put a single dimensional constraint in, once all intended geometric constraints are there, run validate sketch for coincident points, and possibly run Macro_Shake_Sketch, then you will see what is still loose in the sketch and you can constrain things one by one to see the effects of each individual constraint (which btw imho is the best way to learn how to constrain sketch)

another way is that you code your own macro that looks for things that you often trip on and highlights that...

if you are talking about something else than sketches, well...
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Wire not closed, gap finder tool?

Post by Shalmeneser »

heda wrote: Tue May 17, 2022 11:15 am not easy to understand the context from your post.
...
if you are talking about something else than sketches, well...
I always have problem following @llll posts. :cry:
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Wire not closed, gap finder tool?

Post by chrisb »

As a first check count the elements in 3D view and in the elements list. If they don't match search further.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Wire not closed, gap finder tool?

Post by openBrain »

llll wrote: Tue May 17, 2022 8:52 am It's only ever come up automatically I think? The tool where it finds leaks in the geometry and you specify the minimum gap size? Not talking about Part_ValidateSketch, unless that tool does same thing without the GUI interface?
With Python, getting missing coincidences is a 2 step process :

Code: Select all

>>> App.ActiveDocument.Sketch.detectMissingPointOnPointConstraints(100) # launch the detection process, returns the number of missing constraints
3
>>> App.ActiveDocument.Sketch.MissingPointOnPointConstraints # get the missing coincidences found at the previous step
[(0, 2, 1, 2, 1), (1, 2, 0, 1, 1), (0, 1, 2, 2, 1)]
You also have access to open vertices :

Code: Select all

>>> App.ActiveDocument.Sketch.OpenVertices
[(-73.126801, 32.132565, 0.0), (-38.544666, 31.412102, 0.0)]
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Wire not closed, gap finder tool?

Post by mario52 »

Hi

this old macro Macro_Shake_Sketch Image as heda said

Description

Shake a sketch in order to discover its unconstrained parts. Enter edit mode for a sketch and launch the macro. The macro will add a random noise on all sketch points. The sketch is then solved, constrained parts will retain their position, free parts will move. Always run this macro on a copy of the original sketch.

But be careful working on a copy of your file because the macro "dismantles all" to display and you may need to start over.

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply