corrupted models

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: corrupted models

Postby shoogen » Wed Feb 26, 2014 8:50 pm

tanderson69 wrote:
shoogen wrote:OK, i reproduced the problem with the check not showing anything.
Check doesn't show anything, because a compsolid isn't necesarily an error. You never posted that the file in the video prior to the model refine. I can't do anything with a file that has already been corrupted.
The problem is that the behavior changes for the original object and the simple copy, after i did the refine. Please compare the results of your tool at 0:30 and at 1:20.
Attachments
main.fcstd
(396.2 KiB) Downloaded 55 times
User avatar
tanderson69
Posts: 1569
Joined: Thu Feb 18, 2010 1:07 am

Re: corrupted models

Postby tanderson69 » Thu Feb 27, 2014 12:44 am

Now that I have a relevant file, I am with you. Yes, I can repeat what you show in the video. I am pretty sure we are dealing with more than one problem.

I am getting the following output in the terminal, working with your file. Do you get this and what does it mean to you?

Code: Select all

<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 31 (X_GrabKeyboard)
  Resource id:  0x0
<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull003: 'NoneType' object has no attribute 'execute'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull: 'NoneType' object has no attribute 'execute'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull001: 'NoneType' object has no attribute 'execute'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull002: 'NoneType' object has no attribute 'execute'
<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull004: 'NoneType' object has no attribute 'execute'
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: corrupted models

Postby shoogen » Thu Feb 27, 2014 7:58 am

tanderson69 wrote:Now that I have a relevant file, I am with you. Yes, I can repeat what you show in the video. I am pretty sure we are dealing with more than one problem.

I am getting the following output in the terminal, working with your file. Do you get this and what does it mean to you?

Code: Select all

<unknown exception traceback><type 'exceptions.AttributeError'>: 'module' object has no attribute 'CGALFeature'
The proxy for a FeaturePython Object can't be attached. Does your branch include the commit 0e6b7a629d0790971f69a6b4719380450851839c ?

Code: Select all

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 31 (X_GrabKeyboard)
  Resource id:  0x0
I don't get this message.

Code: Select all

<unknown exception traceback><type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'execute'
hull003: 'NoneType' object has no attribute 'execute'
Due to the missing Proxy
jmaustpc
Posts: 11063
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: corrupted models

Postby jmaustpc » Thu Feb 27, 2014 1:30 pm

Hi Tanderson69
IS this one useful? Its a step file in this topic starting here
viewtopic.php?f=22&t=5739

by page 4 here, I have a list of various combinations of FreeCAD and OCC/OCE
viewtopic.php?f=22&t=5739&start=30#p47457

It seems, from my limited testing, that you need the latest OCE and a recent FreeCAD, for Part Check Geometry to find the errors

this is the file
Tank_all-skull.STEP
(5.76 MiB) Downloaded 66 times
while writing this I see icby has replied
Jim is right: this functionality was added recently by tanderson with commit git commit f51ffa and it uses a new feature from occ6.7 (oce0.15).
so this post is now probably a waste of time? I will leave it here just in case it is useful in some way.

Jim
User avatar
tanderson69
Posts: 1569
Joined: Thu Feb 18, 2010 1:07 am

Re: corrupted models

Postby tanderson69 » Thu Feb 27, 2014 3:20 pm

shoogen wrote:The proxy for a FeaturePython Object can't be attached. Does your branch include the commit 0e6b7a629d0790971f69a6b4719380450851839c ?
No I don't have that commit. But I am not worried about it now as I have the condition isolated outside of openscad. Too be continued.
User avatar
tanderson69
Posts: 1569
Joined: Thu Feb 18, 2010 1:07 am

Re: corrupted models

Postby tanderson69 » Thu Feb 27, 2014 6:32 pm

Shoogen:
I traced this into the OCC::BRepLib_FuseEdges. I created a bug report on oce.https://groups.google.com/forum/#!topic ... Mau4GTySlU. Hopefully something will happen.


I think we can work around this problem. I will create a bug report on mantis. issue #1450
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: corrupted models

Postby shoogen » Thu Feb 27, 2014 8:10 pm

That good news. But it only explains the broken shape, not the behavior of the check command, or does it?
User avatar
tanderson69
Posts: 1569
Joined: Thu Feb 18, 2010 1:07 am

Re: corrupted models

Postby tanderson69 » Thu Feb 27, 2014 11:02 pm

shoogen wrote:That good news. But it only explains the broken shape, not the behavior of the check command, or does it?
That is good question. IMHO: OCC uses a "copy on write" strategy. So even though you are making copies the corruption carries through. If you are curious to test this:

experiment 1:
load your problem file.
make a simple copy.
make a simple copy of the simple copy.
refine the last copy.
check geometry on each shape and see the corruption cascade all the way to original. (this is just like your video).

experiment 2:
load your problem file.
make a simple copy.
save the file.
close the file.
open the file.
make a simple copy of the simple copy.
refine the last copy.
check geometry on each shape and see the corruption doesn't make it all the way to the original.

this happens because Freecad serializes each document objects TopoDS_Shape separately. So shape copies at runtime are linked by OCC, but after a save and load the links are gone. This is how I see it this week. Ask me again next week. ;)
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: corrupted models

Postby shoogen » Fri Feb 28, 2014 10:13 am

copy on write is nice. And i think FreeCAD should do some deduplication on shapes as well (to reduce the file size).
But we are not talking about an OCC operation giving one bad result. This means the the copy on write does not protect other shapes from corruption, if the algorithm of a geometric operations goes wrong.
That's surly the worst bug in OCC I've ever heard about.
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: corrupted models

Postby shoogen » Sun Mar 02, 2014 5:47 pm

i got a new file.
please refine the top level object.
Attachments
airtripper-intact.fcstd
(80.63 KiB) Downloaded 54 times