topologicpy 0.4.57__tar.gz → 0.4.59__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {topologicpy-0.4.57/src/topologicpy.egg-info → topologicpy-0.4.59}/PKG-INFO +1 -1
  2. {topologicpy-0.4.57 → topologicpy-0.4.59}/pyproject.toml +1 -1
  3. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/CellComplex.py +15 -8
  4. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Cluster.py +68 -0
  5. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Face.py +67 -24
  6. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Plotly.py +7 -8
  7. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Shell.py +6 -5
  8. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/__init__.py +1 -1
  9. {topologicpy-0.4.57 → topologicpy-0.4.59/src/topologicpy.egg-info}/PKG-INFO +1 -1
  10. {topologicpy-0.4.57 → topologicpy-0.4.59}/LICENSE +0 -0
  11. {topologicpy-0.4.57 → topologicpy-0.4.59}/MANIFEST.in +0 -0
  12. {topologicpy-0.4.57 → topologicpy-0.4.59}/README.md +0 -0
  13. {topologicpy-0.4.57 → topologicpy-0.4.59}/setup.cfg +0 -0
  14. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Aperture.py +0 -0
  15. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Cell.py +0 -0
  16. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Color.py +0 -0
  17. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Context.py +0 -0
  18. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/DGL.py +0 -0
  19. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Dictionary.py +0 -0
  20. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Edge.py +0 -0
  21. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/EnergyModel.py +0 -0
  22. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Graph.py +0 -0
  23. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Grid.py +0 -0
  24. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Helper.py +0 -0
  25. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Honeybee.py +0 -0
  26. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Matrix.py +0 -0
  27. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Neo4j.py +0 -0
  28. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Polyskel.py +0 -0
  29. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Speckle.py +0 -0
  30. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Topology.py +0 -0
  31. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Vector.py +0 -0
  32. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Vertex.py +0 -0
  33. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/Wire.py +0 -0
  34. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic/__init__.py +0 -0
  35. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic/topologic.cpython-310-x86_64-linux-gnu.so +0 -0
  36. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic/topologic.cpython-311-x86_64-linux-gnu.so +0 -0
  37. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic/topologic.cpython-38-x86_64-linux-gnu.so +0 -0
  38. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic/topologic.cpython-39-x86_64-linux-gnu.so +0 -0
  39. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKBO-6bdf205d.so.7.7.0 +0 -0
  40. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKBRep-2960a069.so.7.7.0 +0 -0
  41. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKBool-c44b74bd.so.7.7.0 +0 -0
  42. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKFillet-9a670ba0.so.7.7.0 +0 -0
  43. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKG2d-8f31849e.so.7.7.0 +0 -0
  44. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKG3d-4c6bce57.so.7.7.0 +0 -0
  45. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKGeomAlgo-26066fd9.so.7.7.0 +0 -0
  46. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKGeomBase-2116cabe.so.7.7.0 +0 -0
  47. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKMath-72572fa8.so.7.7.0 +0 -0
  48. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKMesh-2a060427.so.7.7.0 +0 -0
  49. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKOffset-6cab68ff.so.7.7.0 +0 -0
  50. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKPrim-eb1262b3.so.7.7.0 +0 -0
  51. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKShHealing-e67e5cc7.so.7.7.0 +0 -0
  52. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKTopAlgo-e4c96c33.so.7.7.0 +0 -0
  53. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libTKernel-fb7fe3b7.so.7.7.0 +0 -0
  54. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libgcc_s-32c1665e.so.1 +0 -0
  55. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/linux/topologic.libs/libstdc++-672d7b41.so.6.0.30 +0 -0
  56. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/macos/topologic/__init__.py +0 -0
  57. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKBO-f6b191de.dll +0 -0
  58. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKBRep-e56a600e.dll +0 -0
  59. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKBool-7b8d47ae.dll +0 -0
  60. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKFillet-0ddbf0a8.dll +0 -0
  61. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKG2d-2e2dee3d.dll +0 -0
  62. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKG3d-6674513d.dll +0 -0
  63. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKGeomAlgo-d240e370.dll +0 -0
  64. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKGeomBase-df87aba5.dll +0 -0
  65. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKMath-45bd625a.dll +0 -0
  66. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKMesh-d6e826b1.dll +0 -0
  67. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKOffset-79b9cc94.dll +0 -0
  68. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKPrim-aa430a86.dll +0 -0
  69. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKShHealing-bb48be89.dll +0 -0
  70. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKTopAlgo-7d0d1e22.dll +0 -0
  71. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/TKernel-08c8cfbb.dll +0 -0
  72. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/__init__.py +0 -0
  73. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/topologic.cp310-win_amd64.pyd +0 -0
  74. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/topologic.cp311-win_amd64.pyd +0 -0
  75. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/topologic.cp38-win_amd64.pyd +0 -0
  76. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy/bin/windows/topologic/topologic.cp39-win_amd64.pyd +0 -0
  77. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy.egg-info/SOURCES.txt +0 -0
  78. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy.egg-info/dependency_links.txt +0 -0
  79. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy.egg-info/requires.txt +0 -0
  80. {topologicpy-0.4.57 → topologicpy-0.4.59}/src/topologicpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.57
3
+ Version: 0.4.59
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
@@ -3,7 +3,7 @@ requires = ["setuptools>=61"]
3
3
  build-backend = "setuptools.build_meta"
4
4
  [project]
5
5
  name = "topologicpy"
6
- version = "0.4.57"
6
+ version = "0.4.59"
7
7
  authors = [
8
8
  { name="Wassim Jabi", email="wassim.jabi@gmail.com" },
9
9
  ]
@@ -46,7 +46,7 @@ class CellComplex(topologic.CellComplex):
46
46
  direction=direction, placement=placement, tolerance=tolerance)
47
47
 
48
48
  @staticmethod
49
- def ByCells(cells: list, tolerance: float = 0.0001) -> topologic.CellComplex:
49
+ def ByCells(cells: list, tolerance: float = 0.0001, verbose: bool = True) -> topologic.CellComplex:
50
50
  """
51
51
  Creates a cellcomplex by merging the input cells.
52
52
 
@@ -67,14 +67,17 @@ class CellComplex(topologic.CellComplex):
67
67
  from topologicpy.Topology import Topology
68
68
 
69
69
  if not isinstance(cells, list):
70
- print("CellComplex.ByCells - Error: The input cells parameter is not a valid list. Returning None.")
70
+ if verbose:
71
+ print("CellComplex.ByCells - Error: The input cells parameter is not a valid list. Returning None.")
71
72
  return None
72
73
  cells = [x for x in cells if isinstance(x, topologic.Cell)]
73
74
  if len(cells) < 1:
74
- print("CellComplex.ByCells - Error: The input cells parameter does not contain any valid cells. Returning None.")
75
+ if verbose:
76
+ print("CellComplex.ByCells - Error: The input cells parameter does not contain any valid cells. Returning None.")
75
77
  return None
76
78
  elif len(cells) == 1:
77
- print("CellComplex.ByCells - Warning: The input cells parameter contains only one valid cells. Returning object of type topologic.Cell instead of topologic.CellComplex.")
79
+ if verbose:
80
+ print("CellComplex.ByCells - Warning: The input cells parameter contains only one valid cells. Returning object of type topologic.Cell instead of topologic.CellComplex.")
78
81
  return cells[0]
79
82
  cellComplex = None
80
83
  try:
@@ -85,18 +88,22 @@ class CellComplex(topologic.CellComplex):
85
88
  cellComplex = Topology.Merge(topA, topB, tranDict=False, tolerance=tolerance)
86
89
 
87
90
  if not isinstance(cellComplex, topologic.CellComplex):
88
- print("CellComplex.ByCells - Warning: Could not create a CellComplex. Returning object of type topologic.Cluster instead of topologic.CellComplex.")
91
+ if verbose:
92
+ print("CellComplex.ByCells - Warning: Could not create a CellComplex. Returning object of type topologic.Cluster instead of topologic.CellComplex.")
89
93
  return Cluster.ByTopologies(cells)
90
94
  else:
91
95
  temp_cells = CellComplex.Cells(cellComplex)
92
96
  if not isinstance(temp_cells, list):
93
- print("CellComplex.ByCells - Error: The resulting object does not contain any cells. Returning None.")
97
+ if verbose:
98
+ print("CellComplex.ByCells - Error: The resulting object does not contain any cells. Returning None.")
94
99
  return None
95
100
  elif len(temp_cells) < 1:
96
- print("CellComplex.ByCells - Error: Could not create a CellComplex. Returning None.")
101
+ if verbose:
102
+ print("CellComplex.ByCells - Error: Could not create a CellComplex. Returning None.")
97
103
  return None
98
104
  elif len(temp_cells) == 1:
99
- print("CellComplex.ByCells - Warning: Resulting object contains only one cell. Returning object of type topologic.Cell instead of topologic.CellComplex.")
105
+ if verbose:
106
+ print("CellComplex.ByCells - Warning: Resulting object contains only one cell. Returning object of type topologic.Cell instead of topologic.CellComplex.")
100
107
  return(temp_cells[0])
101
108
  return cellComplex
102
109
 
@@ -726,6 +726,74 @@ class Cluster(topologic.Cluster):
726
726
  t_clusters.append(cluster)
727
727
  return t_clusters
728
728
 
729
+ @staticmethod
730
+ def MergeCells(cells, tolerance=0.0001):
731
+ """
732
+ Creates a cluster that contains cellComplexes where it can create them plus any additional free cells.
733
+
734
+ Parameters
735
+ ----------
736
+ cells : list
737
+ The input list of cells.
738
+ tolerance : float , optional
739
+ The desired tolerance. The default is 0.0001.
740
+
741
+ Returns
742
+ -------
743
+ topologic.Cluster
744
+ The created cluster with merged cells as possible.
745
+
746
+ """
747
+
748
+ from topologicpy.CellComplex import CellComplex
749
+ from topologicpy.Topology import Topology
750
+
751
+ def find_cell_complexes(cells, adjacency_test, tolerance=0.0001):
752
+ cell_complexes = []
753
+ remaining_cells = set(cells)
754
+
755
+ def explore_complex(cell_complex, remaining, tolerance=0.0001):
756
+ new_cells = set()
757
+ for cell in remaining:
758
+ if any(adjacency_test(cell, existing_cell, tolerance=tolerance) for existing_cell in cell_complex):
759
+ new_cells.add(cell)
760
+ return new_cells
761
+
762
+ while remaining_cells:
763
+ current_cell = remaining_cells.pop()
764
+ current_complex = {current_cell}
765
+ current_complex.update(explore_complex(current_complex, remaining_cells, tolerance=tolerance))
766
+ cell_complexes.append(current_complex)
767
+ remaining_cells -= current_complex
768
+
769
+ return cell_complexes
770
+
771
+ # Example adjacency test function (replace this with your actual implementation)
772
+ def adjacency_test(cell1, cell2, tolerance=0.0001):
773
+ return isinstance(Topology.Merge(cell1, cell2, tolerance=tolerance), topologic.CellComplex)
774
+
775
+ if not isinstance(cells, list):
776
+ print("Cluster.MergeCells - Error: The input cells parameter is not a valid list of cells. Returning None.")
777
+ return None
778
+ #cells = [cell for cell in cells if isinstance(cell, topologic.Cell)]
779
+ if len(cells) < 1:
780
+ print("Cluster.MergeCells - Error: The input cells parameter does not contain any valid cells. Returning None.")
781
+ return None
782
+
783
+ complexes = find_cell_complexes(cells, adjacency_test)
784
+ cellComplexes = []
785
+ cells = []
786
+ for aComplex in complexes:
787
+ aComplex = list(aComplex)
788
+ if len(aComplex) > 1:
789
+ cc = CellComplex.ByCells(aComplex, verbose=False)
790
+ if isinstance(cc, topologic.CellComplex):
791
+ cellComplexes.append(cc)
792
+ elif len(aComplex) == 1:
793
+ if isinstance(aComplex[0], topologic.Cell):
794
+ cells.append(aComplex[0])
795
+ return Cluster.ByTopologies(cellComplexes+cells)
796
+
729
797
  @staticmethod
730
798
  def MysticRose(wire: topologic.Wire = None, origin: topologic.Vertex = None, radius: float = 0.5, sides: int = 16, perimeter: bool = True, direction: list = [0,0,1], placement:str = "center", tolerance: float = 0.0001) -> topologic.Cluster:
731
799
  """
@@ -497,7 +497,7 @@ class Face(topologic.Face):
497
497
  return Face.ByVertices(vertices)
498
498
 
499
499
  @staticmethod
500
- def ByWire(wire: topologic.Wire, tolerance: float=0.0001) -> topologic.Face:
500
+ def ByWire(wire: topologic.Wire, tolerance: float = 0.0001) -> topologic.Face:
501
501
  """
502
502
  Creates a face from the input closed wire.
503
503
 
@@ -505,8 +505,6 @@ class Face(topologic.Face):
505
505
  ----------
506
506
  wire : topologic.Wire
507
507
  The input wire.
508
- tolerance : float , optional
509
- The desired tolerance. The default is 0.0001.
510
508
 
511
509
  Returns
512
510
  -------
@@ -524,33 +522,32 @@ class Face(topologic.Face):
524
522
 
525
523
  def triangulateWire(wire):
526
524
  wire = Topology.RemoveCollinearEdges(wire)
527
- vertices = Wire.Vertices(wire)
525
+ vertices = Topology.Vertices(wire)
528
526
  shell = Shell.Delaunay(vertices)
529
- if isinstance(shell, topologic.Shell):
530
- return Shell.Faces(shell)
527
+ if isinstance(shell, topologic.Topology):
528
+ return Topology.Faces(shell)
531
529
  else:
532
530
  return []
533
531
  if not isinstance(wire, topologic.Wire):
534
532
  print("Face.ByWire - Error: The input wire parameter is not a valid topologic wire. Returning None.")
535
533
  return None
536
534
  if not Wire.IsClosed(wire):
537
- print("Face.ByWire - Error: The input wire parameter is not a closed topologic wire. Attempting to close it.")
538
- wire = Wire.Close(wire)
539
- wire = Wire.Planarize(wire)
540
- if not Wire.IsClosed(wire):
541
- print("Face.ByWire - Error: Could not close the input wire parameter. Giving up and returning None.")
542
- return None
535
+ print("Face.ByWire - Error: The input wire parameter is not a closed topologic wire. Returning None.")
536
+ return None
543
537
 
544
538
  edges = Wire.Edges(wire)
545
- wire = Topology.SelfMerge(Cluster.ByTopologies(edges), tolerance=tolerance)
539
+ wire = Topology.SelfMerge(Cluster.ByTopologies(edges))
546
540
  vertices = Wire.Vertices(wire)
547
- try:
548
- fList = topologic.Face.ByExternalBoundary(wire)
549
- except:
550
- if len(vertices) > 3:
551
- fList = triangulateWire(wire)
552
- else:
553
- fList = []
541
+ fList = []
542
+ if isinstance(wire, topologic.Wire):
543
+ try:
544
+ fList = topologic.Face.ByExternalBoundary(wire)
545
+ except:
546
+ print("Face.ByWire - Warning: Could not create face by external boundary. Trying other methods.")
547
+ if len(vertices) > 3:
548
+ fList = triangulateWire(wire)
549
+ else:
550
+ fList = []
554
551
 
555
552
  if not isinstance(fList, list):
556
553
  fList = [fList]
@@ -573,7 +570,6 @@ class Face(topologic.Face):
573
570
  elif len(returnList) == 1:
574
571
  return returnList[0]
575
572
  else:
576
- print("Face.ByWire - Warning: Forced to triangulate the face. Returning list of faces.")
577
573
  return returnList
578
574
 
579
575
  @staticmethod
@@ -1879,9 +1875,56 @@ class Face(topologic.Face):
1879
1875
  print("Face.Triangulate - Error: The input face parameter is not a valid face. Returning None.")
1880
1876
  return None
1881
1877
  vertices = Topology.Vertices(face)
1882
- shell = Shell.Delaunay(vertices=vertices, face=face, tolerance=tolerance)
1883
- triangles = Topology.Faces(shell)
1884
- return triangles
1878
+ if len(vertices) == 3: # Already a triangle
1879
+ return [face]
1880
+ #flatFace = Face.Flatten(face)
1881
+ #if not isinstance(flatFace, topologic.Face):
1882
+ #Topology.ExportToBREP(face, "C:/Users/sarwj/Downloads/troubleFace.brep")
1883
+ #print("Tri 2", flatFace)
1884
+
1885
+ #world_origin = Vertex.ByCoordinates(0,0,0)
1886
+ # Retrieve the needed transformations
1887
+ #dictionary = Topology.Dictionary(flatFace)
1888
+ #xTran = Dictionary.ValueAtKey(dictionary,"x")
1889
+ #yTran = Dictionary.ValueAtKey(dictionary,"y")
1890
+ #zTran = Dictionary.ValueAtKey(dictionary,"z")
1891
+ #phi = Dictionary.ValueAtKey(dictionary,"phi")
1892
+ #theta = Dictionary.ValueAtKey(dictionary,"theta")
1893
+
1894
+ vertices = Topology.Vertices(face)
1895
+ #print("Number of vertices:", len(vertices))
1896
+ shell = Shell.Delaunay(vertices=vertices, face=face)
1897
+ shell_faces = Topology.Faces(shell)
1898
+ if not shell_faces:
1899
+ return []
1900
+ #for shell_face in shell_faces:
1901
+ #c = Topology.Centroid(shell_face)
1902
+ #if Face.IsInternal(face, c):
1903
+ #faceTriangles.append(shell_face)
1904
+
1905
+ '''
1906
+ for i in range(0,5,1):
1907
+ try:
1908
+ _ = topologic.FaceUtility.Triangulate(flatFace, float(i)*0.1, faceTriangles)
1909
+ break
1910
+ except:
1911
+ continue
1912
+ '''
1913
+ if len(shell_faces) < 1:
1914
+ return []
1915
+ #finalFaces = []
1916
+ #for f in faceTriangles:
1917
+ #f = Topology.Rotate(f, origin=world_origin, x=0, y=1, z=0, degree=theta)
1918
+ #f = Topology.Rotate(f, origin=world_origin, x=0, y=0, z=1, degree=phi)
1919
+ #f = Topology.Translate(f, xTran, yTran, zTran)
1920
+ #if Face.Angle(face, f) > 90:
1921
+ # wire = Face.ExternalBoundary(f)
1922
+ #wire = Wire.Invert(wire)
1923
+ # f = topologic.Face.ByExternalBoundary(wire)
1924
+ # finalFaces.append(f)
1925
+ #else:
1926
+ #finalFaces.append(f)
1927
+ return shell_faces
1885
1928
 
1886
1929
  @staticmethod
1887
1930
  def TrimByWire(face: topologic.Face, wire: topologic.Wire, reverse: bool = False) -> topologic.Face:
@@ -834,14 +834,13 @@ class Plotly:
834
834
  all_triangles = []
835
835
  for tp_face in tp_faces:
836
836
  triangles = Face.Triangulate(tp_face, tolerance=tolerance)
837
- for tri in triangles:
838
- if faceLabelKey or faceGroupKey:
839
- d = Topology.Dictionary(tp_face)
840
- f_dictionaries.append(d)
841
- if d:
842
- _ = Topology.SetDictionary(tri, d)
843
- c = Topology.Centroid(tri)
844
- if Face.IsInternal(tp_face, c):
837
+ if isinstance(triangles, list):
838
+ for tri in triangles:
839
+ if faceLabelKey or faceGroupKey:
840
+ d = Topology.Dictionary(tp_face)
841
+ f_dictionaries.append(d)
842
+ if d:
843
+ _ = Topology.SetDictionary(tri, d)
845
844
  all_triangles.append(tri)
846
845
  if len(all_triangles) > 0:
847
846
  f_cluster = Cluster.ByTopologies(all_triangles)
@@ -526,14 +526,15 @@ class Shell(Topology):
526
526
  tempTriangleVertices.append(vertices[simplex[2]])
527
527
  tempFace = Face.ByWire(Wire.ByVertices(tempTriangleVertices), tolerance=tolerance)
528
528
  tempCentroid = Topology.Centroid(tempFace)
529
- if Face.IsInternal(flatFace, tempCentroid):
530
- faces.append(tempFace)
529
+ faces.append(tempFace)
531
530
 
532
531
  shell = Shell.ByFaces(faces, tolerance=tolerance)
533
- #if shell == None:
534
- #print("Shell.Delaunay - WARNING: Could not create Shell. Returning a Cluster of Faces.")
535
- #shell = Cluster.ByTopologies(faces)
532
+ if shell == None:
533
+ shell = Cluster.ByTopologies(faces)
534
+
536
535
  if isinstance(face, topologic.Face):
536
+ edges = Topology.Edges(shell)
537
+ shell = Topology.Slice(flatFace, Cluster.ByTopologies(edges))
537
538
  # Get the internal boundaries of the face
538
539
  wires = Face.InternalBoundaries(flatFace)
539
540
  ibList = []
@@ -2,7 +2,7 @@ import sys
2
2
  import os, re
3
3
  from sys import platform
4
4
 
5
- __version__ = '0.4.57'
5
+ __version__ = '0.4.59'
6
6
  __version_info__ = tuple([ int(num) for num in __version__.split('.')])
7
7
 
8
8
  if platform == 'win32':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: topologicpy
3
- Version: 0.4.57
3
+ Version: 0.4.59
4
4
  Summary: An Advanced Spatial Modelling and Analysis Software Library for Architecture, Engineering, and Construction.
5
5
  Author-email: Wassim Jabi <wassim.jabi@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/wassimj/TopologicPy
File without changes
File without changes
File without changes
File without changes