I cloned the repo and used a local model (Qwen 3.8 27B) on my 5090 and was able to mechanically translate most, but not all, of the OpenSCAD to cadquery, and verified that a few had sensible output (next I will work on the tilings, I'm a tiling nerd).
As an example, the dentist's square code looks quite reasonable to me (I'm a python programmer by choice):
"""
dentist_square.py
=================
CADQuery port of ``dentist_square.scad`` -- a "quad from the dentist's office":
four small hollow squares in a 2x2 grid plus one larger hollow square in the
centre, each with a thin rim on top.
"""
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import cq_common as C
# ---------------------------------------------------------------------------
# Parameters (from dentist_square.scad)
# ---------------------------------------------------------------------------
_EDGE_WIDTH = 3.5
_SMALL_SQUARE_WD = 18.5
_SMALL_SQUARE_H = 2
_BIG_SQUARE_WD = 28.5
_BIG_SQUARE_H = 2.6
_SMALL_SQUARE_SPACE = 22.5
_RIM_WIDTH = 0.4
def hollow_square(wd, h, edge_width):
"""A hollow square: a ``wd x wd`` box with a centred hole of
``wd - 2*edge_width``."""
outer = C.cube(wd, wd, h, centered=False)
inner = C.cube(wd - 2 * edge_width, wd - 2 * edge_width, h + 0.01, centered=False)
inner = C.translate(inner, (edge_width, edge_width, 0.0))
return C.difference(outer, inner)
def hollow_square_with_rim(wd, h, edge_width, rim_width):
"""A hollow square with a thin rim (a second, thinner hollow square) on top."""
base = hollow_square(wd, h, edge_width)
rim = C.translate(hollow_square(wd, 0.2, rim_width), (0, 0, h))
return C.union(base, rim)
def four_hollow_squares(wd, h, space, edge_width, rim_width):
shapes = []
for x in range(2):
for y in range(2):
sq = hollow_square_with_rim(wd, h, edge_width, rim_width)
shapes.append(C.translate(sq, (x * space, y * space, 0.0)))
return C.union(*shapes)
def five_square(small_wd, big_wd, small_h, big_h, space, edge_width, rim_width):
center = (space + small_wd) / 2.0
four = four_hollow_squares(small_wd, small_h, space, edge_width, rim_width)
big = C.translate(
hollow_square_with_rim(big_wd, big_h, edge_width, rim_width),
(center - big_wd / 2.0, center - big_wd / 2.0, 0.0),
)
return C.union(four, big)
def main():
return five_square(
_SMALL_SQUARE_WD, _BIG_SQUARE_WD, _SMALL_SQUARE_H, _BIG_SQUARE_H,
_SMALL_SQUARE_SPACE, _EDGE_WIDTH, _RIM_WIDTH,
)
if __name__ == "__main__":
shape = main()
out_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "stl")
os.makedirs(out_dir, exist_ok=True)
path = os.path.join(out_dir, "dentist_square.stl")
C.export_stl(shape, path)
print(f"Exported {path} (volume {shape.Volume():.2f} mm^3)")