{"action":"opened","issue":{"url":"https://api.github.com/repos/tpaviot/pythonocc-core/issues/239","repository_url":"https://api.github.com/repos/tpaviot/pythonocc-core","labels_url":"https://api.github.com/repos/tpaviot/pythonocc-core/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/tpaviot/pythonocc-core/issues/239/comments","events_url":"https://api.github.com/repos/tpaviot/pythonocc-core/issues/239/events","html_url":"https://github.com/tpaviot/pythonocc-core/issues/239","id":146906689,"number":239,"title":"Missing topology class","user":{"login":"jf---","id":620988,"avatar_url":"https://avatars.githubusercontent.com/u/620988?v=3","gravatar_id":"","url":"https://api.github.com/users/jf---","html_url":"https://github.com/jf---","followers_url":"https://api.github.com/users/jf---/followers","following_url":"https://api.github.com/users/jf---/following{/other_user}","gists_url":"https://api.github.com/users/jf---/gists{/gist_id}","starred_url":"https://api.github.com/users/jf---/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jf---/subscriptions","organizations_url":"https://api.github.com/users/jf---/orgs","repos_url":"https://api.github.com/users/jf---/repos","events_url":"https://api.github.com/users/jf---/events{/privacy}","received_events_url":"https://api.github.com/users/jf---/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-08T11:48:55Z","updated_at":"2016-04-08T11:48:55Z","closed_at":null,"body":"IMHO (re)moving the Topology class to [OCCUtils](https://github.com/tpaviot/pythonocc-utils/blob/master/OCCUtils/Topology.py) has been a serious mistake...\r\nI'd like to propose to undo this\r\n\r\n- the module is well tested and has been part of the project since day 1\r\n- its almost impossible to do anything interesting without it\r\n- \r\n\r\n```python\r\n    afillet = BRepFilletAPI_MakeFillet(cube)\r\n    cnt = 0\r\n    # find edges from vertex\r\n    _map = TopTools_IndexedDataMapOfShapeListOfShape()\r\n    topexp_MapShapesAndAncestors(cube, TopAbs_VERTEX, TopAbs_EDGE, _map)\r\n    results = _map.FindFromKey(vert)\r\n    topology_iterator = TopTools_ListIteratorOfListOfShape(results)\r\n    while topology_iterator.More():\r\n        edge = topods_Edge(topology_iterator.Value())\r\n        topology_iterator.Next()\r\n```\r\n\r\nshould be:\r\n\r\n```\r\n    afillet = BRepFilletAPI_MakeFillet(cube)\r\n    edges = Topology(afillet).edges_from_vertex(vert)\r\n```\r\n\r\nIts __really__ annoying coming up with interesting examples without this module.\r\n\r\nfor example, OCE 0.17 has a AIS_ColoredShape.\r\nthis lets you assign a color to subshapes of a TopoDS_Shape\r\nso, something that would be a no-brainer now is a pain in the ass because of the lack of Topology.py, and since we have a proper module for topology traversal, i feel that this is artificially complex.\r\n\r\nMissing out on the module violates the `pythonic` concept in many levels:\r\n\r\n- \"There should be one-- and preferably only one --obvious way to do it.\"\r\n  - traversing topology should be handled through Topology.py\r\n\r\n- \"If the implementation is hard to explain, it's a bad idea\"\r\n   - the code above makes my eyes bleed... we've worked hard on Topology.py such to never have to deal with this mess again ;)\r\n\r\n- \"Although practicality beats purity\"\r\n   - I do appreciate the division between pythonocc related modules ( pythonocc-utils / pythonocc-contrib ), but factoring out Topology.py has been a bad decision IMO. Perhaps at the time of the \"great refactor\" project this could be argued for, but now it comes across as highly impractical.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}