File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 28
28
install :
29
29
- mamba env create -f environment.yml
30
30
- conda activate cadquery
31
- -
pip install git+https://github.com/CadQuery/[email protected]
32
31
33
32
build : false
34
33
Original file line number Diff line number Diff line change 156
156
BRepFilletAPI_MakeFillet2d ,
157
157
)
158
158
159
- from OCP .TopTools import TopTools_IndexedDataMapOfShapeListOfShape , TopTools_ListOfShape
159
+ from OCP .TopTools import (
160
+ TopTools_IndexedDataMapOfShapeListOfShape ,
161
+ TopTools_ListOfShape ,
162
+ TopTools_MapOfShape ,
163
+ )
160
164
161
165
from OCP .TopExp import TopExp
162
166
@@ -747,18 +751,21 @@ def ShapeType(self) -> Shapes:
747
751
748
752
def _entities (self , topo_type : Shapes ) -> List [TopoDS_Shape ]:
749
753
750
- out = {} # using dict to prevent duplicates
754
+ rv = []
755
+ shape_set = TopTools_MapOfShape ()
751
756
752
757
explorer = TopExp_Explorer (self .wrapped , inverse_shape_LUT [topo_type ])
753
758
754
759
while explorer .More ():
755
760
item = explorer .Current ()
756
- out [
757
- item .HashCode (HASH_CODE_MAX )
758
- ] = item # needed to avoid pseudo-duplicate entities
761
+
762
+ # needed to avoid pseudo-duplicate entities
763
+ if shape_set .Add (item ):
764
+ rv .append (item )
765
+
759
766
explorer .Next ()
760
767
761
- return list ( out . values ())
768
+ return rv
762
769
763
770
def _entitiesFrom (
764
771
self , child_type : Shapes , parent_type : Shapes
You can’t perform that action at this time.
0 commit comments