topologicpy 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl

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.
topologicpy/Aperture.py CHANGED
@@ -5,14 +5,14 @@ class Aperture(topologic.Aperture):
5
5
  @staticmethod
6
6
  def ByTopologyContext(topology, context):
7
7
  """
8
- Creates an aperture.
8
+ Creates an aperture object represented by the input topology and one that belongs to the input context.
9
9
 
10
10
  Parameters
11
11
  ----------
12
12
  topology : topologic.Topology
13
- The input topology to which the aperture will belong
13
+ The input topology that represents the aperture.
14
14
  context : topologic.Context
15
- The context of the aperture.
15
+ The context of the aperture. See Context class.
16
16
 
17
17
  Returns
18
18
  -------
topologicpy/Cluster.py CHANGED
@@ -146,7 +146,10 @@ class Cluster(topologic.Cluster):
146
146
  resultingCluster = Topology.Boolean(allCellsCluster, cellComplexesCluster, operation="Difference")
147
147
  if isinstance(resultingCluster, topologic.Cell):
148
148
  return [resultingCluster]
149
- return Topology.SubTopologies(resultingCluster, subTopologyType="cell")
149
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="cell")
150
+ if not result:
151
+ return [] #Make sure you return an empty list instead of None
152
+ return result
150
153
 
151
154
  @staticmethod
152
155
  def FreeShells(cluster):
@@ -184,7 +187,10 @@ class Cluster(topologic.Cluster):
184
187
  resultingCluster = Topology.Boolean(allShellsCluster, cellsCluster, operation="Difference")
185
188
  if isinstance(resultingCluster, topologic.Shell):
186
189
  return [resultingCluster]
187
- return Topology.SubTopologies(resultingCluster, subTopologyType="shell")
190
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="shell")
191
+ if not result:
192
+ return [] #Make sure you return an empty list instead of None
193
+ return result
188
194
 
189
195
  @staticmethod
190
196
  def FreeFaces(cluster):
@@ -221,7 +227,10 @@ class Cluster(topologic.Cluster):
221
227
  resultingCluster = Topology.Boolean(allFacesCluster, shellCluster, operation="Difference")
222
228
  if isinstance(resultingCluster, topologic.Face):
223
229
  return [resultingCluster]
224
- return Topology.SubTopologies(resultingCluster, subTopologyType="face")
230
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="face")
231
+ if not result:
232
+ return [] #Make sure you return an empty list instead of None
233
+ return result
225
234
 
226
235
  @staticmethod
227
236
  def FreeWires(cluster):
@@ -259,7 +268,10 @@ class Cluster(topologic.Cluster):
259
268
  resultingCluster = Topology.Boolean(allWiresCluster, facesCluster, operation="Difference")
260
269
  if isinstance(resultingCluster, topologic.Wire):
261
270
  return [resultingCluster]
262
- return Topology.SubTopologies(resultingCluster, subTopologyType="wire")
271
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="wire")
272
+ if not result:
273
+ return [] #Make sure you return an empty list instead of None
274
+ return result
263
275
 
264
276
  @staticmethod
265
277
  def FreeEdges(cluster):
@@ -297,7 +309,10 @@ class Cluster(topologic.Cluster):
297
309
  resultingCluster = Topology.Boolean(allEdgesCluster, wireCluster, operation="Difference")
298
310
  if isinstance(resultingCluster, topologic.Edge):
299
311
  return [resultingCluster]
300
- return Topology.SubTopologies(resultingCluster, subTopologyType="edge")
312
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="edge")
313
+ if not result:
314
+ return [] #Make sure you return an empty list instead of None
315
+ return result
301
316
 
302
317
  @staticmethod
303
318
  def FreeVertices(cluster):
@@ -335,7 +350,10 @@ class Cluster(topologic.Cluster):
335
350
  resultingCluster = Topology.Boolean(allVerticesCluster, edgesCluster, operation="Difference")
336
351
  if isinstance(resultingCluster, topologic.Vertex):
337
352
  return [resultingCluster]
338
- return Topology.SubTopologies(resultingCluster, subTopologyType="vertex")
353
+ result = Topology.SubTopologies(resultingCluster, subTopologyType="vertex")
354
+ if not result:
355
+ return [] #Make sure you return an empty list instead of None
356
+ return result
339
357
 
340
358
  @staticmethod
341
359
  def HighestType(cluster):
topologicpy/Context.py CHANGED
@@ -3,29 +3,28 @@ import topologic
3
3
 
4
4
  class Context:
5
5
  @staticmethod
6
- def ByTopologyParameters(topology, u, v, w):
6
+ def ByTopologyParameters(topology, u = 0.5, v = 0.5, w = 0.5):
7
7
  """
8
+ Creates a context object represented by the input topology.
9
+
8
10
  Parameters
9
11
  ----------
10
- topology : TYPE
11
- DESCRIPTION.
12
- u : TYPE
13
- DESCRIPTION.
12
+ topology : topologic.Topology
13
+ The input topology.
14
+ u : float , optional
15
+ The input *u* parameter. This defines the relative parameteric location of the content object along the *u* axis.
14
16
  v : TYPE
15
- DESCRIPTION.
17
+ The input *v* parameter. This defines the relative parameteric location of the content object along the *v* axis..
16
18
  w : TYPE
17
- DESCRIPTION.
19
+ The input *w* parameter. This defines the relative parameteric location of the content object along the *w* axis.
18
20
 
19
21
  Returns
20
22
  -------
21
- context : TYPE
22
- DESCRIPTION.
23
+ topologic.Context
24
+ The created context object. See Aperture.ByObjectContext.
23
25
 
24
26
  """
25
- # topology = item[0]
26
- # u = item[1]
27
- # v = item[2]
28
- # w = item[3]
27
+
29
28
  context = None
30
29
  try:
31
30
  context = topologic.Context.ByTopologyParameters(topology, u, v, w)
@@ -34,20 +33,21 @@ class Context:
34
33
  return context
35
34
 
36
35
  @staticmethod
37
- def Topology(item):
36
+ def Topology(context):
38
37
  """
38
+ Returns the topology of the input context.
39
+
39
40
  Parameters
40
41
  ----------
41
- item : TYPE
42
- DESCRIPTION.
42
+ context : topologic.Context
43
+ The input context.
43
44
 
44
45
  Returns
45
46
  -------
46
- topology : TYPE
47
- DESCRIPTION.
47
+ topologic.Topology
48
+ The topology of the input context.
48
49
 
49
50
  """
50
- context = item
51
51
  topology = None
52
52
  try:
53
53
  topology = context.Topology()