[sketcher] How do CloseShape and ConnectLines features work?

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!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[sketcher] How do CloseShape and ConnectLines features work?

Post by uwestoehr »

Today I wanted to try out this sketcher feature: https://wiki.freecadweb.org/Sketcher_CloseShape but can't get it to work.

Here is my use case:
FreeCAD_jztQaL4DNJ.png
FreeCAD_jztQaL4DNJ.png (4.94 KiB) Viewed 1790 times
Sketch-close-bug.FCStd
(6.37 KiB) Downloaded 20 times

When I select the endpoints of the polyline and use the feature, I get an over-constrained sketch but nothing changed visible.
The same is when I select a point of the polyline and the single line.
The same is when I select both points of the single line.

Using the same testfiles with the ConnectLines feature, https://wiki.freecadweb.org/Sketcher_ConnectLines I get no success.

Do I do something wrong and if yes, what is my mistake?

abdullah wrote: .

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.26457 (Git)
Build type: Release
Branch: master
Hash: 563743e7e657321ae4e02eeeb9af83e378903e4e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by chrisb »

As far as I understand the docs you should select unconnected elements.. That works here.

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.26375 (Git)
Build type: Release
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: C/Default (C)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by chrisb »

I have added to the wiki.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by uwestoehr »

chrisb wrote: Mon Nov 22, 2021 10:14 pm As far as I understand the docs you should select unconnected elements.. That works here.
Do you have a screencast for me? Here is mine:
towxqh52Vn.gif
towxqh52Vn.gif (92.19 KiB) Viewed 1710 times
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by Roy_043 »

You need to remove existing Coincident constraints and select edges not points. The selection order, and the direction of the edges determines the result.
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by chrisb »

uwestoehr wrote: Mon Nov 22, 2021 11:25 pm Do you have a screencast for me?
Do you still need the screencast after Roy's comment? Except for the upper left lines are your elements connected to other elements.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by uwestoehr »

Roy_043 wrote: Tue Nov 23, 2021 8:33 am You need to remove existing Coincident constraints and select edges not points. The selection order, and the direction of the edges determines the result.
Shame on med :oops: I still don't get it to work:

- I just created a polyline and now I want to close it
- so I select now the two edges that should be connected, but this fails:
FreeCAD_pcPGipOxNC.png
FreeCAD_pcPGipOxNC.png (14.55 KiB) Viewed 1554 times
- as next try, I thought I can use the single line to close the polyline
- so i selected these 3 edges
FreeCAD_fwuDuw91E4.png
FreeCAD_fwuDuw91E4.png (11.19 KiB) Viewed 1554 times
But this is the result:
FreeCAD_o3XpR9pnB2.png
FreeCAD_o3XpR9pnB2.png (7.22 KiB) Viewed 1554 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by uwestoehr »

Next try:

- maybe one has to select the whole polyline to get it closed:
tL2cmAUUaR.gif
tL2cmAUUaR.gif (72.78 KiB) Viewed 1553 times

So I still don't get it closed.

A screencast would help me much.

However, since I fail embarrassingly I think the feature should either be improved somehow or better documented.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by Roy_043 »

There should not be any existing coincident constraints. So starting from a polyline does not make sense.
You should select all edges of the shape you want to create. And since the selection order is important you should select the edges one by one.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [sketcher] How do CloseShape and ConnectLines features work?

Post by uwestoehr »

Roy_043 wrote: Tue Nov 23, 2021 7:32 pm There should not be any existing coincident constraints. So starting from a polyline does not make sense.
You should select all edges of the shape you want to create. And since the selection order is important you should select the edges one by one.
many thanks! So a polyline cannot be closed this way. I will add this info to the Wiki.

I now also get why the box selection fails. The lazy guy I am I use this selection method the most (to save clicks) therefore I did not come to the idea to select all segments with each a click.

However, now that I understand the feature, for me the main issue is that one does not know the direction of the lines in advance, so one often needs to undo and select in another order to get the desired result.
I assume there is no easy way to improve this.
Post Reply