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
422b1c35
Commit
422b1c35
authored
Jul 30, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flatten vertex list as well
parent
fa6f113a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
actors.py
printrun/gl/libtatlin/actors.py
+16
-16
No files found.
printrun/gl/libtatlin/actors.py
View file @
422b1c35
...
...
@@ -332,7 +332,7 @@ class GcodeModel(Model):
new_vertices
=
[]
if
prev_is_extruding
:
# Store previous vertices indices
first_prev
=
len
(
vertex_list
)
-
4
first_prev
=
len
(
vertex_list
)
/
3
-
4
# Average directions
avg_move_x
=
delta_x
+
prev_move_x
avg_move_y
=
delta_y
+
prev_move_y
...
...
@@ -350,11 +350,11 @@ class GcodeModel(Model):
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
avg_move_normal_x
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
avg_move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
avg_move_normal_y
new_vertices
.
app
end
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
app
end
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
new_vertices
.
ext
end
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
ext
end
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
/
3
# Link to previous
new_indices
+=
triangulate_rectangle
(
first_prev
,
first
,
first
+
1
,
first_prev
+
1
)
...
...
@@ -370,11 +370,11 @@ class GcodeModel(Model):
p2x
=
prev_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p1y
=
prev_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p2y
=
prev_pos
[
1
]
+
path_halfwidth
*
move_normal_y
new_vertices
.
app
end
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
app
end
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
new_vertices
.
ext
end
((
p1x
,
p1y
,
prev_pos
[
2
]
+
path_halfheight
))
new_vertices
.
ext
end
((
p1x
,
p1y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
prev_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
prev_pos
[
2
]
+
path_halfheight
))
first
=
len
(
vertex_list
)
/
3
new_indices
=
triangulate_rectangle
(
first
,
first
+
1
,
first
+
2
,
first
+
3
)
...
...
@@ -384,11 +384,11 @@ class GcodeModel(Model):
p2x
=
current_pos
[
0
]
+
path_halfwidth
*
move_normal_x
p1y
=
current_pos
[
1
]
-
path_halfwidth
*
move_normal_y
p2y
=
current_pos
[
1
]
+
path_halfwidth
*
move_normal_y
new_vertices
.
app
end
((
p1x
,
p1y
,
current_pos
[
2
]
+
path_halfheight
))
new_vertices
.
app
end
((
p1x
,
p1y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
app
end
((
p2x
,
p2y
,
current_pos
[
2
]
+
path_halfheight
))
end_first
=
len
(
vertex_list
)
+
len
(
new_vertices
)
-
4
new_vertices
.
ext
end
((
p1x
,
p1y
,
current_pos
[
2
]
+
path_halfheight
))
new_vertices
.
ext
end
((
p1x
,
p1y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
current_pos
[
2
]
-
path_halfheight
))
new_vertices
.
ext
end
((
p2x
,
p2y
,
current_pos
[
2
]
+
path_halfheight
))
end_first
=
len
(
vertex_list
)
/
3
+
len
(
new_vertices
)
/
3
-
4
new_indices
+=
triangulate_rectangle
(
end_first
+
3
,
end_first
+
2
,
end_first
+
1
,
end_first
)
new_indices
+=
triangulate_rectangle
(
first
,
end_first
,
...
...
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