chiark / gitweb /
sewing-table: NewEndProfile: scale to meet cutout_l_end_y
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Jun 2017 18:38:33 +0000 (19:38 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 6 Jun 2017 18:38:33 +0000 (19:38 +0100)
sewing-table.scad.m4

index 06302ee..74aea12 100644 (file)
@@ -482,7 +482,10 @@ module Machine_NewEndProfile(){
   sc = refline_mm / vectorlen2d(refline);
   sh = (0.5 * (endline[0] + endline[1])) - posbox;
 
-  scale(sc) rotate(rot + rot_adj) translate(-[sh[0],-sh[1]]){
+  ellen = sc * dist2d(endline[0],endline[1]);
+  scy = cutout_l_end_y / ellen;
+
+  scale([scy,1]) scale(sc) rotate(rot + rot_adj) translate(-[sh[0],-sh[1]]){
 
     mirror([0,1]){
   //%translate(1 * (posboxs[0] - posbox)) square(50);