https://github.com/FreeCAD/FreeCAD/pull/3747
There are a few changes to CheckGeometry in the Shape Content panel.
The motivation for this PR is sometimes CheckGeometry shows incorrect values for the various subshape counts. See this topic for an example:
https://forum.freecadweb.org/viewtopic.php?f=22&t=48792
In the above referenced topic a shape with 20 faces is created with a python script, but when checked with CheckGeometry, OCCT says it has 19 faces. This issue is corrected by counting all the edges, vertices, faces, etc. and displaying that information rather than using the OCCT tool to do this. And, since FreeCAD will have more control over this process I have added some additional "advanced" information for each checked shape.
Different shape types might have different advanced properties shown, where relevant to that shape type.
The advanced properties can be disabled in the settings:
[PR 3747] CheckGeometry advanced properties shape content
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: [PR 3747] CheckGeometry advanced properties shape content
There are other discussions about shortcuts: https://forum.freecadweb.org/viewtopic.php?f=8&t=44973.
Yorik mentioned something very important:
So the shortcuts should not be discussed for each workbench separately.
Wrong topic!
Yorik mentioned something very important:
So the shortcuts should not be discussed for each workbench separately.
Wrong topic!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [PR 3747] CheckGeometry advanced properties shape content
Hey chrisb, I think you failed to post on the right topic.chrisb wrote: ↑Sun Jul 26, 2020 8:45 pm There are other discussions about shortcuts: https://forum.freecadweb.org/viewtopic.php?f=8&t=44973.
Yorik mentioned something very important:So the shortcuts should not be discussed for each workbench separately.
Could you also please move this one to 'Pull requests' subtopic ?
You can delete your post I quoted as well as this one from me, so everything stays clear.
Re: [PR 3747] CheckGeometry advanced properties shape content
I considered to remove my post, but that would have invalidated yours. And I don't like removeing other people's posts.
Done.Could you also please move this one to 'Pull requests' subtopic ?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: [PR 3747] CheckGeometry advanced properties shape content
Since it's in the development section now, of interest to developers:
There is a new function in Base::Interpreter() called runStringWithKey()
psCmd is python code in a string, e.g.: "print(key)"
key is the identifier of a python variable, e.g. "key"
key_initial_value is the value key will already have when examined by the python script, e.g. "value for a key"
would execute the script and print the value of key and reset it's value to 'new value', which will be the return value of runStringWithKey().
If there is a run time error when executing the script, runStringWithKey() will return key_initial_value, so that's a way of checking if there was an error, assuming the script modifies key. If there is a runtime error the key will not be modified even if the error happens after modification.
There is a new function in Base::Interpreter() called runStringWithKey()
Code: Select all
std::string runStringWithKey(const char* psCmd, const char* key, const char* key_initial_value);
key is the identifier of a python variable, e.g. "key"
key_initial_value is the value key will already have when examined by the python script, e.g. "value for a key"
Code: Select all
Base::Interpreter().runStringWithKey("print(key)\nkey='new value'\n","key","value for a key");
If there is a run time error when executing the script, runStringWithKey() will return key_initial_value, so that's a way of checking if there was an error, assuming the script modifies key. If there is a runtime error the key will not be modified even if the error happens after modification.