halfedge 0.5.1__py3-none-any.whl → 0.6.0__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.
- halfedge/type_attrib.py +28 -4
- {halfedge-0.5.1.dist-info → halfedge-0.6.0.dist-info}/METADATA +1 -1
- {halfedge-0.5.1.dist-info → halfedge-0.6.0.dist-info}/RECORD +5 -5
- {halfedge-0.5.1.dist-info → halfedge-0.6.0.dist-info}/WHEEL +0 -0
- {halfedge-0.5.1.dist-info → halfedge-0.6.0.dist-info}/top_level.txt +0 -0
halfedge/type_attrib.py
CHANGED
|
@@ -79,7 +79,7 @@ class StaticAttrib(Generic[_T]):
|
|
|
79
79
|
merged or split.
|
|
80
80
|
"""
|
|
81
81
|
|
|
82
|
-
__slots__ = ("_value", "
|
|
82
|
+
__slots__ = ("_value", "_mesh")
|
|
83
83
|
|
|
84
84
|
def __new__(
|
|
85
85
|
cls: type[_TStaticAttrib],
|
|
@@ -99,7 +99,7 @@ class StaticAttrib(Generic[_T]):
|
|
|
99
99
|
) -> None:
|
|
100
100
|
"""Set value and mesh."""
|
|
101
101
|
self._value = value
|
|
102
|
-
self.
|
|
102
|
+
self._mesh = mesh
|
|
103
103
|
|
|
104
104
|
def copy_to_element(
|
|
105
105
|
self: StaticAttrib[_T], mesh: BlindHalfEdges
|
|
@@ -127,6 +127,18 @@ class StaticAttrib(Generic[_T]):
|
|
|
127
127
|
msg = "no value set and failed to infer from 'self.mesh'"
|
|
128
128
|
raise AttributeError(msg)
|
|
129
129
|
|
|
130
|
+
@property
|
|
131
|
+
def mesh(self) -> BlindHalfEdges:
|
|
132
|
+
"""Return the mesh to which this attribute is assigned.
|
|
133
|
+
|
|
134
|
+
:return: BlindHalfEdges instance
|
|
135
|
+
:raise AttributeError: If no mesh is set
|
|
136
|
+
"""
|
|
137
|
+
if self._mesh is None:
|
|
138
|
+
msg = "no mesh set"
|
|
139
|
+
raise AttributeError(msg)
|
|
140
|
+
return self._mesh
|
|
141
|
+
|
|
130
142
|
def _infer_value(self) -> _T:
|
|
131
143
|
"""Get value of self from self._mesh.
|
|
132
144
|
|
|
@@ -181,7 +193,7 @@ class Attrib(Generic[_T]):
|
|
|
181
193
|
every case.
|
|
182
194
|
"""
|
|
183
195
|
|
|
184
|
-
__slots__ = ("_value", "
|
|
196
|
+
__slots__ = ("_value", "_element")
|
|
185
197
|
|
|
186
198
|
def __new__(
|
|
187
199
|
cls: type[_TAttrib],
|
|
@@ -201,7 +213,7 @@ class Attrib(Generic[_T]):
|
|
|
201
213
|
) -> None:
|
|
202
214
|
"""Set value and element."""
|
|
203
215
|
self._value = value
|
|
204
|
-
self.
|
|
216
|
+
self._element = element
|
|
205
217
|
|
|
206
218
|
@property
|
|
207
219
|
def value(self) -> _T:
|
|
@@ -219,6 +231,18 @@ class Attrib(Generic[_T]):
|
|
|
219
231
|
msg = "no value set and failed to infer from 'self.element'"
|
|
220
232
|
raise AttributeError(msg)
|
|
221
233
|
|
|
234
|
+
@property
|
|
235
|
+
def element(self) -> MeshElementBase:
|
|
236
|
+
"""Return the element to which this attribute is assigned.
|
|
237
|
+
|
|
238
|
+
:return: MeshElementBase instance
|
|
239
|
+
:raise AttributeError: If no element is set
|
|
240
|
+
"""
|
|
241
|
+
if self._element is None:
|
|
242
|
+
msg = "no element set"
|
|
243
|
+
raise AttributeError(msg)
|
|
244
|
+
return self._element
|
|
245
|
+
|
|
222
246
|
def copy_to_element(self: Attrib[_T], element: MeshElementBase) -> Attrib[_T]:
|
|
223
247
|
"""Return a new instance with the same value, assigned to a new element.
|
|
224
248
|
|
|
@@ -4,9 +4,9 @@ halfedge/half_edge_elements.py,sha256=6PkPjGxe_0FYSWXi5MY8Yp4an7yYMWir8MPZn8QlUO
|
|
|
4
4
|
halfedge/half_edge_object.py,sha256=Cc1t_hy2tF52O9iD5tvZN6_w4H7Wt9hwDGFLdBqUxr4,28451
|
|
5
5
|
halfedge/half_edge_querries.py,sha256=q5xVOFdpw7t6fhs-Z8yF5j3RlG4DOrOgoLbBsAfkm4A,5179
|
|
6
6
|
halfedge/py.typed,sha256=MsSFjiLMLJZ7QhUPpVBWKiyDnCzryquRyr329NoCACI,2
|
|
7
|
-
halfedge/type_attrib.py,sha256=
|
|
7
|
+
halfedge/type_attrib.py,sha256=1W06nlyTSc0Q6f6PnQec_VNNRLVSgdNStoBlJmMgJNQ,20420
|
|
8
8
|
halfedge/validations.py,sha256=FhUv_J7XcaAduyudYGmi7ZL1tEqwJoCxKZwJU2zQolg,4512
|
|
9
|
-
halfedge-0.
|
|
10
|
-
halfedge-0.
|
|
11
|
-
halfedge-0.
|
|
12
|
-
halfedge-0.
|
|
9
|
+
halfedge-0.6.0.dist-info/METADATA,sha256=G5Ee4xaYWSU7gN4BXPuSjquALcOBy3-xWAsxxvmBa-c,7411
|
|
10
|
+
halfedge-0.6.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
11
|
+
halfedge-0.6.0.dist-info/top_level.txt,sha256=iqphKHiIR4DfFMs14-gkFOWTXVkRWfGmDZmCYHhuoFM,9
|
|
12
|
+
halfedge-0.6.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|