Pad doesn't 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
iplayfast
Posts: 38
Joined: Sat Sep 07, 2019 6:55 am

Pad doesn't work?

Postby iplayfast » Sat Sep 07, 2019 7:06 am

With your youtube tutorial (which I'm liking) https://youtu.be/C1JG6l1uIJw?t=1260 I ran in to a problem at 21 min. You are taking a copy of the master sketch and deleting the extra line, then padding it. The padding doesn't seem to work for me, and if I click ok, it says that the linked shape object is empty.
But if I go back to the copied sketch is there with proper constraints. Almost everything else works to that point. Has something changed?

Earlier in the video you pad from the master sketch (unamed at that point) and that worked ok for me. So it appears that the carbon copy worked, but isn't able to be padded.


Other little problems, setting the preferences Display marker size and colour don't appear to do anything.

Thanks for your help.

I'm using the release app image.
OS: Linux Mint 19.2
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.3)
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Pad doesn't work?

Postby kisolre » Sat Sep 07, 2019 9:18 am

Could you attach the file in that state? Where asking to Pad does not work? Is it possible that instead of deleting just one line you deleted all? If you hide the master scetch do you still see lines visible from the sketch with the Carbon copy?
User avatar
iplayfast
Posts: 38
Joined: Sat Sep 07, 2019 6:55 am

Re: Pad doesn't work?

Postby iplayfast » Sat Sep 07, 2019 2:33 pm

I'm sure I only deleted the line.
Tried saving, and it went through the motions, but nothing actually was saved. (oh correction it [bug]saved in the root directory instead of the directory that I opened[/bug], weird).

hiding the master sketch removes the line (as expected since it's not in the to-be-padded sketch).
clicking on the video link in my first message shows where it falls apart. Everything seemed proper up to that point.

From the python console:

>>> ActiveSketch = App.ActiveDocument.getObject('Sketch001')
>>> if ActiveSketch.ViewObject.RestoreCamera:
>>> ActiveSketch.ViewObject.TempoVis.saveCamera()
>>>
>>> Gui.SendMsgToActiveView("SaveAs")
>>> App.getDocument("Unnamed").saveAs(u"/home/chris/tutorial.FCStd")
>>> Gui.SendMsgToActiveView("Save")
>>> App.getDocument("Unnamed").save()
>>>

From the command line console:

[bug]App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
Show.TempoVis.isIn3DView error: Object has been removed from documentViewProviderSketch::setEdit: visibility automation failed with an error:
Traceback (most recent call last):
File "<string>", line 7, in <module>
File "/tmp/.mount_freecatHpNXG/usr/Mod/Show/TempoVis.py", line 118, in hide
self.modifyVPProperty(doc_obj_or_list, 'Visibility', False)
File "/tmp/.mount_freecatHpNXG/usr/Mod/Show/TempoVis.py", line 99, in modifyVPProperty
if not hasattr(doc_obj.ViewObject, prop_name):
<class 'RuntimeError'>: Object has been removed from document
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
Exception (Sat Sep 7 02:47:31 2019): Invalid constraint
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected[/bug]

The console did nothing when saving.
Attachments
tutorial.FCStd
(7.37 KiB) Downloaded 4 times
freedman
Posts: 980
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Pad doesn't work?

Postby freedman » Sat Sep 07, 2019 4:09 pm

I changed a dim on the box in sketch001 and that cleared the error. Not sure why it occured.
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Pad doesn't work?

Postby kisolre » Sat Sep 07, 2019 4:10 pm

On opening it gives "Failed to parse expression" which I suppose is because that constraint from the tutorial is named with spaces inside. Which is not valid if used for referencing in expressions. It also shows Sketch001 as invalid. Recomputing it fixes that. But why are constaints there not orange? They are normal constraints without expressions (which should have been created after carbon copy). Did you open them for editing and then pressed "Discard" button"
Then I tried to recreate that sketch by creating a new one and using carbon copy from the Master, deleting the extra line (and its constraint) and closing the sketch. I got an "Invalid constraint" exception. In the dependency graph the constraint to named master constraint still shows but in constraint list when editing sketch it does not. Attached is the file in that state.
Then I tried again from fresh file. I recomputed sketch001, renamed master constraint to "HeightOfBlock" without spaces and tried recreting sketch again - all works as expected. So it looks like carbon copy from sketch with named constraints with spaces in names creates something buggy.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17502 (Git)
Build type: Release
Branch: master
Hash: 9e203ddf016179cfd9f84acfb1f8651782ae213c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Bulgarian/Bulgaria (bg_BG)
Attachments
tutorial_kiss.FCStd
(13.08 KiB) Downloaded 1 time
User avatar
iplayfast
Posts: 38
Joined: Sat Sep 07, 2019 6:55 am

Re: Pad doesn't work?

Postby iplayfast » Sat Sep 07, 2019 5:10 pm

freedman wrote:
Sat Sep 07, 2019 4:09 pm
I changed a dim on the box in sketch001 and that cleared the error. Not sure why it occured.
I'm not able to change the dim in sketch001, it's greyed out.
I did change in the master, from 32 to 31, but that didn't get changed in the carbon copy (not sure if it's supposed to, is it strictly a copy or is it a reference).
User avatar
iplayfast
Posts: 38
Joined: Sat Sep 07, 2019 6:55 am

Re: Pad doesn't work?

Postby iplayfast » Sat Sep 07, 2019 5:21 pm

kisolre wrote:
Sat Sep 07, 2019 4:10 pm
On opening it gives "Failed to parse expression" which I suppose is because that constraint from the tutorial is named with spaces inside. Which is not valid if used for referencing in expressions. It also shows Sketch001 as invalid. Recomputing it fixes that. But why are constaints there not orange? They are normal constraints without expressions (which should have been created after carbon copy). Did you open them for editing and then pressed "Discard" button"
Then I tried to recreate that sketch by creating a new one and using carbon copy from the Master, deleting the extra line (and its constraint) and closing the sketch. I got an "Invalid constraint" exception. In the dependency graph the constraint to named master constraint still shows but in constraint list when editing sketch it does not. Attached is the file in that state.
Then I tried again from fresh file. I recomputed sketch001, renamed master constraint to "HeightOfBlock" without spaces and tried recreting sketch again - all works as expected. So it looks like carbon copy from sketch with named constraints with spaces in names creates something buggy.
Interesting. I was able to "mark for recompute" but I don't know how to actually do the recompute.
As far as I know, there are no named constraints in my original. The only naming was from the first sketch to "master" so no spaces involved.

I started deleting the CC and noticed that the master was grey now, with a new sketch001 under it. Deleted that and got a segfault.

Show.TempoVis.isIn3DView error: Object has been removed from documentViewProviderSketch::setEdit: visibility automation failed with an error:
Traceback (most recent call last):
File "<string>", line 7, in <module>
File "/tmp/.mount_freecatHpNXG/usr/Mod/Show/TempoVis.py", line 118, in hide
self.modifyVPProperty(doc_obj_or_list, 'Visibility', False)
File "/tmp/.mount_freecatHpNXG/usr/Mod/Show/TempoVis.py", line 99, in modifyVPProperty
if not hasattr(doc_obj.ViewObject, prop_name):
<class 'RuntimeError'>: Object has been removed from document
App::Document::recompute(): cyclic dependency detected
Exception (Sat Sep 7 13:15:07 2019): Invalid constraint
App::Document::recompute(): cyclic dependency detected
App::Document::recompute(): cyclic dependency detected
Exception (Sat Sep 7 13:15:28 2019): Invalid constraint
App::Document::recompute(): cyclic dependency detected
Program received signal SIGSEGV, Segmentation fault.
/tmp/.mount_freecatHpNXG/AppRun: line 12: 12528 Segmentation fault (core dumped) ${HERE}/usr/bin/FreeCAD "$@"

Could not actually find the coredump.
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: Pad doesn't work?

Postby kisolre » Sat Sep 07, 2019 6:10 pm

iplayfast wrote:
Sat Sep 07, 2019 5:21 pm
I was able to "mark for recompute" but I don't know how to actually do the recompute.
There should be a two round arrows icon in the toolbar (blue if something needs recompute) or use F5 keyboard button (which does now work here?!?!).
In Master sketch you have named constraint which is named "hight of block" - with spaces. such do not work very well. If used in expressions the parser cant distinguish if it is different variable. Same goes to "-" - is it minus sign or a dash?
When creating carbon copy all geometry and their relations/constraints are copied. But valued constraints values(lenght, angle, ...) are linked through ehpression to corresponding constraints in the linked sketch.
freedman
Posts: 980
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Pad doesn't work?

Postby freedman » Sat Sep 07, 2019 6:32 pm

There should be a two round arrows icon in the toolbar (blue if something needs recompute) or use F5 keyboard button (which does now work here?!?!).
The recompute icon only shows if the "file toolbar" is enabled.
User avatar
iplayfast
Posts: 38
Joined: Sat Sep 07, 2019 6:55 am

Re: Pad doesn't work?

Postby iplayfast » Mon Sep 09, 2019 4:47 am

kisolre wrote:
Sat Sep 07, 2019 4:10 pm
On opening it gives "Failed to parse expression" which I suppose is because that constraint from the tutorial is named with spaces inside. Which is not valid if used for referencing in expressions. It also shows Sketch001 as invalid. Recomputing it fixes that.
I finally understood what you meant and created a bug on this issue. You should not be able to name things with spaces in them if you can't parse the names with spaces in them. I think the spaces were the cause of all my problems, but the error message didn't seem to point to that.

https://www.freecadweb.org/tracker/view.php?id=4119