Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebWeaver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fxk8y
WebWeaver
Compare revisions
0d731b0d1af352d7659311b7e0743b385646b1f9 to 642a59bf88389e94726239094fa263e87efce7ec
"home-profiles/git@git.c3pb.de:jens/dotfiles.git" did not exist on "f5c023bd6e9e141fe6cebaf94bb323c782589ccb"
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
fxk8y/WebWeaver
Select target project
No results found
642a59bf88389e94726239094fa263e87efce7ec
Select Git revision
Branches
master
Swap
Target
fxk8y/WebWeaver
Select target project
fxk8y/WebWeaver
1 result
0d731b0d1af352d7659311b7e0743b385646b1f9
Select Git revision
Branches
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Begin multi part rendering automation
· 642a59bf
fxk8y
authored
3 years ago
642a59bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripting/render.py
+80
-0
80 additions, 0 deletions
scripting/render.py
with
80 additions
and
0 deletions
scripting/render.py
0 → 100755
View file @
642a59bf
#!/usr/bin/env nix-shell
#!nix-shell -i python -p openscad "python3.withPackages(ps : with ps; [ pyyaml ])"
import
yaml
import
shutil
import
subprocess
class
OpenSCAD
:
def
__init__
(
self
):
self
.
__openscad
=
shutil
.
which
(
'
openscad
'
)
def
__call__
(
self
,
*
args
,
outfile
=
None
,
csglimit
=
None
,
**
kwargs
):
'''
args are added at the end, kwargs are used to add variable overrides
'''
cmd
=
[
self
.
__openscad
]
# Can we do better instead of replicating this all over the place???
if
csglimit
is
not
None
:
cmd
+=
[
f
'
--csglimit=
{
csglimit
}
'
]
for
k
,
v
in
kwargs
.
items
():
cmd
+=
[
'
-D
'
,
f
'
{
k
}
=
"
{
v
}
"'
]
if
outfile
is
not
None
:
cmd
+=
[
'
-o
'
,
outfile
]
cmd
+=
args
print
(
f
'
Running OpenSCAD:
{
cmd
}
'
)
# TODO: remove after debugging?!
return
subprocess
.
Popen
(
cmd
).
communicate
()
def
main
():
# TODO: Error check for missing files!
with
open
(
'
parts.yml
'
,
'
r
'
)
as
f
:
parts
=
yaml
.
safe_load
(
f
)
# print(parts)
scad
=
OpenSCAD
()
for
part
in
parts
:
# TODO: error check for missing attributes!
name
=
part
[
'
name
'
]
file
=
part
[
'
file
'
]
outfile
=
part
[
'
outfile
'
]
del
part
[
'
name
'
]
del
part
[
'
file
'
]
del
part
[
'
outfile
'
]
vars
=
part
vars
[
'
$part
'
]
=
name
scad
(
file
,
outfile
=
outfile
,
**
vars
)
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.