Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNino van Hooff <ninovanhooff@gmail.com>2020-05-15 14:53:10 +0300
committerNino van Hooff <ninovanhooff@gmail.com>2020-05-15 14:53:10 +0300
commitd96359f208dc6585886e58ce67c877f0c9c27f16 (patch)
tree2f8e2c6b63525747fe1657adef1860e2271b5275 /plugins/TrimeshReader
parent8e347c103463147747543cd072a4037c83629433 (diff)
Convert doxygen to rst for Toolbox, TrimeshReader
Diffstat (limited to 'plugins/TrimeshReader')
-rw-r--r--plugins/TrimeshReader/TrimeshReader.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/plugins/TrimeshReader/TrimeshReader.py b/plugins/TrimeshReader/TrimeshReader.py
index 6ed7435f88..f746c55cc5 100644
--- a/plugins/TrimeshReader/TrimeshReader.py
+++ b/plugins/TrimeshReader/TrimeshReader.py
@@ -22,8 +22,10 @@ from cura.Scene.SliceableObjectDecorator import SliceableObjectDecorator # Adde
if TYPE_CHECKING:
from UM.Scene.SceneNode import SceneNode
-## Class that leverages Trimesh to import files.
+
class TrimeshReader(MeshReader):
+ """Class that leverages Trimesh to import files."""
+
def __init__(self) -> None:
super().__init__()
@@ -79,11 +81,13 @@ class TrimeshReader(MeshReader):
)
)
- ## Reads a file using Trimesh.
- # \param file_name The file path. This is assumed to be one of the file
- # types that Trimesh can read. It will not be checked again.
- # \return A scene node that contains the file's contents.
def _read(self, file_name: str) -> Union["SceneNode", List["SceneNode"]]:
+ """Reads a file using Trimesh.
+
+ :param file_name: The file path. This is assumed to be one of the file
+ types that Trimesh can read. It will not be checked again.
+ :return: A scene node that contains the file's contents.
+ """
# CURA-6739
# GLTF files are essentially JSON files. If you directly give a file name to trimesh.load(), it will
# try to figure out the format, but for GLTF, it loads it as a binary file with flags "rb", and the json.load()
@@ -130,13 +134,14 @@ class TrimeshReader(MeshReader):
node.setParent(group_node)
return group_node
- ## Converts a Trimesh to Uranium's MeshData.
- # \param tri_node A Trimesh containing the contents of a file that was
- # just read.
- # \param file_name The full original filename used to watch for changes
- # \return Mesh data from the Trimesh in a way that Uranium can understand
- # it.
def _toMeshData(self, tri_node: trimesh.base.Trimesh, file_name: str = "") -> MeshData:
+ """Converts a Trimesh to Uranium's MeshData.
+
+ :param tri_node: A Trimesh containing the contents of a file that was just read.
+ :param file_name: The full original filename used to watch for changes
+ :return: Mesh data from the Trimesh in a way that Uranium can understand it.
+ """
+
tri_faces = tri_node.faces
tri_vertices = tri_node.vertices