Commit 6bde8108 authored by Kaspar Emanuel's avatar Kaspar Emanuel

Add optics to ninja build

parent 8a1fff72
...@@ -18,6 +18,7 @@ body_versions = [ ...@@ -18,6 +18,7 @@ body_versions = [
for size, motors, brim in body_versions: for size, motors, brim in body_versions:
output = "build/main_body_LS" + size + motors + brim + ".stl"
parameters = ["-D big_stage=true"] parameters = ["-D big_stage=true"]
if brim == "": if brim == "":
...@@ -32,8 +33,6 @@ for size, motors, brim in body_versions: ...@@ -32,8 +33,6 @@ for size, motors, brim in body_versions:
else: else:
parameters.append("-D motor_lugs=true") parameters.append("-D motor_lugs=true")
output = "build/main_body_LS" + size + motors + brim + ".stl"
ninja.build( ninja.build(
output, output,
rule="openscad", rule="openscad",
...@@ -42,5 +41,32 @@ for size, motors, brim in body_versions: ...@@ -42,5 +41,32 @@ for size, motors, brim in body_versions:
) )
cameras = ["picamera_2", "logitech_c270", "m12"]
rms_lenses = ["rms_f40d16", "rms_f50d13", "rms_infinity_f50d13"]
optics_versions = [
("picamera_2", "pilens"),
("logitech_c270", "c270_lens"),
("m12", "m12_lens"),
] + [(camera, lens) for camera in cameras for lens in rms_lenses]
for (camera, lens) in optics_versions:
output = f"build/optics_{camera}_{lens}_LS65.stl"
parameters = ["-D big_stage=true", "-D sample_z=65"]
parameters.append(f"-D 'optics=\"{lens}\"'")
parameters.append(f"-D 'camera=\"{camera}\"'")
ninja.build(
output,
rule="openscad",
inputs="openscad/optics.scad",
variables={"parameters": " ".join(parameters)},
)
stand_versions = ["LS65-30", "LS65-160"]
sample_riser_versions = ["LS10"]
slide_riser_versions = ["LS10"]
build_file.close() build_file.close()
run_build() run_build()
...@@ -80,6 +80,7 @@ def optics_module_parameters(version): ...@@ -80,6 +80,7 @@ def optics_module_parameters(version):
) )
p = {"camera": m.group(1), "optics": m.group(2)} p = {"camera": m.group(1), "optics": m.group(2)}
p.update(body_parameters(m.group(3))) p.update(body_parameters(m.group(3)))
print(p)
return p return p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment