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
4ef27e5b
Commit
4ef27e5b
authored
Jul 30, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed things up a lot by not adding useless colors
parent
2d477e08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
actors.py
printrun/gl/libtatlin/actors.py
+18
-16
No files found.
printrun/gl/libtatlin/actors.py
View file @
4ef27e5b
...
@@ -329,6 +329,7 @@ class GcodeModel(Model):
...
@@ -329,6 +329,7 @@ class GcodeModel(Model):
path_halfheight
=
0.1
path_halfheight
=
0.1
new_indices
=
[]
new_indices
=
[]
new_vertices
=
[]
if
prev_is_extruding
:
if
prev_is_extruding
:
# Store previous vertices indices
# Store previous vertices indices
first_prev
=
len
(
vertex_list
)
-
4
first_prev
=
len
(
vertex_list
)
-
4
...
@@ -349,11 +350,11 @@ class GcodeModel(Model):
...
@@ -349,11 +350,11 @@ class GcodeModel(Model):
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
avg_move_normal_x
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
avg_move_normal_x
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
avg_move_normal_y
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
avg_move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
avg_move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
avg_move_normal_y
vertex_list
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
vertex_list
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
-
4
first
=
len
(
new_vertices
)
-
4
# Link to previous
# Link to previous
new_indices
+=
triangulate_rectangle
(
first_prev
,
first
,
new_indices
+=
triangulate_rectangle
(
first_prev
,
first
,
first
+
1
,
first_prev
+
1
)
first
+
1
,
first_prev
+
1
)
...
@@ -369,11 +370,11 @@ class GcodeModel(Model):
...
@@ -369,11 +370,11 @@ class GcodeModel(Model):
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
move_normal_y
vertex_list
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
vertex_list
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
-
4
first
=
len
(
new_vertices
)
-
4
new_indices
=
triangulate_rectangle
(
first
,
first
+
1
,
new_indices
=
triangulate_rectangle
(
first
,
first
+
1
,
first
+
2
,
first
+
3
)
first
+
2
,
first
+
3
)
...
@@ -383,11 +384,11 @@ class GcodeModel(Model):
...
@@ -383,11 +384,11 @@ class GcodeModel(Model):
p2x
=
current_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p2x
=
current_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p1y
=
current_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p1y
=
current_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p2y
=
current_pos
[
1
]
+
path_halfwidth
*
move_normal_y
p2y
=
current_pos
[
1
]
+
path_halfwidth
*
move_normal_y
vertex_list
.
append
((
p1x
,
p1y
,
current_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
current_pos
[
2
]
+
path_halfheight
))
vertex_list
.
append
((
p1x
,
p1y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p1x
,
p1y
,
current_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
current_pos
[
2
]
-
path_halfheight
))
vertex_list
.
append
((
p2x
,
p2y
,
current_pos
[
2
]
+
path_halfheight
))
new_vertices
.
append
((
p2x
,
p2y
,
current_pos
[
2
]
+
path_halfheight
))
end_first
=
len
(
vertex_list
)
-
4
end_first
=
len
(
new_vertices
)
-
4
new_indices
+=
triangulate_rectangle
(
end_first
+
3
,
end_first
+
2
,
new_indices
+=
triangulate_rectangle
(
end_first
+
3
,
end_first
+
2
,
end_first
+
1
,
end_first
)
end_first
+
1
,
end_first
)
new_indices
+=
triangulate_rectangle
(
first
,
end_first
,
new_indices
+=
triangulate_rectangle
(
first
,
end_first
,
...
@@ -400,8 +401,9 @@ class GcodeModel(Model):
...
@@ -400,8 +401,9 @@ class GcodeModel(Model):
end_first
,
first
)
end_first
,
first
)
index_list
+=
new_indices
index_list
+=
new_indices
vertex_list
+=
new_vertices
color_list
+=
[
gline_color
]
*
len
(
new_
ind
ices
)
color_list
+=
[
gline_color
]
*
len
(
new_
vert
ices
)
prev_is_extruding
=
True
prev_is_extruding
=
True
prev_move_x
=
delta_x
prev_move_x
=
delta_x
prev_move_y
=
delta_y
prev_move_y
=
delta_y
...
...
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