update build script with openscad-nightly option
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,9 +2,7 @@
|
|||||||
[#]*
|
[#]*
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
|
||||||
**/stl/*
|
**/stl/*
|
||||||
!/stl/mini/
|
!/stl/mini/
|
||||||
!/stl/micro/
|
!/stl/micro/
|
||||||
!/stl/nano/
|
!/stl/nano/
|
||||||
|
|
||||||
|
|||||||
@ -56,14 +56,15 @@ Requirements:
|
|||||||
### Examples:
|
### Examples:
|
||||||
Generate all project files for the `micro` profile:
|
Generate all project files for the `micro` profile:
|
||||||
|
|
||||||
`python3 rbuild.py -b all -c micro -t custom`
|
`python3 rbuild.py -b all --nightly -c micro`
|
||||||
|
|
||||||
This will build all the required STLs for a micro rack in the `stl/custom/` directory.
|
|
||||||
|
|
||||||
|
This will build all the required STLs for a micro rack in the `stl/custom/` directory. The `--nightly` is optional and
|
||||||
|
means the build script will use the `openscad-nightly` command, instead of `openscad`. This usually results in much
|
||||||
|
faster build times and is generally recommended.
|
||||||
|
|
||||||
For generating a specific part:
|
For generating a specific part:
|
||||||
|
|
||||||
`python3 rbuild.py -b yBar -c micro -t custom`
|
`python3 rbuild.py -b yBar --nightly -c micro -t custom`
|
||||||
|
|
||||||
Generated stls are put into the `stl/` directories. The actual variable values for different profiles can be found in
|
Generated stls are put into the `stl/` directories. The actual variable values for different profiles can be found in
|
||||||
[rack/profiles.scad](rack/profiles.scad).
|
[rack/profiles.scad](rack/profiles.scad).
|
||||||
0
helper/filet.scad
Normal file
0
helper/filet.scad
Normal file
29
rbuild.py
29
rbuild.py
@ -62,6 +62,12 @@ def main():
|
|||||||
help='Override number of rail screws (ie override rail height). Defaults to profile settings.'
|
help='Override number of rail screws (ie override rail height). Defaults to profile settings.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--nightly',
|
||||||
|
action='store_true',
|
||||||
|
help='Use openscad-nightly command. Should result in much faster build times.'
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
run_build(args)
|
run_build(args)
|
||||||
|
|
||||||
@ -72,6 +78,7 @@ def run_build(args):
|
|||||||
config_var = args.c
|
config_var = args.c
|
||||||
target_var = args.t
|
target_var = args.t
|
||||||
dz = args.dz
|
dz = args.dz
|
||||||
|
nightly = args.nightly
|
||||||
|
|
||||||
if target_var != "":
|
if target_var != "":
|
||||||
final_target_directory_name = target_var
|
final_target_directory_name = target_var
|
||||||
@ -89,10 +96,10 @@ def run_build(args):
|
|||||||
|
|
||||||
if build_var == 'all':
|
if build_var == 'all':
|
||||||
for dir_file in os.listdir(RACK_BUILD_DIR):
|
for dir_file in os.listdir(RACK_BUILD_DIR):
|
||||||
build_single(RACK_BUILD_DIR, rackBuildDirFull, dir_file, config_var, dz)
|
build_single(RACK_BUILD_DIR, rackBuildDirFull, dir_file, config_var, dz, nightly)
|
||||||
|
|
||||||
for dir_file in os.listdir(RACK_MOUNT_BUILD_DIR):
|
for dir_file in os.listdir(RACK_MOUNT_BUILD_DIR):
|
||||||
build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, dir_file, config_var, dz)
|
build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, dir_file, config_var, dz, nightly)
|
||||||
return
|
return
|
||||||
|
|
||||||
filename_rack = find_rack(build_var)
|
filename_rack = find_rack(build_var)
|
||||||
@ -103,16 +110,16 @@ def run_build(args):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if filename_rack:
|
if filename_rack:
|
||||||
build_single(RACK_BUILD_DIR, rackBuildDirFull, filename_rack, config_var, dz)
|
build_single(RACK_BUILD_DIR, rackBuildDirFull, filename_rack, config_var, dz, nightly)
|
||||||
|
|
||||||
if filename_rack_mount:
|
if filename_rack_mount:
|
||||||
build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, filename_rack, config_var, dz)
|
build_single(RACK_MOUNT_BUILD_DIR, rackMountBuildDirFull, filename_rack, config_var, dz, nightly)
|
||||||
|
|
||||||
|
|
||||||
def build_single(build_dir, target_dir, filename, config, dz):
|
def build_single(build_dir, target_dir, filename, config, dz, nightly):
|
||||||
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
||||||
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz)
|
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz)
|
||||||
run_openscad(openscad_args)
|
run_openscad(openscad_args, nightly)
|
||||||
|
|
||||||
|
|
||||||
def construct_openscad_args(build_dir, target_dir, filename, config, dz):
|
def construct_openscad_args(build_dir, target_dir, filename, config, dz):
|
||||||
@ -154,8 +161,14 @@ def find_scad_file(directory, filename):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def run_openscad(options):
|
def run_openscad(options, nightly):
|
||||||
command = ['openscad', '-q', '--export-format', 'binstl'] + options
|
|
||||||
|
if nightly:
|
||||||
|
command = ['openscad-nightly', '--enable', 'all']
|
||||||
|
else:
|
||||||
|
command = ['openscad']
|
||||||
|
|
||||||
|
command += ['-q', '--export-format', 'binstl'] + options
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(command, universal_newlines=True, stderr=subprocess.DEVNULL)
|
subprocess.check_output(command, universal_newlines=True, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user