rhino3dm.MeshVertexList
- class rhino3dm.MeshVertexList
Provides access to the vertices and vertex-related functionality of a mesh.
- Add(vertex: Point3d) int
- Add(vertex: Point3f) int
- Add(x: float, y: float, z: float) int
Adds a new vertex to the end of the Vertex list.
- Parameters:
x – X component of new vertex coordinate.
y – Y component of new vertex coordinate.
z – Z component of new vertex coordinate.
- Returns:
The index of the newly added vertex.
- AddVertices(vertices: collections.abc.Sequence[Point3f]) None
Adds a series of new vertices to the end of the vertex list.
This overload accepts double-precision points.
- Parameters:
vertices – A list, an array or any enumerable set of
Point3d.
- Clear() None
Clears the Vertex list on the mesh.
- CombineIdentical(ignoreNormals: bool, ignoreAdditional: bool) bool
Merges identical vertices.
- Parameters:
ignoreNormals – If true, vertex normals will not be taken into consideration when comparing vertices.
ignoreAdditional – If true, texture coordinates, colors, and principal curvatures will not be taken into consideration when comparing vertices.
- Returns:
true if the mesh is changed, in which case the mesh will have fewer vertices than before.
- CullUnused() int
Removes all vertices that are currently not used by the Face list.
- Returns:
The number of unused vertices that were removed.
- Destroy() None
Releases all memory allocated to store faces. The list capacity will be 0 after this call.
Subsequent calls can add new items.
- Hide(vertexIndex: int) None
Hides the vertex at the given index.
- Parameters:
vertexIndex – Index of vertex to hide.
- HideAll() None
Hides all vertices in the mesh.
- IsHidden(vertexIndex: int) bool
Gets a value indicating whether or not a vertex is hidden.
- Parameters:
vertexIndex – Index of vertex to query.
- Returns:
true if the vertex is hidden, false if it is not.
- SetVertex(index: int, x: float, y: float, z: float) bool
- SetVertex(index: int, x: float, y: float, z: float, updateNormals: bool) bool
- SetVertex(index: int, vertex: Point3d) bool
- SetVertex(index: int, vertex: Point3f) bool
Sets or adds a vertex to the Vertex List.
If [index] is less than [Count], the existing vertex at [index] will be modified.
If [index] equals [Count], a new vertex is appended to the end of the vertex list.
If [index] is larger than [Count], the function will return false.
- Parameters:
index – Index of vertex to set.
vertex – Vertex location.
- Returns:
true on success, false on failure.
- Show(vertexIndex: int) None
Shows the vertex at the given index.
- Parameters:
vertexIndex – Index of vertex to show.
- ShowAll() None
Shows all vertices in the mesh.
- ToFloatArray() list[float]
Copies all vertices to a linear array of float in x,y,z order
- Returns:
The float array.
- ToPoint3dArray() list[Any]
Copies all vertices to a new array of
Point3d.- Returns:
A new array.
- ToPoint3fArray() list[Any]
Copies all vertices to a new array of
Point3f.- Returns:
A new array.
- property Capacity: int
Gets or sets the total number of vertices the internal data structure can hold without resizing.
- property Count: int
Gets or sets the number of mesh vertices.
- property UseDoublePrecisionVertices: bool
Set to true if the vertices should be stored in double precision