update build script with openscad-nightly option

This commit is contained in:
zhao
2023-06-17 15:17:03 -04:00
parent acfa26623f
commit 064e43397f
46 changed files with 26 additions and 14 deletions

2
.gitignore vendored
View File

@ -2,9 +2,7 @@
[#]*
.idea
**/stl/*
!/stl/mini/
!/stl/micro/
!/stl/nano/

View File

@ -56,14 +56,15 @@ Requirements:
### Examples:
Generate all project files for the `micro` profile:
`python3 rbuild.py -b all -c micro -t custom`
This will build all the required STLs for a micro rack in the `stl/custom/` directory.
`python3 rbuild.py -b all --nightly -c micro`
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:
`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
[rack/profiles.scad](rack/profiles.scad).

0
helper/filet.scad Normal file
View File

View File

@ -62,6 +62,12 @@ def main():
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()
run_build(args)
@ -72,6 +78,7 @@ def run_build(args):
config_var = args.c
target_var = args.t
dz = args.dz
nightly = args.nightly
if target_var != "":
final_target_directory_name = target_var
@ -89,10 +96,10 @@ def run_build(args):
if build_var == 'all':
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):
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
filename_rack = find_rack(build_var)
@ -103,16 +110,16 @@ def run_build(args):
return
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:
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)
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):
@ -154,8 +161,14 @@ def find_scad_file(directory, filename):
return None
def run_openscad(options):
command = ['openscad', '-q', '--export-format', 'binstl'] + options
def run_openscad(options, nightly):
if nightly:
command = ['openscad-nightly', '--enable', 'all']
else:
command = ['openscad']
command += ['-q', '--export-format', 'binstl'] + options
try:
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.