• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

haiiliin / abqpy / 17186293454

24 Aug 2025 08:17AM UTC coverage: 77.594%. Remained the same
17186293454

Pull #6241

github

web-flow
Merge 6d914c07b into 256975e60
Pull Request #6241: fix: some annotations for `radius` and `center`

5 of 5 new or added lines in 4 files covered. (100.0%)

4 existing lines in 1 file now uncovered.

25215 of 32496 relevant lines covered (77.59%)

0.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.05
/src/abaqus/BasicGeometry/VertexArray.py
1
from __future__ import annotations
1✔
2

3
from typing import List, Sequence, Union, overload
1✔
4

5
from abqpy.decorators import abaqus_class_doc, abaqus_method_doc
1✔
6

7
from ..Sketcher.ConstrainedSketchVertex.ConstrainedSketchVertex import (
1✔
8
    ConstrainedSketchVertex,
9
)
10
from ..UtilityAndView.abaqusConstants import Boolean
1✔
11
from .Vertex import Vertex
1✔
12

13

14
@abaqus_class_doc
1✔
15
class VertexArray(List[Vertex]):
1✔
16
    """The VertexArray is a sequence of ConstrainedSketchVertex objects. If the part is modified, then
17
    VertexArray must be updated for that part.
18

19
    .. note::
20
        This object can be accessed by::
21

22
            import part
23
            mdb.models[name].parts[name].allInternalSets[name].vertices
24
            mdb.models[name].parts[name].allSets[name].vertices
25
            mdb.models[name].parts[name].sets[name].vertices
26
            mdb.models[name].parts[name].vertices
27
            import assembly
28
            mdb.models[name].rootAssembly.allInstances[name].sets[name].vertices
29
            mdb.models[name].rootAssembly.allInstances[name].vertices
30
            mdb.models[name].rootAssembly.allInternalSets[name].vertices
31
            mdb.models[name].rootAssembly.allSets[name].vertices
32
            mdb.models[name].rootAssembly.instances[name].sets[name].vertices
33
            mdb.models[name].rootAssembly.instances[name].vertices
34
            mdb.models[name].rootAssembly.modelInstances[i].sets[name].vertices
35
            mdb.models[name].rootAssembly.modelInstances[i].vertices
36
            mdb.models[name].rootAssembly.sets[name].vertices
37
            mdb.models[name].rootAssembly.vertices
38
    """
39

40
    @abaqus_method_doc
1✔
41
    def __init__(self, vertices: list[Vertex]):
1✔
42
        """This method creates a VertexArray object.
43

44
        .. note::
45
            This function can be accessed by::
46

47
                part.VertexArray
48

49
        Parameters
50
        ----------
51
        vertices
52
            A list of ConstrainedSketchVertex objects.
53

54
        Returns
55
        -------
56
        VertexArray
57
            A VertexArray object.
58
        """
59
        ...
60

61
    @overload
62
    @abaqus_method_doc
63
    def findAt(
64
        self,
65
        coordinates: tuple[float, float, float],
66
        printWarning: Boolean = True,
67
    ) -> ConstrainedSketchVertex: ...
68

69
    @overload
70
    @abaqus_method_doc
71
    def findAt(
72
        self,
73
        coordinates: tuple[tuple[float, float, float],],
74
        printWarning: Boolean = True,
75
    ) -> list[ConstrainedSketchVertex]: ...
76

77
    @overload
78
    @abaqus_method_doc
79
    def findAt(
80
        self,
81
        *coordinates: tuple[tuple[float, float, float],],
82
        printWarning: Boolean = True,
83
    ) -> list[ConstrainedSketchVertex]: ...
84

85
    @abaqus_method_doc
1✔
86
    def findAt(self, *args, **kwargs) -> Union[ConstrainedSketchVertex, list[ConstrainedSketchVertex]]:
1✔
87
        """This method returns the object or objects in the VertexArray located at the given coordinates. findAt
88
        initially uses the ACIS tolerance of 1E-6. As a result, findAt returns any ConstrainedSketchVertex
89
        object that is at the arbitrary point specified or at a distance of less than 1E-6 from the arbitrary
90
        point. If nothing is found, findAt uses the tolerance for imprecise geometry (applicable only for
91
        imprecise geometric entities). findAt will always try to find objects among all the vertices in the part
92
        or assembly instance and will not restrict itself to a subset even if the VertexArray represents such
93
        subset.
94

95
        Parameters
96
        ----------
97
        coordinates
98
            A sequence of Floats specifying the **X**, **Y**, and **Z** coordinates of the object to
99
            find.findAt returns either a ConstrainedSketchVertex object or a sequence of ConstrainedSketchVertex objects based on the
100
            type of input.
101

102
            * If **coordinates** is a sequence of Floats, findAt returns the ConstrainedSketchVertex object at that point.
103

104
            * If you omit the **coordinates** keyword argument, findAt accepts as arguments a sequence of sequence
105
              of floats in the following format::
106

107
                verts = v.findAt(((20.19686, -169.513997, 27.798593), ),
108
                                ((19.657627, -167.295749, 27.056402), ),
109
                                ((18.274129, -157.144741, 25.15218), ))
110
        printWarning
111
            A Boolean specifying whether a message is to be printed to the CLI if no entity is found
112
            at the specified location. The default value is True.
113

114
        Returns
115
        -------
116
        ConstrainedSketchVertex
117
            A ConstrainedSketchVertex object or a sequence of ConstrainedSketchVertex objects..
118
        """
119
        first_arg = kwargs.get("coordinates", args[0] if args else ((),))
×
120
        return ConstrainedSketchVertex() if isinstance(first_arg[0], float) else [ConstrainedSketchVertex()]
×
121

122
    @overload
1✔
123
    @abaqus_method_doc
1✔
124
    def getSequenceFromMask(self, mask: str) -> ConstrainedSketchVertex:  # type: ignore
1✔
125
        ...
126

127
    @overload
1✔
128
    @abaqus_method_doc
1✔
129
    def getSequenceFromMask(self, mask: Sequence[str]) -> list[ConstrainedSketchVertex]:  # type: ignore
1✔
130
        ...
131

132
    @abaqus_method_doc
1✔
133
    def getSequenceFromMask(
1✔
134
        self, mask: Union[str, Sequence[str]]
135
    ) -> Union[ConstrainedSketchVertex, list[ConstrainedSketchVertex]]:  # type: ignore
136
        """This method returns the object or objects in the VertexArray identified using the specified **mask**.
137
        This command is generated when the JournalOptions are set to COMPRESSEDINDEX. When a large number of
138
        objects are involved, this method is highly efficient.
139

140
        Parameters
141
        ----------
142
        mask
143
            A String specifying the object or objects.
144

145
        Returns
146
        -------
147
        ConstrainedSketchVertex | list[ConstrainedSketchVertex]
148
            A ConstrainedSketchVertex object or a sequence of ConstrainedSketchVertex objects..
149
        """
150
        return ConstrainedSketchVertex() if isinstance(mask, str) else [ConstrainedSketchVertex()]
×
151

152
    @abaqus_method_doc
1✔
153
    def getMask(self) -> str:
1✔
154
        """This method returns a string specifying the object or objects.
155

156
        Returns
157
        -------
158
        str
159
            A String specifying the object or objects.
160
        """
161
        return ""
×
162

163
    @abaqus_method_doc
1✔
164
    def getByBoundingBox(
1✔
165
        self,
166
        xMin: float = 0,
167
        yMin: float = 0,
168
        zMin: float = 0,
169
        xMax: float = 0,
170
        yMax: float = 0,
171
        zMax: float = 0,
172
    ) -> VertexArray:
173
        """This method returns an array of vertex objects that lie within the specified bounding box.
174

175
        Parameters
176
        ----------
177
        xMin
178
            A float specifying the minimum **X** boundary of the bounding box.
179
        yMin
180
            A float specifying the minimum **Y** boundary of the bounding box.
181
        zMin
182
            A float specifying the minimum **Z** boundary of the bounding box.
183
        xMax
184
            A float specifying the maximum **X** boundary of the bounding box.
185
        yMax
186
            A float specifying the maximum **Y** boundary of the bounding box.
187
        zMax
188
            A float specifying the maximum **Z** boundary of the bounding box.
189

190
        Returns
191
        -------
192
        VertexArray
193
            A VertexArray object, which is a sequence of ConstrainedSketchVertex objects..
194
        """
195
        return VertexArray([Vertex()])
×
196

197
    @abaqus_method_doc
1✔
198
    def getByBoundingCylinder(self, center1: tuple, center2: tuple, radius: float) -> VertexArray:
1✔
199
        """This method returns an array of vertex objects that lie within the specified bounding cylinder.
200

201
        Parameters
202
        ----------
203
        center1
204
            A tuple of the **X**, **Y**, and **Z** coordinates of the center of the first end of the
205
            cylinder.
206
        center2
207
            A tuple of the **X**, **Y**, and **Z** coordinates of the center of the second end of the
208
            cylinder.
209
        radius
210
            A float specifying the radius of the cylinder.
211

212
        Returns
213
        -------
214
        VertexArray
215
            A VertexArray object, which is a sequence of ConstrainedSketchVertex objects..
216
        """
UNCOV
217
        return VertexArray([Vertex()])
×
218

219
    @abaqus_method_doc
1✔
220
    def getByBoundingSphere(self, center: tuple[float, float, float], radius: float) -> VertexArray:
1✔
221
        """This method returns an array of vertex objects that lie within the specified bounding sphere.
222

223
        Parameters
224
        ----------
225
        center
226
            A tuple of the **X**, **Y**, and **Z** coordinates of the center of the sphere.
227
        radius
228
            A float specifying the radius of the sphere.
229

230
        Returns
231
        -------
232
        VertexArray
233
            A VertexArray object, which is a sequence of ConstrainedSketchVertex objects..
234
        """
UNCOV
235
        return VertexArray([Vertex()])
×
236

237
    @abaqus_method_doc
1✔
238
    def getBoundingBox(self) -> dict[str, tuple[float, float, float]]:
1✔
239
        """This method returns a dictionary of two tuples representing minimum and maximum boundary values of
240
        the bounding box of the minimum size containing the vertex sequence.
241

242
        Returns
243
        -------
244
        dict[str, tuple[float, float, float]]
245
            A Dictionary object with the following items:
246

247
            - **low**: a tuple of three floats representing the minimum **X** -, **Y** -, and **Z** -boundary
248
              values of the bounding box.
249
            - **high**: a tuple of three floats representing the maximum **X** -, **Y** -, and **Z** -boundary
250
              values of the bounding box.
251
        """
UNCOV
252
        return {"low": (0.0, 0.0, 0.0), "high": (0.0, 0.0, 0.0)}
×
253

254
    @abaqus_method_doc
1✔
255
    def getClosest(self, coordinates: tuple, searchTolerance: str = "") -> dict[int, tuple[Vertex, tuple]]:
1✔
256
        """This method returns a object or objects in the VertexArray closest to the given set of points, where
257
        the given points need not lie on ConstrainedSketchVertex objects in the VertexArray.
258

259
        Parameters
260
        ----------
261
        coordinates
262
            A sequence of a sequence of floats, where each sequence of floats describes the **X**,
263
            **Y**, and **Z** coordinates of a point::
264

265
                >>> r=v.getClosest(coordinates=((20.0, 20.0, 10.0),(-1.0, -15.0, 15), ))
266
                >>> r.keys()
267
                [0, 1]
268
                >>> r[0]
269
                (mdb.models['Model-1'].parts['Part-1'].vertices[0], (15.7090625762939, 29.1666641235352, 20.0))
270
        searchTolerance
271
            A double specifying the distance within which the closest object must lie. The default
272
            value is half of the parent part/instance size.
273

274
        Returns
275
        -------
276
        dict
277
            This method returns a dictionary object. The key to the dictionary object is the
278
            position of the input point in the tuple specified in the **coordinates** starting at
279
            index 0. If a closest vertex could be found then the value is a sequence consisting of
280
            two objects. The first object in the sequence is a ConstrainedSketchVertex that is close to the input
281
            point referred to by the key. The second object in the sequence is a sequence of floats
282
            that specifies the **X**, **Y**, and **Z**  location of the ConstrainedSketchVertex. See program listing
283
            above.
284

285
        Raises
286
        ------
287
        Error
288
            The mask results in an empty sequence, An exception occurs if the resulting sequence is empty.
289
        """
UNCOV
290
        return {0: (Vertex(), (0.0, 0.0, 0.0))}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc