Giter VIP home page Giter VIP logo

Comments (11)

tpaviot avatar tpaviot commented on August 27, 2024

Great work, very interesting. What do you exactly call a "correct dependency", i.e. how did you build this oriented graph ? Indeed, according to the definition, one can consider that Standard depends upon TCollection and TCollection depends on Standard as well, which is not the case in your document, and which create circular dependencies between python modules.

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

These are the minimum requirements how to make handles work correctly. I figured it out as written in some of the other issues. In practice, I simply added dependencies until I could compile everything.

So, if there occurs a Handle(geom...), the geom model is obviously required.

I did not look for circular dependencies though. Also did not try get to load modules. These are the minimum requirements to make everything compile.

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

So... There are definitely some circular dependencies making problems. The question is, how to untie them.

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

The smallest cycles are (In opencascade, they all belong to the same toolkit/dll):

import Graphic3d
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Graphic3d.py", line 156, in <module>
    import OCC.Core.Select3D
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Select3D.py", line 158, in <module>
    import OCC.Core.SelectMgr
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/SelectMgr.py", line 161, in <module>
    import OCC.Core.PrsMgr
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/PrsMgr.py", line 162, in <module>
    import OCC.Core.Prs3d
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Prs3d.py", line 163, in <module>
    import OCC.Core.V3d
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/V3d.py", line 357, in <module>
    class V3d_AmbientLight(OCC.Core.Graphic3d.Graphic3d_CLight):
AttributeError: module 'OCC.Core' has no attribute 'Graphic3d'

and

StepRepr
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepRepr.py", line 150, in <module>
    import OCC.Core.StepShape
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepShape.py", line 144, in <module>
    import OCC.Core.StepGeom
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepGeom.py", line 1096, in <module>
    class StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx(OCC.Core.StepRepr.StepRepr_RepresentationContext):
AttributeError: module 'OCC.Core' has no attribute 'StepRepr'

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024
  • In the first case, the best way to resolve the cycle is to drop the dependency of graphic3d from select3d. there are just two functions involved.

cycle

  • Here's the second cycle. Here we should remove the dependency of StepShape from StepRepr:
    cycle2

from pythonocc-generator.

tpaviot avatar tpaviot commented on August 27, 2024

Yesterday, I tried something : removing all imports from Graphic3d (at the end of the interface file, all the import Something.i). Of course it works and break the circular references between all these packages. I will try your suggestion. If it's ok, then let's go that way.

On the midterm, if circular references become a stronger issue, it may become necessary to create a single GraphicStuff.i interface file including all of the Graphic3d, PrsMgr, Select3d etc. definitions.

from pythonocc-generator.

tpaviot avatar tpaviot commented on August 27, 2024

@rainman110 btw, what's the code to draw the graph ? I guess you've been using networkx but I didn't practice this package for a while

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

@tpaviot No, used used the dot tool. It's standard on linux/maxOS. You can directly throw in the dependencies.txt into the tool.

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

If we remove the class StepRepr_ReprItemAndMeasureWithUnitAndQRI we solve the circular dependency as well.

from pythonocc-generator.

tpaviot avatar tpaviot commented on August 27, 2024

Tested with Graphic3d. I pushed a change to the generator and updated interfaces files as well see

from pythonocc-generator.

rainman110 avatar rainman110 commented on August 27, 2024

Fixed

from pythonocc-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.