[Solved] Ticket #4095 - OpenSCAD Analysis Geometry for Errors

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!
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

[Solved] Ticket #4095 - OpenSCAD Analysis Geometry for Errors

Postby keithsloan52 » Tue Aug 20, 2019 6:30 am

I cannot get the OpenSCAD workbench function Analysis Geometry for Errors to work.

The same facility is in Part Workbench which also does not work for me.

Please could somebody check if they also have the problem before I report as a regression.

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.3.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Last edited by Kunda1 on Sun Oct 20, 2019 11:02 pm, edited 2 times in total.
Reason: Marked this thread as [Solved]
kisolre
Posts: 1360
Joined: Wed Nov 21, 2018 1:13 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby kisolre » Tue Aug 20, 2019 7:27 am

Could you elaborate? "Does not work" has no meaning out of context. Do you get an error? What does it say? Do you expect there to be errors but non is found? Does it happen with a specific object?
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

"Analyze Geometry for Errors" facilty in Part and OpenSCAD workbench

Postby keithsloan52 » Tue Aug 20, 2019 7:59 am

kisolre wrote:
Tue Aug 20, 2019 7:27 am
Could you elaborate? "Does not work" has no meaning out of context. Do you get an error? What does it say? Do you expect there to be errors but non is found? Does it happen with a specific object?
Does not work means I select an object and click on the icon and nothing works, just dims screen, all work bench go grey.
Try it on any object,

I even tried it on New Document, Activate Part Workbench, Add a Cube, Select Cube.Try analyze Geometry for Errors icon

No error message
Nothing in Python console
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby keithsloan52 » Sat Sep 07, 2019 4:05 pm

Think I may have tracked down the problem. Think It is failing when the Shape is null. i.e. It fails to first check if the Shape is null and report it as null and hits problems trying to analyse a null shape
openBrain
Posts: 2183
Joined: Fri Nov 09, 2018 5:38 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby openBrain » Sun Sep 08, 2019 11:42 am

keithsloan52 wrote:
Sat Sep 07, 2019 4:05 pm
Think I may have tracked down the problem. Think It is failing when the Shape is null. i.e. It fails to first check if the Shape is null and report it as null and hits problems trying to analyse a null shape
Especially because you open a ticket, could you please determine a clear step-by-step process to reproduce the problem ?
I have same setup as yours and can't reproduce.
Also could you precise what is a null shape ? A box isn't one... Also if nothing is selected, the "Analyze geometry" icon is greyed out.
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby keithsloan52 » Sun Sep 08, 2019 12:38 pm

openBrain wrote:
Sun Sep 08, 2019 11:42 am
keithsloan52 wrote:
Sat Sep 07, 2019 4:05 pm
Think I may have tracked down the problem. Think It is failing when the Shape is null. i.e. It fails to first check if the Shape is null and report it as null and hits problems trying to analyse a null shape
Especially because you open a ticket, could you please determine a clear step-by-step process to reproduce the problem ?
I have same setup as yours and can't reproduce.
Also could you precise what is a null shape ? A box isn't one... Also if nothing is selected, the "Analyze geometry" icon is greyed out.
Easier said than done.

I hit the issue when trying to develop code. Because my code is not correct I get an error reported on an Object.
If I try and use the check geometry tool on the object and it has null shape the system locks out.
When I added code to check if the Shape was null i.e print(obj.Shape.isNull() it prints out True
What is needed is that the check geometry tool performs a check by calling isNull before reporting
on the geometry. or informing the Shape is null.

I cannot save the state in a FreeCAD file as when I try subsequently to open the file the Object does not appear as it was saved with a null Shape
and the reloaded file whilst it does not contain a valid Shape it has been reset and no longer null.

I cannot create an Object with a null Shape in the console because if try obj.Shape = null it barfs
openBrain
Posts: 2183
Joined: Fri Nov 09, 2018 5:38 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby openBrain » Sun Sep 08, 2019 4:51 pm

keithsloan52 wrote:
Sun Sep 08, 2019 12:38 pm
Easier said than done.
Sure. But only you chosen to open a ticket. :D
I hit the issue when trying to develop code. Because my code is not correct I get an error reported on an Object.
This isn't clear. You're using a non-stock FC with some lamous custom code in it, right ?
In this case it can make things hard to reproduce...
If I try and use the check geometry tool on the object and it has null shape the system locks out.
When I added code to check if the Shape was null i.e print(obj.Shape.isNull() it prints out True
What is needed is that the check geometry tool performs a check by calling isNull before reporting
on the geometry. or informing the Shape is null.

I cannot save the state in a FreeCAD file as when I try subsequently to open the file the Object does not appear as it was saved with a null Shape
and the reloaded file whilst it does not contain a valid Shape it has been reset and no longer null.

I cannot create an Object with a null Shape in the console because if try obj.Shape = null it barfs
'null' doesn't exist in Python AFAIK, this is 'None'.
Anyway, this isn't really the concern here.
Actually an object always has a shape. When obj.Shape.isNull() returns True, the Shape property isn't neither null nor None. It's actually empty.
It's pretty easy to get a dummy object :

Code: Select all

>>> App.ActiveDocument.addObject("Part::Feature")
<Part::PartFeature>
>>> App.ActiveDocument.Part__Feature.Shape.isNull()
True
>>> App.ActiveDocument.Part__Feature.Shape
<Shape object at 0x7fda3000ab00>
>>> App.ActiveDocument.Part__Feature.Shape.check(True)
>>>
But you can see here that running a geometry check on this empty part doesn't trigger any problem (and it's same thing if the check is run from the GUI on the same object). ;)
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

Re: OpenSCAD Analysis Geometry for Errors

Postby keithsloan52 » Sun Sep 08, 2019 5:27 pm

Mmm Must have been some other condition that caused the function to lock up.

Will try and capture more details the next time it happens
User avatar
Kunda1
Posts: 5806
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4095 - OpenSCAD Analysis Geometry for Errors

Postby Kunda1 » Sun Oct 20, 2019 3:05 pm

Any progress regarding this and issue #4095 ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
keithsloan52
Posts: 1018
Joined: Mon Feb 27, 2012 5:31 pm

Re: Ticket #4095 - OpenSCAD Analysis Geometry for Errors

Postby keithsloan52 » Sun Oct 20, 2019 3:42 pm

I would close. I will reopen if it raises its head again.