Hacker News new | ask | show | jobs
by sokoloff 654 days ago
The low amount of training data is definitely one issue, but I also think back to the SCAD I've written and it's not got very much in the way of English prompt-friendly text in it to "guide" the LLM towards using it.

Arguably, this might mean I don't comment the code "enough", but in other languages, the variable names and overall structure seem to carry a lot of that for the human programmer and also in a way that guides an LLM towards effectively using it. I don't know much about how LLM's work internally either, but I picked a random SCAD file of mine and I don't know how it'd be found to create a PCB spacer with generous clearance for an M3 screw.

  $fn = 90;
  
  outer = 4.5 + 1.6;
  inner = 4.5;
  h = 13.5;
  
  //round = true;
  //square = true;
  hex = true;
  
  if (square)
    difference() {
      cube(size = [outer, outer, h]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
      translate([(outer-inner)/2, (outer-inner)/2,-0.05]) cube(size = [inner, inner, h+1]);
    }

  if (round)
    translate([0,15,0])
      difference() {
        cylinder(d = outer, h = h);
        translate([0,0,-0.05]) cylinder(d = inner, h = h+1);
      }

  if (hex) translate([0,30,0])
    difference() {
      cylinder(d = outer*1.25, h = h, $fn=6);
      translate([0,0,-0.05]) cylinder(d = inner*1.25, h = h+1, $fn=6);
    }