As a trivial example, let's say I want a square and a diamond and I want the diamond's corner to touch the square on the side. It would look something like this:
square([10, 10], center=true); dx = 5 + 5 * sqrt(2); translate([dx, 0, 0]) rotate([0, 0, 45]) square([10, 10], center=true);
This is a simple case, but what if either shape is replaced with a hexagon, a gear, or a duck? What if I decide there should be some other shapes between them? What about...?
Ideally, it seems like I should be able to tell OpenSCAD that the square contains a reference point on one side, and one of the corners of the diamond is also a reference point, and OpenSCAD should translate the diamond however is needed to make those two reference points match.
Alternatively, I should use some other software that lets me do something like that.
cuboid([8,8,2]) align([RIGHT, FWD, TOP]) cuboid([5,5,2], spin=45);
You can't just write code to, for example, "put this line at a 56.7 degree angle and have it end 0.22mm from this surface". You have to break out the trigonometry to calculate how long that line needs to be.