Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/3MFReader/ThreeMFReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def _convertSavitarNodeToUMNode(savitar_node: Savitar.SceneNode, file_name: str

mesh_data = savitar_node.getMeshData()

vertices_data = numpy.fromstring(mesh_data.getFlatVerticesAsBytes(), dtype=numpy.float32)
vertices_data = numpy.frombuffer(mesh_data.getFlatVerticesAsBytes(), dtype=numpy.float32)
vertices = numpy.resize(vertices_data, (int(vertices_data.size / 3), 3))

texture_path = mesh_data.getTexturePath(scene)
uv_data = numpy.fromstring(mesh_data.getUVCoordinatesPerVertexAsBytes(scene), dtype=numpy.float32)
uv_data = numpy.frombuffer(mesh_data.getUVCoordinatesPerVertexAsBytes(scene), dtype=numpy.float32)
uv_coordinates = numpy.resize(uv_data, (int(uv_data.size / 2), 2))

mesh_builder.setVertices(vertices)
Expand Down
10 changes: 5 additions & 5 deletions plugins/CuraEngineBackend/ProcessSlicedLayersJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,23 @@ def run(self):

extruder = polygon.extruder

line_types = numpy.fromstring(polygon.line_type, dtype = "u1") # Convert bytearray to numpy array
line_types = numpy.frombuffer(polygon.line_type, dtype = "u1") # Convert bytearray to numpy array

line_types = line_types.reshape((-1,1))

points = numpy.fromstring(polygon.points, dtype = "f4") # Convert bytearray to numpy array
points = numpy.frombuffer(polygon.points, dtype = "f4") # Convert bytearray to numpy array
if polygon.point_type == 0: # Point2D
points = points.reshape((-1,2)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.
else: # Point3D
points = points.reshape((-1,3))

line_widths = numpy.fromstring(polygon.line_width, dtype = "f4") # Convert bytearray to numpy array
line_widths = numpy.frombuffer(polygon.line_width, dtype = "f4") # Convert bytearray to numpy array
line_widths = line_widths.reshape((-1,1)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.

line_thicknesses = numpy.fromstring(polygon.line_thickness, dtype = "f4") # Convert bytearray to numpy array
line_thicknesses = numpy.frombuffer(polygon.line_thickness, dtype = "f4") # Convert bytearray to numpy array
line_thicknesses = line_thicknesses.reshape((-1,1)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.

line_feedrates = numpy.fromstring(polygon.line_feedrate, dtype = "f4") # Convert bytearray to numpy array
line_feedrates = numpy.frombuffer(polygon.line_feedrate, dtype = "f4") # Convert bytearray to numpy array
line_feedrates = line_feedrates.reshape((-1,1)) # We get a linear list of pairs that make up the points, so make numpy interpret them correctly.

# Create a new 3D-array, copy the 2D points over and insert the right height.
Expand Down
Loading