How to find "wire not closed" problems?

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
kzembower
Posts: 4
Joined: Sat Jan 21, 2023 9:01 pm

How to find "wire not closed" problems?

Post by kzembower »

Hello, all,

I'm stuck with the 'wire not closed' error, and would like to fix it myself. I've found lots of links to this forum and others, with 'wire not closed' problems, but inevitably, someone just solves the problem for the OP without revealing how they found it (not just how they fixed it).

How do you find the problem area causing the 'wire not closed' error? So far, I've tried manual inspection, but all the points look connected to me. I've also tried moving the lines around, and seeing if anything comes undone, but without success. I've tried box-selection over intersections to select the vertices and choosing coincident constraints, but that didn't seem to do anything.

I'm deliberately not posting my file here, because I don't want someone to fix it for me just yet. I want someone to teach me how to fish. I'll post it later if I try to follow any suggestions and still can't find the problem.

Thanks for any help or advice you can provide.

-Kevin
User avatar
Roy_043
Veteran
Posts: 6457
Joined: Thu Dec 27, 2018 12:28 pm

Re: How to find "wire not closed" problems?

Post by Roy_043 »

chrisb
Veteran
Posts: 47988
Joined: Tue Mar 17, 2015 9:14 am

Re: How to find "wire not closed" problems?

Post by chrisb »

There is a lot of experience in it and you tried already some of the well known suspects.

One more is:
1st step: count the elements in the list and in 3D view
2nd step: if there are too many elements in the list, walk over them and chek for invisibles (more likely) or doubles (less likely).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 7281
Joined: Sun Mar 02, 2014 4:35 pm

Re: How to find "wire not closed" problems?

Post by drmacro »

As noted the Validate sketch tool is the "after the fact" tool.

The better workflow is to lay down the basic outline (Polyline tool is really good for this) and before applying dimensional constraints, try to "wiggle" the lines. If if any vertexes come apart, hit them with a coincident constraint. Then proceed to constrain further.

There was (not sure if it's still there) a "wiggle" macro in Addon manager. 8-)

Though I don't use the wiggle, it can cause a mess. I recommend the "better workflow" described above.
Last edited by drmacro on Sat Mar 18, 2023 5:50 pm, edited 1 time in total.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 47988
Joined: Tue Mar 17, 2015 9:14 am

Re: How to find "wire not closed" problems?

Post by chrisb »

drmacro wrote: Sat Mar 18, 2023 4:56 pm There was (not sure if it's still there) a "wiggle" macro in Addon manager. 8-)
It's ShakeSketch, but be warned! If you apply it too early in the process it destroys the complete layout, because it keeps only the existing constraints. So if you start with a reasonable polyline and use ShakeSketch, you can end with a completely scrambled set of lines which are just connected.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 7281
Joined: Sun Mar 02, 2014 4:35 pm

Re: How to find "wire not closed" problems?

Post by drmacro »

chrisb wrote: Sat Mar 18, 2023 5:46 pm
drmacro wrote: Sat Mar 18, 2023 4:56 pm There was (not sure if it's still there) a "wiggle" macro in Addon manager. 8-)
It's ShakeSketch, but be warned! If you apply it too early in the process it destroys the complete layout, because it keeps only the existing constraints. So if you start with a reasonable polyline and use ShakeSketch, you can end with a completely scrambled set of lines which are just connected.
Caveat added. 8-)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
kzembower
Posts: 4
Joined: Sat Jan 21, 2023 9:01 pm

Re: How to find "wire not closed" problems?

Post by kzembower »

Thanks so much to all who made suggestions. After a half dozen attempts with Validate Sketch, where I discovered overlapping lines, mostly, I finally got it to close.

I tried to fix my sketch with polylines, but I must have been doing something wrong, because, even though I thought I was getting an automatic constraint on endpoints, it seemed to only work correctly when I used individual straight line segments.

Oh, well... I'm unstuck now. Thanks, again, everyone.

-Kevin
drmacro
Veteran
Posts: 7281
Joined: Sun Mar 02, 2014 4:35 pm

Re: How to find "wire not closed" problems?

Post by drmacro »

kzembower wrote: Sat Mar 18, 2023 6:35 pm Thanks so much to all who made suggestions. After a half dozen attempts with Validate Sketch, where I discovered overlapping lines, mostly, I finally got it to close.

I tried to fix my sketch with polylines, but I must have been doing something wrong, because, even though I thought I was getting an automatic constraint on endpoints, it seemed to only work correctly when I used individual straight line segments.

Oh, well... I'm unstuck now. Thanks, again, everyone.

-Kevin
The polyline tool makes a new segment every time you click, so if you were tracing over what was there, you misunderstood what was being suggested.
The polyline tool automatically constrains the current segment to the next. The only one you have make sure of is the last vertex is constrained to the first.
Attachments
Peek 2023-03-18 15-01.gif
Peek 2023-03-18 15-01.gif (515.14 KiB) Viewed 277 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
mario52
Veteran
Posts: 4278
Joined: Wed May 16, 2012 2:13 pm

Re: How to find "wire not closed" problems?

Post by mario52 »

Hi
chrisb wrote: Sat Mar 18, 2023 5:46 pm you can end with a completely scrambled set of lines which are just connected.
after completely scrambled you can use Undo/Redo button as object normal

i upgrade with :

Code: Select all

FreeCAD.ActiveDocument.openTransaction(u"Shake Sketch")
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.
chrisb
Veteran
Posts: 47988
Joined: Tue Mar 17, 2015 9:14 am

Re: How to find "wire not closed" problems?

Post by chrisb »

To be clear: as helpful as Polyline is with its famous M key, it is not useful to correct a sketch.

Imagine you have drawn a polyline, and after finishing you don't end the sketch but want to move a corner. You click on the point, you move the mouse and the point doesn't follow. So you click again on the point and there you have already created a zero length line.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply