Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
8e2e3fa7
Commit
8e2e3fa7
authored
Jul 30, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moar speedup by using numpy.fromiter instead of numpy.array
parent
1d3a2562
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
actors.py
printrun/gl/libtatlin/actors.py
+12
-6
No files found.
printrun/gl/libtatlin/actors.py
View file @
8e2e3fa7
...
...
@@ -427,10 +427,14 @@ class GcodeModel(Model):
self
.
count_travel_indices
=
count_travel_indices
self
.
count_print_indices
=
count_print_indices
self
.
count_print_vertices
=
count_print_vertices
self
.
travels
=
numpy
.
array
(
travel_vertex_list
,
dtype
=
GLfloat
)
self
.
vertices
=
numpy
.
array
(
vertex_list
,
dtype
=
GLfloat
)
self
.
indices
=
numpy
.
array
(
index_list
,
dtype
=
GLuint
)
self
.
colors
=
numpy
.
array
(
color_list
,
dtype
=
GLfloat
)
self
.
travels
=
numpy
.
fromiter
(
travel_vertex_list
,
dtype
=
GLfloat
,
count
=
len
(
travel_vertex_list
))
self
.
vertices
=
numpy
.
fromiter
(
vertex_list
,
dtype
=
GLfloat
,
count
=
len
(
vertex_list
))
self
.
indices
=
numpy
.
fromiter
(
index_list
,
dtype
=
GLuint
,
count
=
len
(
index_list
))
self
.
colors
=
numpy
.
fromiter
(
color_list
,
dtype
=
GLfloat
,
count
=
len
(
color_list
))
self
.
max_layers
=
len
(
self
.
layer_stops
)
-
1
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
...
...
@@ -652,8 +656,10 @@ class GcodeModelLight(Model):
if
callback
:
callback
(
layer_idx
+
1
,
num_layers
)
self
.
vertices
=
numpy
.
array
(
vertex_list
,
dtype
=
GLfloat
)
self
.
colors
=
numpy
.
array
(
color_list
,
dtype
=
GLfloat
)
self
.
vertices
=
numpy
.
fromiter
(
vertex_list
,
dtype
=
GLfloat
,
count
=
len
(
vertex_list
))
self
.
colors
=
numpy
.
fromiter
(
color_list
,
dtype
=
GLfloat
,
count
=
len
(
color_list
))
self
.
max_layers
=
len
(
self
.
layer_stops
)
-
1
self
.
num_layers_to_draw
=
self
.
max_layers
+
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment