jmplonka / InventorLoader

Workbench for FreeCAD to loads or import Autodesk (R) Inventor (R) files.
GNU General Public License v2.0
114 stars 17 forks source link

GFA hanging forever #71

Open marcocecchiscmgroup opened 1 year ago

marcocecchiscmgroup commented 1 year ago

Dear Jens, I stepped into a solid example of the limits of the OpenCascade GFA. If you take the enclosed Fusion 360 example that I created to try out all the basic operations with solids, the solid conversion to STEP, the helix, hangs forever in surface.generalFuse(edges, tolerance):

    def build(self):
        if (self.__ready_to_build__):
            self.__ready_to_build__ = False
            edges = self.buildCoEdges()
            if (self._surface):
                surface = self.getSurface().build()
                if (surface):
                    if (self.sense == 'reversed'):
                        surface.reverse()
                    if (len(edges) > 0):
                        tolerance = 0.1
                        component, elements = surface.generalFuse(edges, tolerance)
                        faces = elements[0]

So, as it seems, the attempt to reduce the dependencies from Part for Issue #65, is stil causing troubles.

Even with the following hack, the processing takes a very long time, even if it doesn't hang.

Acis2Step.py:

def _convertFace(acisFace, parentColor, context):
    color = getColor(acisFace)
    if (color is None): color = parentColor
    try:
        #surface, sense = _createSurfaceFaceShape(acisFace)
        surface = None
        sense = acisFace.sense == 'forward'
        if (surface):
            face = ADVANCED_FACE('', surface, sense)
[...]

helix_cut.zip

Immagine

marcocecchiscmgroup commented 1 year ago

Even with the following hack, the processing takes a very long time, even if it doesn't hang.

I will address this in a separate issue with more details.

marcocecchiscmgroup commented 1 year ago

Not sure, maybe I played around too much with variations of the master codebase, but, 'luckily' the point where the processing hangs is always the aforemetioned one. It don't know, but yesterday I got a different behaviour someway.

Attaching the sat version for your convenience.

helix_cut.sat.sat.zip

marcocecchiscmgroup commented 1 year ago

What about this fix?

EDIT: of course speaking of the STEP conversion

>                   self.shape = surface
<               if (len(edges) > 0):
<                   tolerance = 0.1
<                   component, elements = surface.generalFuse(edges, tolerance)
<                   faces = elements[0]
<                   if (len(faces) == 0):
<                       logWarning("Can't apply wires for face (no elements) for %s" %(self._surface))
<                   else:
<                       self.shape = eliminateOuterFaces(faces, edges)
<                       if (self.shape is None):
<                           # edges can be empty because not all edges can be created right now :(
<                           logWarning("Can't apply wires for face %s!" %(surface.Surface))
<                           for f in faces:
<                               Part.show(f, "Face-%d" %(self.record.index))
<               else:
<                   self.shape = surface
marcocecchiscmgroup commented 1 year ago

Hello Jens,

how about your holydays? ;)

Any chance to work on items #72, #73 , #74, #75 and #76?