Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bigprint
twins-controller
Commits
cc94368a
Commit
cc94368a
authored
Mar 20, 2020
by
Jayant Khatkar
Browse files
progress towards getting infill working
parent
28e92c3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
gcode/gen_cube3d.py
View file @
cc94368a
...
...
@@ -186,6 +186,40 @@ class solver:
return
contours
def
infill_contour
(
self
,
n
,
density
):
"""
return one contour for the infill
if n is even, the infill for that layer is parallel to the x-axis
"""
# Get the direction to print in
if
n
%
2
==
0
:
main
=
self
.
x
other
=
self
.
y
else
:
main
=
self
.
y
other
=
self
.
x
# get the list of rows to do
main_vals
=
np
.
arange
(
self
.
range
[
main
][
0
],
self
.
range
[
main
][
1
],
density
)[
1
:]
# do the first row
expr1
=
self
.
plane_intersection
(
main
,
main_vals
[
0
],
layer
=
n
)
os
,
zs
=
self
.
sample
(
expr1
,
other
)
poses
=
[
Position
(
self
.
range
[
main
][
0
],
os
[
i
],
zs
[
i
])
for
i
in
range
(
len
(
os
))]
# loop through th remaining rows, linking them
for
row
in
main_vals
[
1
:]:
# TODO link to the next row
# TODO do the next row (need to reverse directions each time)
expr1
=
self
.
plane_intersection
(
main
,
row
,
layer
=
n
)
os
,
zs
=
self
.
sample
(
expr1
,
other
)
poses
=
[
Position
(
self
.
range
[
main
][
0
],
os
[
i
],
zs
[
i
])
for
i
in
range
(
len
(
os
))]
def
show
(
self
):
"""
Show the surface of the layer
...
...
@@ -202,5 +236,6 @@ if __name__ == '__main__':
contours
=
[]
for
i
in
np
.
arange
(
-
15
,
55
):
contours
+=
s
.
contour_n
(
i
)
contours
+=
s
.
infill_contour
(
i
,
0.02
)
plot_contours
(
contours
)
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