[User]
I'd like to create a customizable 2D origami-style sitting bunny design using OpenSCAD.  I need to be able to control the overall size of the bunny, the thickness of both the outer and inner outlines, and the roundness of the inner outline edges. The design is based on a set of coordinates and polygons, and it should be scalable. I'm looking for a parametric OpenSCAD file that allows me to adjust these parameters.

Specifically, I need:

*   **Overall Size:**  I need to be able to specify the maximum dimension (either length or width), and the model should scale proportionally, maintaining the original aspect ratio. I'll also need a parameter to control the height (thickness) of the 2D piece.
*   **Outline Thickness:** I need independent parameters to control the thickness of the outer outline and the inner outline.
*   **Inner Outline Roundness:** I need a parameter to control the radius of the roundness of the inner outline edges.
*   **Flipping:** I need an option to flip the model horizontally, in the case that I want to mirror the design.
*   **Coordinate Data:** The bunny's shape is determined by a set of coordinates for the outer outline, as well as polygons that define the cutouts. This data needs to be incorporated into the OpenSCAD file so that the design will be accurate, and will change only according to the parameters mentioned above.
*   **Libraries:** I don't think I need any special libraries for this design.

Could you generate an OpenSCAD file that implements these parameters and creates the 2D origami sitting bunny?

[Assistant]
customizable_origami_sitting_bunny.scad:
```
/*
 * Customizable Origami - Sitting Bunny - https://www.thingiverse.com/thing:2705044
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-11
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 1.8; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.8; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.3; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [570, 1249];
A2 = [623, 1270];
A3 = [627, 1162];
A4 = [666, 1076];
A5 = [807, 923];
A6 = [1000, 868];
A7 = [1155, 373];
A8 = [1243, 272];
A9 = [1254, 358];
A10 = [1326, 301];
A11 = [1320, 596];
A12 = [1219, 689];
A13 = [1430, 905];
A14 = [1241, 1076];
A15 = [1225, 1138];
A16 = [1156, 1264];
A17 = [1196, 1319];
A18 = [1115, 1386];
A19 = [1126, 1399];
A20 = [1027, 1483];
A21 = [620, 1378];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21];

// Inner Points
B1 = [1064, 1389];
B2 = [1099, 1369];
B3 = [1122, 1317];
B4 = [1186, 1124];
B5 = [1017, 927];
B6 = [1272, 596];
B7 = [1201, 671];

// Polygons
C1 = [A6, A7, A8, A9, B6, B7];
C2 = [A9, A10, A11, A12, B7, B6];
C3 = [A6, B5, B4, A14, A13, A12, B7];
C4 = [B4, A14, A15];
C5 = [B4, B5, B3, A16, A15];
C6 = [A16, A17, A18, B2, B3];
C7 = [A19, A20, B1, A4, A5, B2, A18];
C8 = [A5, A6, B5, B3, B2];
C9 = [A4, B1, A20, A21, A2, A3];
C10 = [A2, A1, A21];

cut_polygons = [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10];

min_x = A1[0];
min_y = A8[1];
max_x = A13[0];
max_y = A20[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
I need an OpenSCAD design for a customizable dog tag. It should be a polygon with a specified number of sides, a diameter, and a thickness. The dog tag should have a hole for attaching to a keychain or collar. The hole's position should be selectable between two specific points on the polygon, either at one of the vertices or in the middle of one of the sides. Also, the design should include two lines of text, each with their own customizable size and position, and the position of both blocks should be controlled as a single offset.

Here's a breakdown of the features:

*   **Polygon Shape:**
    *   Number of sides (user-defined, between 3 and 20).
    *   Diameter (user-defined, between 30 and 80).
    *   Overall height/thickness (constant, I think you can specify this somewhere).
    *   A border/chamfer on the top side.
*   **Hole:**
    *   Diameter (constant).
    *   Position (user-selectable, either at a vertex or the middle of a side).
*   **Text:**
    *   Two lines of text (user-defined strings).
    *   Individual font sizes for each line (user-defined, between 4 and 10).
    *   Vertical spacing between the two lines (user-defined, between 0 and 8).
    *   Vertical offset of both text blocks (user-defined, between 0 and 8).
    *   Font type should be Arial Bold.
    *   Text should be centered horizontally.

I need all of these parameters to be customizable at the top of the file. Also, make sure the hole's diameter is separate from all of the other user-controlled parameters. For the hole, it would be okay to just specify a constant diameter and then a border for the through-hole. Make sure the actual hole is smaller than the border cylinder.

Also, for all of the parameters that should be controlled, include a comment specifying the acceptable range. For example, `//[3:20]` or something similar.

[Assistant]
Polygon_dogtag.scad:
```
//**********************************************************Design by 3 Eixos**********************************************************//
//**********************************************************Rodrigo Franco**********************************************************//

/* [Texto] */
//Primeira linha de texto
Texto_1="3 Eixos";
//Segunda linha de texto
Texto_2="99675-2252";
//Posição dos textos
TexPos = 1; //[0:8]
//Distancia entre textos
Tex_Dis = 5; // [0:8]
//tamanho fonte 1
Tam_Tex_1=7; //[4:10]
//tamanho fonte 2
Tam_Tex_2=4; //[4:10]
//Numero de lados do poligono
Numlado=11; //[3:20]
//Diametro da medalha
diameter=40; //[30:80]
//Posição do Furo
fur_pos="ponto1"; //[ponto1,ponto2]

/* [Config interna] */
linguagem="en";
numcam=6;
borda=2;
cambord=3;
furint=5;

//Texto
translate ([0,-TexPos,0]){
    linear_extrude (height=0.32*numcam){
        translate([0,1,0]){
    text (Texto_1, size=Tam_Tex_1, font="Arial:style=Bold",halign = "center", valign="bottom", language = linguagem);
        }
       translate ([0,-(Tex_Dis),0]){
    text (Texto_2, size=Tam_Tex_2, font="Arial:style=Bold",halign = "center", valign="top", language = linguagem);
       }
    }
}
//Medalha
    render(){
    if (fur_pos=="ponto1"){
    difference (){
    union(){
        rotate([0,0,-((Numlado-2)*90)/Numlado]){
    difference(){
    cylinder (h=numcam*0.32, d=diameter,$fn= Numlado);
        translate([0,0,(numcam-cambord)*0.32]){
        cylinder (h=cambord*0.32, d=diameter-(2*borda),$fn= Numlado);
        }
    }
}
    translate ([0,((diameter/2)-((furint/2)+(1.5*borda))),0]){
    cylinder (h=numcam*0.32, d=furint+(2*borda),$fn=30);
    }
}

    translate ([0,((diameter/2)-((furint/2)+(1.5*borda))),0]){
        cylinder (h=numcam*0.32, d=furint ,$fn=30);
    }
}
}
    else if (fur_pos=="ponto2"){
     difference (){
    union(){
        rotate([0,0,-((((Numlado-2)*90)/Numlado)-(180/Numlado))]){
    difference(){
    cylinder (h=numcam*0.32, d=diameter,$fn= Numlado);
        translate([0,0,(numcam-cambord)*0.32]){
        cylinder (h=cambord*0.32, d=diameter-(2*borda),$fn= Numlado);
        }
    }
}
    translate ([0,((diameter/2)-((furint/2)+(2*borda))),0]){
    cylinder (h=numcam*0.32, d=furint+(2*borda),$fn=30);
    }
}

    translate ([0,((diameter/2)-((furint/2)+(2*borda))),0]){
        cylinder (h=numcam*0.32, d=furint ,$fn=30);
    }
}
}
}
```


[User]
I'd like a customizable OpenSCAD design for a cross, similar to the "Customizable Origami - Cross" design I found. I need it to be parametric, allowing adjustments to the overall size, height, and the thickness of both the outer and inner outlines. Specifically:

1.  **Overall Size:** The design should allow setting a maximum size (in millimeters) for the longest side. The shorter side should scale proportionally to maintain the correct aspect ratio of the cross.
2.  **Height:**  I need to be able to specify the height of the model in millimeters.
3.  **Outline Thickness:** There should be separate parameters for the thickness of the outer and inner outlines, both adjustable in millimeters.
4.  **Inner Outline Roundness:** I want to control the roundness of the ends of the inner outlines using a radius parameter in millimeters.
5.  **Flipping:** A boolean flag should allow for mirroring the model along the Y-axis.

I think the general design of the cross is good, with the complex inner polygon structure. I just need to be able to control the size, height, thickness, and flipping as mentioned above. I'm hoping this design is based on the calculations in the reference code, using the specific coordinates from it for the outlines, specifically:

```
// Outer Points
A1 = [4, 0];
A2 = [6, 0];
A3 = [6, 4];
A4 = [10, 4];
A5 = [10, 6];
A6 = [6, 6];
A7 = [6, 15];
A8 = [4, 15];
A9 = [4, 6];
A10 = [0, 6];
A11 = [0, 4];
A12 = [4, 4];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12];

// Inner Points
B1 = [1, 5];
B2 = [3, 5];
B3 = [5, 5];
B4 = [7, 5];
B5 = [9, 5];
B6 = [5, 1];
B7 = [5, 3];
B8 = [5, 7];
B9 = [5, 14];

// Polygons
C1 = [A1, B6, A2];
C2 = [B6, B7, A3, A2];
C3 = [B6, B7, A12, A1];
C4 = [A3, A4, B5, B4];
C5 = [A4, B5, A5];
C6 = [B5, A5, A6, B4];
C7 = [A6, B3, A3, B4];
C8 = [B7, A3, B3, A12];
C9 = [A12, A11, B1, B2];
C10 = [A12, B3, A9, B2];
C11 = [B2, A9, A10, B1];
C12 = [A11, B1, A10];
C13 = [B3, A6, B8, A9];
C14 = [A6, A7, B9, B8];
C15 = [B8, B9, A8, A9];
C16 = [B9, A7, A8];

cut_polygons = [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16];
```

I am not using any specific libraries, so I don't think they will be required for this project.

[Assistant]
customizable_origami_cross.scad:
```
/*
 * Customizable Origami - Cross - https://www.thingiverse.com/thing:2706565
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-11
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 2.4; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.8; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.9; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [4, 0];
A2 = [6, 0];
A3 = [6, 4];
A4 = [10, 4];
A5 = [10, 6];
A6 = [6, 6];
A7 = [6, 15];
A8 = [4, 15];
A9 = [4, 6];
A10 = [0, 6];
A11 = [0, 4];
A12 = [4, 4];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12];

// Inner Points
B1 = [1, 5];
B2 = [3, 5];
B3 = [5, 5];
B4 = [7, 5];
B5 = [9, 5];
B6 = [5, 1];
B7 = [5, 3];
B8 = [5, 7];
B9 = [5, 14];

// Polygons
C1 = [A1, B6, A2];
C2 = [B6, B7, A3, A2];
C3 = [B6, B7, A12, A1];
C4 = [A3, A4, B5, B4];
C5 = [A4, B5, A5];
C6 = [B5, A5, A6, B4];
C7 = [A6, B3, A3, B4];
C8 = [B7, A3, B3, A12];
C9 = [A12, A11, B1, B2];
C10 = [A12, B3, A9, B2];
C11 = [B2, A9, A10, B1];
C12 = [A11, B1, A10];
C13 = [B3, A6, B8, A9];
C14 = [A6, A7, B9, B8];
C15 = [B8, B9, A8, A9];
C16 = [B9, A7, A8];

cut_polygons = [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16];

min_x = A10[0];
min_y = A2[1];
max_x = A5[0];
max_y = A8[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
Hey, I'm looking to get a parametric filament clip designed for 3D printing, and I want it to grip two strands of filament independently and securely. I've seen some designs out there, but they're not quite what I need, they either pop off or are hard to thread, or the filament slips out.

I want something that will "click" into place and hold tightly, even with slicker filaments. I'm mostly using 1.75mm filament, but I'd like the design to be adjustable for other sizes, like 2.85mm, and I'd like to be able to tweak the grip tightness too. I've got a design in mind that's basically two "C" shaped clips fused back-to-back, so that each side grips a strand.

Here's what I'm envisioning for the parameters:

*   `filament_dia`:  The nominal diameter of the filament (e.g. 1.75 or 2.85).
*   `offset`: A small adjustment, usually negative, to control how tightly the clip grips the filament. This would be in millimeters.
*  `thick`:  The wall thickness of the clip.
*   `height`: The height or thickness of the clip when printed.

I'd like the code to calculate an `inner_r` (inner radius) based on `(filament_dia + offset) / 2`, which will be the inner radius of the C-shape. Then a spacing variable that’s the inner_r * 0.5 for spacing to let curvature retain the filament. There will be an `outer_r` which is `inner_r + thick`.

The design should use a `hull()` to create the outer part of the "C" shape, by using two cylinders and then the same process to cut out the inner shape using two cylinders also, all done in a `difference()` operation. I'd also like a notch cut into the end of each C shape, and this can be done with a cube rotated by 45 degrees and translated to the end. The `c_clip` module should be created to make a single clip and a second module to create the final clip. It'd be great if the main module creates two `c_clip`s and `mirror()`s one to create two clips back-to-back.

Could you generate the OpenSCAD code that does all of this? I don't need any external libraries for this, just vanilla OpenSCAD code. Thanks!

[Assistant]
dual_filamentclip.scad:
```
//////////////////////////////////////////////////////////////////
// Double-sided filament clip - securely grips both strands
//
// Remixed from: Universal 1.75mm filament clip by mpmselenic
//               Published on March 9, 2017
//               www.thingiverse.com/thing:2166143
//////////////////////////////////////////////////////////////////

// Parameters

// Nominal filament dia in mm (Typicallly 1.75 or 2.85)
filament_dia    = 1.75;
// offset in mm - typically slightly negative to lighty grip filament (-0.1)
offset             = -0.1;
// Wall thickness. Cura seems to not produce full curved walls at 0.8mm?
thick           = 0.91;
// height of extrusion
height          = 7;

// Derived variables
inner_r = (filament_dia + offset)/2;
spacing = inner_r * 0.5;        // depth of throat bigger than diameter to allow curvature and better retention
outer_r = inner_r + thick;

$fn=60*1;

// Objects

// fuse 2 "C" clips back-to-back
union() {
    translate ([+outer_r,0,0]) c_clip();
    mirror ([1,0,0]) translate ([+outer_r,0,0]) c_clip();
}

module c_clip() {
    difference() {
      union() {
        // handle
        translate([-(spacing+outer_r),-thick/2,0])
            cube([thick*2,thick, height]);

        // Outer shell
        hull() {
          cylinder(h=height, r1=outer_r, r2=outer_r);
          translate([spacing,0,0])
            cylinder(h=height, r1=outer_r, r2=outer_r);
        }
      }

      // Make subtractive objects +2 taller and offset by -1 in z to avoid conincdent faces
      // screwing up preview or causing non-manifold objects

      // inner oval
      hull() {
        translate ([0,0,-1]) cylinder(h=height+2, r1=inner_r, r2=inner_r);
        translate([spacing,0,-1])
            cylinder(h=height+2, r1=inner_r, r2=inner_r);
      }

      // notch in end
      translate([spacing+0.2+10/1.414,0,0])
        rotate([0,0,45])
            translate([-5,-5,-1])
                cube([10,10,height+2], center=1);
    }
}
```


[User]
Hey, I'm looking to create a parametric OpenSCAD model for a 100mm whoop frame, similar to the one I linked but with a few improvements. Basically, it's a quadcopter frame with four ducts surrounding the propellers, and a center section for the flight controller.

Here are the core parameters I need to control:

*   **Propeller Diameter (prop\_diameter):** This will determine the internal diameter of the prop ducts.
*   **Propeller Height (prop\_height):** This influences the height of the duct.
*   **Motor Height (motor\_height):** This is the distance from the motor mount to the bottom of the duct.
*   **Motor Diameter (motor\_diameter):** For the size of the motor mount.
*   **Duct Thickness (duct\_thickness):**  Wall thickness of the ducts.
*   **Arm Thickness (arm\_thickness):** Thickness of the arms, both in height and width.
*   **Duct Offset (duct\_offset):** Spacing between the center and the ducts.
*   **Plate Thickness (plate\_thickness):** Thickness of the center connecting plate.
*   **Flight Controller Screw Spacing (fc\_screw\_spacing):** The distance between the flight controller screws.
*  **Flight Controller Screw Hole (fc\_screw\_hole):** The diameter of the screw holes.
*  **Flight Controller Screw Hole Surround (fc\_screw\_hole\_surround):** The outer diameter of the material surrounding the screw hole.
*   **Motor Screw Spacing (motor\_screw\_hole\_spacing):** Distance between the motor mount screws.
*   **Motor Screw Hole (motor\_screw\_hole):** Motor screw hole size.
*   **Motor Axle Hole (motor\_axle\_hole):** Motor axle hole size.
*   **Resolution (resolution):** For the smoothness of the curved parts.

The design should have a central plate with screw holes for a flight controller. From this central plate, four arms will extend outward to connect with the ducts. Each of the ducts should surround a propeller and have a motor mount. I need the center plate to be a square with rounded corners, and the duct placement needs to ensure they do not overlap.

I'd also like the arms to have some thickness to them, as well as curved supports going from the duct to the motor mount. The ducts themselves should have a slight lip on the top edge. I'm also going to need the motor mount to have screw holes for mounting the motor to the arm.

I think that should be all of the details, but let me know if I've missed something. I think I'll need to use the `rotate_extrude` for the ducts and arms, and `linear_extrude` for some of the center parts. I'll also need `difference` operations to cut out holes and shapes.

[Assistant]
Model.scad:
```
echo(version=version());

// Propellor Diameter (mm) - This drives the internal diameter of the duct, so add a little.
prop_diameter = 60;
// Propellor Height (mm) - This drives the height of the duct diameter of the duct.
prop_height=5.2;
// Motor Height (mm) - This is the height from the motor mount to the bottom of the duct, so subtract a little.
motor_height=12.5;
// Motor Diameter (mm) - This defines the size of the motor mount.
motor_diameter=14;

// Duct Thickness (mm) - This is the wall thickness of the duct.
duct_thickness=1.6;
// Arm Thickness (mm) - This is the thickness of the arms (in height and width).
arm_thickness=4;
// Duct Offset (mm) - defines the spacing between ducts, tweak this to ensure the ducts don't overlap.
duct_offset=48;

// Plate Thickness (mm) - This is the thickness of the middle connecting plate.
plate_thickness=2;

// Flight Controller Screw Spacing (mm) - Distance between the FC screws.
fc_screw_spacing=20;
// Flight Controller Screw Hole (mm) - FC screw hole size.
fc_screw_hole=2.5;
// Flight Controller Screw Hole Surround (mm) - FC screw hole surround size.
fc_screw_hole_surround=6;

// Motor Screw Spacing (mm) - Distance between the motor screws.
motor_screw_hole_spacing=9;
// Motor Screw Hole (mm) - Motor screw hole size.
motor_screw_hole=2.5;
// Motor Axle Hole (mm) - Motor axle hole size.
motor_axle_hole=5;

// Resolution - This is how smooth the curved surfaces will be... this number is the number of faces on a 360 degree surface.
resolution=128;

duct_bottom=motor_height;
duct_height=prop_height*2;

union()
    {
    //centre
    translate([0,0,duct_bottom+plate_thickness])
    linear_extrude(plate_thickness)
    union()
        {
        difference()
            {
            square(size=[duct_offset*1.41421356237,duct_offset*1.41421356237],center=true);
            for(degrees2 = [45 : 90 : 315])
                {
                rotate([0,0,degrees2])
                translate([duct_offset,0,0])
                circle(prop_diameter/2+0.5*duct_thickness, $fn=resolution);
                }
            circle(fc_screw_spacing/2+fc_screw_hole/2,$fn=resolution);

            }
        for(degrees = [45 : 90 : 315])
            {
            rotate([0,0,degrees])
            translate([fc_screw_spacing/2,0,0])
            difference()
                {
                circle(fc_screw_hole_surround/2,$fn=resolution);
                circle(fc_screw_hole/2,$fn=resolution);
                }

            }
        }
    for(degrees = [45 : 90 : 315])
        {
        rotate([0,0,degrees])
        translate([duct_offset,0,0])
        union()
            {

            //arms
            union()
                {
                linear_extrude(arm_thickness)
                difference()
                    {
                    circle(motor_diameter/2, $fn=resolution);
                    for(degrees = [0 : 90 : 270])
                        {
                        rotate([0,0,degrees])
                        translate([motor_screw_hole_spacing/2,0,0])
                        circle(motor_screw_hole/2,$fn=resolution);
                        }
                        circle(motor_axle_hole/2, $fn=resolution);
                    }

                difference(){
                rotate_extrude(angle = 360, convexity = 10, $fn=resolution)
                union()
                    {
                        difference()
                        {
                            translate([(prop_diameter/2)-arm_thickness+duct_thickness,duct_bottom,0])
                            circle(arm_thickness);
                            translate([(prop_diameter/2)-(arm_thickness*2)+duct_thickness,duct_bottom,0])
                            square(size=[arm_thickness*2,arm_thickness]);
                        }
                        difference()
                        {
                            translate([motor_diameter+arm_thickness,duct_bottom-arm_thickness,0])
                            circle(arm_thickness);
                            translate([motor_diameter,duct_bottom-2*arm_thickness,0])
                            square(size=[arm_thickness*2,arm_thickness]);
                        }
                        translate([motor_diameter+arm_thickness,duct_bottom-arm_thickness,0])
                        square(size=[(prop_diameter/2)-2*arm_thickness+duct_thickness-motor_diameter,arm_thickness]);
                        difference()
                        {
                            translate([motor_diameter,arm_thickness,0])
                            circle(arm_thickness);
                            translate([motor_diameter-arm_thickness,arm_thickness,0])
                            square(size=[arm_thickness*2,arm_thickness]);
                        }
                        translate([motor_diameter,arm_thickness,0])
                        square(size=[arm_thickness,duct_bottom-2*arm_thickness]);
                        translate([motor_diameter/2,0,0])
                        square(size=[motor_diameter/2,arm_thickness]);
                    }

                // cutouts
                translate([0,0,-0.5*duct_bottom])
                linear_extrude(duct_bottom*2)
                    difference(){
                        circle((prop_diameter/2)+duct_thickness*2);
                        for(degrees2 = [60 : 120 : 300])
                            {
                            rotate([0,0,degrees2])translate([0,-0.5*arm_thickness,0])square(size=[(prop_diameter)+duct_thickness*2,arm_thickness]);
                            }
                    }
                }
            }
            // duct
            translate([0,0,duct_bottom])
            rotate_extrude(angle = 360, convexity = 10, $fn=resolution)
            translate([-duct_thickness-(prop_diameter/2),0])
            union()
                {
                // straight part
                square([duct_thickness,duct_height]);

                // curved lip
                difference()
                    {
                    difference()
                        {
                        translate([duct_thickness-duct_height,duct_height]) circle(duct_height);
                        translate([-duct_height*2,duct_height]) circle(2*duct_height);
                        };
                    translate([-duct_height,0])
                    square([duct_height*2,duct_height]);
                    }

                }
            }
        }
    }

//color("white")
//  translate([0,-0,duct_bottom])
//    hollowCylinder(d=60+duct_thickness,h=duct_height,wallWidth=duct_thickness);

```


[User]
I'd like a parametric OpenSCAD design for a customizable name tag, similar to a keychain. It should have a rectangular base with rounded edges, and a circular hole/ring for attaching it to things. The name should be extruded text on the base. I'd like to be able to control the length, height, and thickness of the base, the diameter of the hole, the height of the hole, the text height, text size, font, and the actual text itself. Also, I'd like the text to be centered on the base and raised slightly off the surface.

I'd also like a 'ring' around the hole for better support. This should be a small cylinder (the outer part of the ring) with a smaller cylinder subtracted (the inner part of the ring), to create the ring itself. The ring should sit on the top face of the base and extend from the hole. I would like to specify the ring's height, and the diameters of the inner and outer cylinders so I have some control over its size. I'd like to use the `boxes.scad` library from MCAD for making the base and rounded edges.

[Assistant]
Nametag_keychain.scad:
```
/* [Base] */
xSize = 45; // length
ySize = 15; // height
zSize = 3; //thickness
holeDia = 3.5; // hole diameter
holehight=2;//hole high
/* [Text] */
textHeight = 2; // [1:10]
textSize= 7.5; // [1:50]
myFont = "Liberation Sans"; // [Liberation Mono, Liberation Sans,]
myText = "My Name"; // Your name here!
/* [Hidden] */
// preview[view:south, tilt:top diagonal]
baseSize = [xSize, ySize, zSize];
include <MCAD/boxes.scad>

module out()
{

    cylinder(holehight,holeDia,holeDia);
}
module in()
{

    cylinder(holehight+1,holeDia-1,holeDia-1);
}

module ring()
{  translate([0,10,0])
    difference(){
         out();
        in();
    }
}

module textExtrude() {
    linear_extrude(height = textHeight)
    text(myText, halign = "center", valign = "center", size = textSize, font = myFont);
}
module base() {
  roundedBox(baseSize, radius = 0, sidesonly = 1, $fn = 36);
  //cube(baseSize, center = true);
}
module makeTag() {
      union() {
      base();
      //translate([0, -ySize/5 , zSize/2]) textExtrude();
      translate([0, -3, 1.5]) textExtrude();
     ring();
    }
  }
makeTag();
//base();
//holes();
//textExtrude();
```


[User]
I'd like to create a customizable 2D lion head design using OpenSCAD, similar to the provided example. It should be based on a set of predefined 2D coordinates that form the lion's outline and inner details. The goal is to generate a laser-cuttable or 3D printable shape.

Here's what I need:

*   **Customizable Size:** The design should allow me to set a maximum dimension, and the other dimension should scale proportionally to maintain the lion's aspect ratio. I should also be able to set the thickness of the final model for 3D printing if desired.
*   **Outlines:** It needs both an outer outline and inner cut lines based on a list of points and polygons. The outer outline should have a customizable thickness.
*   **Inner Cut Lines:**  The inner cut lines also should have a customizable thickness and rounded corners.
*   **Flip Option:** I want to have the ability to mirror the design along the vertical axis (y-axis) for different orientations.
*   **Coordinate System:** The design uses 2D coordinates specified as `[x, y]` values which need to be scaled and translated properly within OpenSCAD.

Could you generate the OpenSCAD code for this, using the following approach:

*   **Data Structure:** Store the coordinate data for the outline and inner polygons directly in the OpenSCAD file or in a separate `.scad` file if necessary.
*   **Parametric Design:** All the size and thickness values, plus the flip option, should be exposed as configurable parameters using the customizer if possible.
*   **Scaling and Translation:** Make sure to scale and translate the design appropriately so that it fits within the user-defined size limits and origins from the origin of the workplane.

I'm not familiar with OpenSCAD libraries so if possible, keep the code "vanilla".  Thanks!

[Assistant]
customizable_origami_lion_head.scad:
```
/*
 * Customizable Origami - Lion Head - https://www.thingiverse.com/thing:2707986
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-12
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 1.8; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.7; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.1; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [418, 909];
A2 = [422, 877];
A3 = [452, 813];
A4 = [677, 592];
A5 = [871, 491];
A6 = [997, 368];
A7 = [1153, 396];
A8 = [1345, 492];
A9 = [1466, 673];
A10 = [1539, 872];
A11 = [1443, 1034];
A12 = [1250, 1098];
A13 = [1122, 1292];
A14 = [871, 1481];
A15 = [710, 1669];
A16 = [642, 1294];
A17 = [713, 1156];
A18 = [710, 1098];
A19 = [678, 1098];
A20 = [613, 1133];
A21 = [548, 1132];
A22 = [521, 1073];
A23 = [487, 1040];
A24 = [450, 936];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24];

// Inner Points
B1 = [452, 879];
B2 = [552, 813];
B3 = [646, 719];
B4 = [736, 688];
B5 = [678, 747];
B6 = [616, 1067];
B7 = [742, 939];
B8 = [772, 1037];
B9 = [807, 1383];
B10 = [963, 1165];
B11 = [1058, 1004];
B12 = [1155, 877];
B13 = [1285, 749];
B14 = [1251, 624];
B15 = [997, 718];
B16 = [868, 623];
B17 = [966, 558];
B18 = [1029, 528];
B19 = [1074, 557];
B20 = [1060, 618];
B21 = [1346, 593];
B22 = [1218, 492];
B23 = [1091, 419];
B24 = [963, 464];
B25 = [933, 911];
B26 = [1148, 563];

// Polygons
C1 = [A2, B1, B2, B3, A4, A3];
C2 = [A4, B16, B4, B3];
C3 = [A4, B16, A5];
C4 = [A5, A6, B24];
C5 = [A6, B23, B24];
C6 = [A6, B23, A7];
C7 = [B23, B22, A7];
C8 = [B22, A8, A7];
C9 = [A8, B21, B22];
C10 = [B21, A8, A9];
C11 = [A9, A10, B21];
C12 = [B21, A10, A11];
C13 = [B21, A11, B13];
C14 = [B13, A11, A12];
C15 = [B13, B14, B21];
C16 = [B22, B21, B14];
C17 = [B22, B23, B24];
C18 = [B26, B22, B14];
C19 = [B26, B22, B24];
C20 = [B24, B16, A5];
C21 = [B24, B17, B16];
C22 = [B24, B26, B15, B20, B19, B18, B17];
C23 = [B15, B20, B19, B18, B17, B16];
C24 = [B15, B26, B14];
C25 = [B14, B12, B13];
C26 = [B14, B12, B15];
C27 = [B13, A12, B12];
C28 = [A15, A16, A17, B8];
C29 = [A15, B8, B9];
C30 = [A15, B9, A14];
C31 = [B9, B10, A14];
C32 = [B10, A13, A14];
C33 = [B10, A13, B11];
C34 = [B11, A13, A12];
C35 = [B11, B12, A12];
C36 = [B15, B11, B12];
C37 = [B15, B25, B11];
C38 = [B25, B10, B11];
C39 = [B25, B9, B10];
C40 = [B8, B9, B25];
C41 = [B7, B8, B25];
C42 = [B7, B6, B8];
C43 = [A18, A17, B8];
C44 = [A18, A19, A20, A21, A22, B6, B8];
C45 = [A23, A24, B1, B2, B3, B5, B7, B6];
C46 = [B5, B4, B16, B7];
C47 = [B16, B25, B7];
C48 = [B16, B25, B15];
C49 = [B3, B5, B4];
C50 = [A2, A1, A24, B1];
C51 = [A23, B6, A22];

cut_polygons = [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43, C44, C45, C46, C47, C48, /*C49, C50, C51*/];

min_x = A1[0];
min_y = A6[1];
max_x = A10[0];
max_y = A15[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
I'd like to design a measuring scoop, similar to the one described in the Thingiverse link I provided, but I'd like to make some significant changes and I would like to be able to define the shape parametrically in OpenSCAD. Specifically, I am looking for a design that:

1.  **Is Upright for Printing:** Instead of being printed on its side, the scoop should be designed to be printed standing upright. This avoids overhang issues and reduces the need for support material.

2.  **Parametric Volume:** The user needs to be able to define the volume of the scoop in milliliters (ml). I should be able to input a desired volume and the model should scale correctly.

3. **Variable Wall Thickness:** It is important that I can easily change the wall thickness to produce a sturdier or more flexible scoop, and that this change is reflected in the internal and external dimensions of the scoop.

4.  **Curved Profile:** The scoop should have a curved profile, not just a straight cylinder.  I'm picturing something like the example, with an angled handle section as well, but I want to be able to tweak the points used to generate the curve.

5. **Labeling:** The scoop should have two lines of embossed text on the handle. The user must be able to define this text and font to print the volume and a second line of text. The size and thickness of the letters should be controllable as well. It might be nice to also have an option to disable the text completely in case someone wants to use the text area for something else.

6. **Customizable Handle Shape:** I'd like to be able to tweak the points that define the shape of the handle, to make it more or less ergonomic and to make sure the text is on a suitable surface.

7. **No Reliance on Imported Files:** The design should not rely on external data files or calculations in another application, so the calculations must all happen inside the OpenSCAD files.

8. **No specific libraries:** I would like to use only built-in OpenSCAD modules - it is very important that I do not have to install any external libraries to use these files.

I'd like the design to be flexible enough to allow a range of scoop sizes, but I am most concerned about a scoop around 40-50ml.  Can you generate the OpenSCAD file(s) for this?

[Assistant]
Messschaufel.scad:
```
// -*- mode: SCAD ; c-file-style: "ellemtel" ; coding: utf-8 -*-
//
// Messschaufel (measuring scoop)
// based on
// 'Measuring Cup' Version 1.0 by wstein
//
// is licensed under the Attribution - Non-Commercial - Share Alike license.
// (c) December 2014
// please refer the complete license here: http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
// Copyright 2017 - 2018 Roland Sieker <ospalh@gmail.com>

// Capacity of the scoop in ml
volume = 42; // [10:0.5:150]

// Text in the second row. (First row is the size)
label_text="Wasch";

/* [Hidden] */

// label1_font="Demos LT";
// label2_font="Demos LT";

label1_font = "Barlow";
label2_font = "Barlow Condensed";

// If the printed size does to much differ, you can adjust here. It is easy
// to calculate: [desired volume] / [printed volume] -> adjust.
adjust=1;

wall_thickness_ = 1.8;  // I like the strong. Reduce this for more flimsy scoops

// Tweak these to modify the label sizes
label_thickness = 1.5;
label1_height = 10.0;
label2_height = 8.5;

label1_text= str(volume, " ml");

// set to true, to get a model of the content volume. This can be measure with MeshLab or other tools
build_measure_volume_reference=0; // [1:true, 0:false]

// This is the unscaled volume (calculated with MeshLab) of the original
// cup. Some corners have been cut when i put this upright again.
// N.B.: This is not a precision measure.
ref_volume=137.2013;

r_fn=12;  // used for $fn

labels=[
   [0,label1_text, label1_font,label1_height,label_thickness],
   [1,label_text, label2_font,label2_height,label_thickness],
   ];

// calculate correct scale to get the exact volume
factor=pow(volume/ref_volume*adjust,1/3);
wall_thickness=wall_thickness_/factor;

r1=1;
r2=r1+wall_thickness;

y0=-35;
y1=0;
y3=45;

y4=68;

x0=0;
x1=19;
x2=29;
x3=30;
x5=16;

z0=0;
z1=-45;
z2=-5;

y2=-z1+y0-5;
y01=y0+(r2-r1);
y31=y4+(y3-y4)*2/3;

x4=(y1-y0)/(y2-y0)*(x3-x5)+x5;
x11=x1+(x2-x1)/2;

z3=-(r2-r1);
z4=y0;

bottom_factor=0.7;
handle_factor=0.9;

// cup points
cup_points=[
   [x1,y4,z0],
   [x2,y3,z0],
   [x3,y2,z0],
   [x4,y1,z0],
   [-x4,y1,z0],
   [-x3,y2,z0],
   [-x2,y3,z0],
   [-x1,y4,z0],
   [x11*bottom_factor,y31,z1],
   [x2*bottom_factor,y3-2,z1],
   [x3*bottom_factor,y2,z1],
   [x4*bottom_factor,y1+3,z4-3],
   [-x4*bottom_factor,y1+3,z4-3],
   [-x3*bottom_factor,y2,z1],
   [-x2*bottom_factor,y3-2,z1],
   [-x11*bottom_factor,y31,z1],
   ];

// handle points
handle_points=[
   [x4*handle_factor,y1,z2],
   [x4,y1,z0],
   [x5,y0,z0],
   [x5*handle_factor,y01,z3],
   [-x5*handle_factor,y01,z3],
   [-x5,y0,z0],
   [-x4,y1,z0],
   [-x4*handle_factor,y1,z2],
   ];

//build cup
// rotate([45,0,0])
scale([1,1,1]*factor)
{
   build_cup(cup_points);
}
module build_cup(points)
   intersection()
{
   translate([0,0,z1-r2])
      linear_extrude(height=abs(z1)+r2,convexity=10)
      polygon([
                 [-x3-r2-.1,y0-r2-.1],
                 [x3+r2+.1,y0-r2-.1],
                 [x3+r2+.1,y4+r2+.1],
                 [-x3-r2-.1,y4+r2+.1],
                 ]);

   difference()
   {
      if(!build_measure_volume_reference)
         union()
         {
			build_handle(handle_points);

			handle_outline(points, r=r2);
         }

      handle_outline(points, r=r1);
   }
}

module build_handle(points)
{
   a=-atan((z3-z2)/(y1-y01));
   difference()
   {
      handle_outline(points, r=r2);
      difference()
      {
         handle_outline(points, r=r1);

         for(label=labels)
            build_label(label[0],label[1],label[2],label[3],label[4]);
      }
   }
}

module build_label(idx, txt, font, height, thickness)
{
   n=4;
   xd=(x4-x5)/(n+1);
   yd=(y1-y01)/(n+1);
   zd=(z2-z3)/(n+1);
   r=yd/4;

   if(len(txt)>0)
   {
      // write label
      rotate([-atan((z3-z2)/(y1-y01)),0,0])
         translate([0,-11.5-idx*2*yd,z2-r1-.1])
      {
         linear_extrude(thickness)
         {
            text(txt, size=height, font=font, valign="center", halign="center");
         }
         // cylinder(r1=wall_thickness/4,r2=0,h=thickness,$fn=4);
      }
   }
   else
   {
      // no labe? Then build riffle
      for(a=[0.7+(1-idx)*2:n-idx*2])
      {
         hull()
         {
            for(m=[0,1])
            {
               mirror([m,0,0])
               {
                  translate([x5+xd*a-yd,y01+yd*a,z3+zd*a-r/2])
                  {
                     sphere(r=r,$fn=r_fn);
                  }
               }
            }
         }
      }
   }
}

module handle_outline(points, r)
{
   hull()
      for(p=points)
         translate(p)
            sphere(r=r,$fn=r_fn);

}

```


[User]
Okay, I'm looking to create a customizable terminal strip cover, and I'd like the design to be parametric in OpenSCAD. I've seen a few designs that are close, but none that are quite what I need, and I'd prefer to have a single design I can tweak. I need a base part that fits around the terminal blocks and a cover that snaps onto that base.

Here are the key parameters I'd like to control:

*   **`Num_of_terminals`**: The number of individual terminal blocks in the strip. I need this to be adjustable from 2 to 12, maybe more eventually, but that's a good starting range.
*   **`wire_outter_dia`**: The outer diameter of the wire that the terminals accept, including the insulation. This should be adjustable in steps of 0.1, and a good range would be 1 to 12.
*   **`block_width`**: The width of a single terminal block. Range should be 3 to 12 in 0.1 steps.
*   **`block_gap`**: The gap between adjacent terminal blocks, adjustable from 1 to 12 in steps of 0.01.
*   **`block_height`**:  The height of a single terminal block; range should be, say, 5 to 20, and maybe let's do steps of 0.1 here.
*   **`block_length`**: The length of a single terminal block, again 5 to 20, 0.1 steps.
*   **`stretch`**: This is a scaling factor that affects the overall shape of the cover where it meets the base. It's a bit abstract, but it needs to be adjustable, and I guess it should be something like 1 to 2 in steps of 0.01. I know from the examples I've seen that small changes here make a big visual difference.
*   **`show_parts`**:  This should be able to display either the base (1), the cover (2), or both (3).
*    **`num_of_tabs`**: The number of tabs on the base for fixing the whole assembly. I need options for 0, 1, or 2 tabs.
*   **`fixing_hole_size`**:  The diameter of the fixing hole in each tab, adjustable, let's say, from 1 to 10 in steps of 1.
*   **`tab_width`**: The width of the tab itself, should be adjustable but let's just say 5 to 20 as a range.
*   **`chamfer`**: A boolean option to add a chamfer to the fixing hole or not, 0 for no, 1 for yes.

I'd like the base to have cutouts for the individual terminal blocks, and I also need some slots on the side of the base to route cable ties for cable management. The cover should be designed to clip onto the base, with small bumps for a secure fit. Also it needs to have a hole to allow for cable entry. It would also be great if the cover was designed to have an inner and outter portion with a small offset for clearance from the terminals on the base. The cover should also have a lid.

I'm not using any specific libraries, and I'd like to get the files as soon as possible. Thanks!

[Assistant]
Terminal_strip_cover_v3.scad:
```
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
/// OpenSCAD File V3.0 by Ken_Applications /////
///            04 - 04 - 2018              /////
////////////////////////////////////////////////
/// Version 2 modified to work with Customizer////
/// Version 3 Added slots for cable clamps ////
/// Also increased snap fixing bumps for lid ////

////////////////////////////////////////////////

//... Select number of terminals required
Num_of_terminals=3; // [2,3,4,5,6,7,8,9,10,11,12]

//...Diameter measured including the insulation [Default 7.3]
wire_outter_dia=7.3; // [1:0.1:12]

//...Single block width  [Default 6.4]
block_width=6.4;//[3:0.1:12]

//...The gap between the blocks  [Default 3.1]
block_gap=3.1;//  [1:0.01:12]

//...[Default height=13]
block_height=13.0;///// [Default.... 13.0      ]

//...[Default height=16]
block_length=16;/////// [Default.... 16.0      ]

//please note a small change of the stretch parameter below makes a big difference to the model (eg. try changing 1.7 to 1.65 to see the result)
stretch=1.75;/////////// [Default.... 1.7]

//...  show   [1= Base only   2=Cap only 3=Both  ]
show_parts=3;  // [1,2,3 ]

//...How many fixing tabs.... [Default number =2]
num_of_tabs=2; //[0,1, 2 ]

//... Diameter of fixing hole [Default=4]
fixing_hole_size=4;//[1,2,3,4,5,6,7,8,9,10]

//... [Default =12]
tab_width=12;

//... [0=No Chamfer  1=Yes chamfer]
chamfer=1; // [0,1]
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////

//calculations/////////////////
move_a_bit=(block_width-(block_width*0.8))/2;
the_centre_pos=((block_width+block_gap)*Num_of_terminals)/2;
the_strech_ratio=stretch-(0.08*(Num_of_terminals+3));
extra_overall_length=block_length+(the_centre_pos*10);
//end of calculations

module lumps (){
 translate([-2.0,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=3, d2=3, center=true,$fn=30);
 translate([(the_centre_pos*2)+2.0,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=3, d2=3, center=true,$fn=30);
}

module cut_cover(){
translate([the_centre_pos*1.5,0,1.9]) cube([the_centre_pos*5,tab_width+2,4],true);

    translate([0,(tab_width/2)+0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

   translate([0,-(tab_width/2)-0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

}

module tab (){
difference(){
union(){
linear_extrude(height=2) circle(tab_width/2,$fn=32);
translate([-tab_width/2,0,0]) cube([tab_width,tab_width/2,2],false);
}
cylinder(h=45, d1=fixing_hole_size, d2=fixing_hole_size, center=true,$fn=30);

if (chamfer==1)  {
translate([0,0,0.5])  cylinder(h=2, d1=fixing_hole_size, d2=fixing_hole_size+4, center=false,$fn=30);
}

}
}

module crimp(){
difference(){
rad_sphere=wire_outter_dia*0.92;
sphere($fn = 0, $fa = 2, $fs = wire_outter_dia/10, r = rad_sphere);
translate([0,0,-rad_sphere/2]) cube([rad_sphere*2+1,rad_sphere*2+1,rad_sphere],true);
rotate([90,0,0]) translate([0,(wire_outter_dia/2+0.1),0]) cylinder(h=wire_outter_dia*2, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);
}

}

module cut_out_terminal(){
translate([0,0,2.1]){
  cube([(block_width+0.1),block_length,block_height],false);

translate([block_width-0.1,block_length/4,0])  cube([(block_gap+1),block_length/2,block_height],false);

translate([move_a_bit,-block_length/2,(block_width*.8)/2])  cube([(block_width*.8),block_length*2,block_height-(block_width*.8)/2],false);

translate([block_width/2,block_length+(block_length/2),(block_width*.8)/2]) rotate([90,0,0]) cylinder(h=block_length*2, d1=block_width*.8, d2=block_width*.8, center=false,$fn=30);
}

}

module holder(){
difference(){

union(){
translate([-2,-5,0]) cube([(block_width+block_gap)*Num_of_terminals+4,block_length+10,block_height+2],false);

}

cut_out_terminal();
    for (a =[1:Num_of_terminals-1])
translate([(block_width+block_gap)*a,0,0]) cut_out_terminal();
}
}

module base(){
hull(){
translate([the_centre_pos,-(the_centre_pos*2)*the_strech_ratio,0]) circle(wire_outter_dia+1);
translate([-2,-block_length,0]) square([(the_centre_pos*2)+4,block_length]);
}
}

module base_crimp (){

linear_extrude(height = 2, center = false, convexity = 10, twist = 0)
base();

translate([the_centre_pos,-((the_centre_pos*2)*the_strech_ratio)+0,1.95]) crimp();
}

module cover (){
module outter (){
linear_extrude(height = block_height+3, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module inner (){
linear_extrude(height = block_height+4, center = false, convexity = 2, twist = 0){
  offset(r = 0.4) {    //clearance
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module lid (){
linear_extrude(height = 2, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module profile (){
difference(){
      outter ();
 translate([0,0,-0.1]) inner ();

}
}

profile();
translate([0,0,block_height+3])lid ();
}

module cover2(){
difference(){
cover();
rotate([90,0,0]) translate([the_centre_pos,(wire_outter_dia/2+2.1),0]) cylinder(h=extra_overall_length, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);

 translate([the_centre_pos,(wire_outter_dia/2+2.1),2])  cube([wire_outter_dia,extra_overall_length,wire_outter_dia],center=true);

    translate([-2.0,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=3.5, d2=3.5, center=true,$fn=30);

    translate([(the_centre_pos*2)+2.0,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=3.5, d2=3.5, center=true,$fn=30);

    cut_cover();
}
}

if ((num_of_tabs==2)&&(show_parts==1)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if ((num_of_tabs==2)&&(show_parts==3)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if (num_of_tabs==1)  {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
}

if (show_parts==3){
    translate([0,0,65])cover2();
    }

if (show_parts==2){
    translate([0,0,block_height+5])  rotate([180,0,0])  cover2();
    }

if (show_parts==1){
translate([0,-block_length/2,0])holder();
base_crimp2();
mirror([0,1,0]) base_crimp2();
}

if (show_parts==3){
translate([0,-block_length/2,0])holder();
base_crimp2();
mirror([0,1,0]) base_crimp2();
}

if (show_parts==3){

    lumps();
}

if (show_parts==1){

    lumps();
}

module tie_slots(){
translate([the_centre_pos+wire_outter_dia/1.4,-((the_centre_pos*2)*the_strech_ratio)+wire_outter_dia,0]) cube([2,6.5,5],center=true);
translate([the_centre_pos-wire_outter_dia/1.4,-((the_centre_pos*2)*the_strech_ratio)+wire_outter_dia,0]) cube([2,6.5,5],center=true);
}

module base_crimp2(){
difference(){
base_crimp();
    tie_slots();
}
}
```
Terminal_strip_cover_v2.scad:
```
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
/// OpenSCAD File V1.0 by Ken_Applications /////
///            13 - 12 - 2017              /////
////////////////////////////////////////////////
/// Version 2 modified to work with Customizer////
////////////////////////////////////////////////

//... Select number of terminals required
Num_of_terminals=4; // [2,3,4,5,6,7,8,9,10,11,12]

//...Diameter measured including the insulation [Default 7.3]
wire_outter_dia=7.3; // [1:0.1:12]

//...Single block width  [Default 6.4]
block_width=6.4;//[3:0.1:12]

//...The gap between the blocks  [Default 3.1]
block_gap=3.1;//  [1:0.01:12]

//...[Default height=13]
block_height=13.0;///// [Default.... 13.0      ]

//...[Default height=16]
block_length=16;/////// [Default.... 16.0      ]

//please note a small change of the stretch parameter below makes a big difference to the model (eg. try changing 1.7 to 1.65 to see the result)
stretch=1.7;/////////// [Default.... 1.7]

//...  show   [1= Base only   2=Cap only 3=Both  ]
show_parts=3;  // [1,2,3 ]

//...How many fixing tabs.... [Default number =2]
num_of_tabs=2; //[0,1, 2 ]

//... Diameter of fixing hole [Default=4]
fixing_hole_size=4;//[1,2,3,4,5,6,7,8,9,10]

//... [Default =12]
tab_width=12;

//... [0=No Chamfer  1=Yes chamfer]
chamfer=1; // [0,1]
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////

//calculations/////////////////
move_a_bit=(block_width-(block_width*0.8))/2;
the_centre_pos=((block_width+block_gap)*Num_of_terminals)/2;
the_strech_ratio=stretch-(0.08*(Num_of_terminals+3));
extra_overall_length=block_length+(the_centre_pos*10);
//end of calculations

module lumps (){
 translate([-1.5,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=2, d2=2, center=true,$fn=30);
 translate([(the_centre_pos*2)+1.5,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=2, d2=2, center=true,$fn=30);
}

module cut_cover(){
translate([the_centre_pos*1.5,0,1.9]) cube([the_centre_pos*5,tab_width+2,4],true);

    translate([0,(tab_width/2)+0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

   translate([0,-(tab_width/2)-0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

}

module tab (){
difference(){
union(){
linear_extrude(height=2) circle(tab_width/2,$fn=32);
translate([-tab_width/2,0,0]) cube([tab_width,tab_width/2,2],false);
}
cylinder(h=45, d1=fixing_hole_size, d2=fixing_hole_size, center=true,$fn=30);

if (chamfer==1)  {
translate([0,0,0.5])  cylinder(h=2, d1=fixing_hole_size, d2=fixing_hole_size+4, center=false,$fn=30);
}

}
}

module crimp(){
difference(){
rad_sphere=wire_outter_dia*0.92;
sphere($fn = 0, $fa = 2, $fs = wire_outter_dia/10, r = rad_sphere);
translate([0,0,-rad_sphere/2]) cube([rad_sphere*2+1,rad_sphere*2+1,rad_sphere],true);
rotate([90,0,0]) translate([0,(wire_outter_dia/2+0.1),0]) cylinder(h=wire_outter_dia*2, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);
}

}

module cut_out_terminal(){
translate([0,0,2.1]){
  cube([(block_width+0.1),block_length,block_height],false);

translate([block_width-0.1,block_length/4,0])  cube([(block_gap+1),block_length/2,block_height],false);

translate([move_a_bit,-block_length/2,(block_width*.8)/2])  cube([(block_width*.8),block_length*2,block_height-(block_width*.8)/2],false);

translate([block_width/2,block_length+(block_length/2),(block_width*.8)/2]) rotate([90,0,0]) cylinder(h=block_length*2, d1=block_width*.8, d2=block_width*.8, center=false,$fn=30);
}

}

module holder(){
difference(){

union(){
translate([-2,-5,0]) cube([(block_width+block_gap)*Num_of_terminals+4,block_length+10,block_height+2],false);

}

cut_out_terminal();
    for (a =[1:Num_of_terminals-1])
translate([(block_width+block_gap)*a,0,0]) cut_out_terminal();
}
}

module base(){
hull(){
translate([the_centre_pos,-(the_centre_pos*2)*the_strech_ratio,0]) circle(wire_outter_dia+1);
translate([-2,-block_length,0]) square([(the_centre_pos*2)+4,block_length]);
}
}

module base_crimp (){
linear_extrude(height = 2, center = false, convexity = 10, twist = 0)
base();

translate([the_centre_pos,-((the_centre_pos*2)*the_strech_ratio)+0,1.95]) crimp();
}

module cover (){
module outter (){
linear_extrude(height = block_height+3, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module inner (){
linear_extrude(height = block_height+4, center = false, convexity = 2, twist = 0){
  offset(r = 0.4) {    //clearance
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module lid (){
linear_extrude(height = 2, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module profile (){
difference(){
      outter ();
 translate([0,0,-0.1]) inner ();

}
}

profile();
translate([0,0,block_height+3])lid ();
}

module cover2(){
difference(){
cover();
rotate([90,0,0]) translate([the_centre_pos,(wire_outter_dia/2+2.1),0]) cylinder(h=extra_overall_length, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);

 translate([the_centre_pos,(wire_outter_dia/2+2.1),2])  cube([wire_outter_dia,extra_overall_length,wire_outter_dia],center=true);

    translate([-2,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=2, d2=2, center=true,$fn=30);

    translate([(the_centre_pos*2)+2.5,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=2, d2=2, center=true,$fn=30);

    cut_cover();
}
}

if ((num_of_tabs==2)&&(show_parts==1)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if ((num_of_tabs==2)&&(show_parts==3)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if (num_of_tabs==1)  {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
}

if (show_parts==3){
    translate([0,0,65])cover2();
    }

if (show_parts==2){
    translate([0,0,block_height+5])  rotate([180,0,0])  cover2();
    }

if (show_parts==1){
translate([0,-block_length/2,0])holder();
base_crimp();
mirror([0,1,0]) base_crimp();
}

if (show_parts==3){
translate([0,-block_length/2,0])holder();
base_crimp();
mirror([0,1,0]) base_crimp();
}

if (show_parts==3){

    lumps();
}

if (show_parts==1){

    lumps();
}

```
Terminal_strip_cover.scad:
```
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
/// OpenSCAD File V1.0 by Ken_Applications /////
///            12 - 12 - 2017              /////
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
// parameters ////
Num_of_terminals=4; /// [Default 2 .... range [2-12]]
wire_outter_dia=7.3; // [Default.... 7.3      ]
block_width=6.4;/////// [Default.... 6.4      ]
block_gap=3.1;///////// [Default.... 3.1      ]
block_height=13.0;///// [Default.... 13.0      ]
block_length=16;/////// [Default.... 16.0      ]

//please note a small change of the stretch parameter below makes a big difference to the model (eg. try changing 1.7 to 1.65 to see the result)
stretch=1.7;/////////// [Default.... 1.7]

//////////   show  ///////////////
show_parts=3;  // [1= base only   2=cap only  ]
num_of_tabs=2; //[0   1    2   default=2]
///////////////////////////////////////////////
// tab fixing hole ////////////////////////////
fixing_hole_size=4;//[default 4]
tab_width=12; //[ tab width default value bigger than block_length  ]
chamfer=1; // [1=chamfer  0= no chamfer]
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////
///////////////////////////////////////////////

//calculations/////////////////
move_a_bit=(block_width-(block_width*0.8))/2;
the_centre_pos=((block_width+block_gap)*Num_of_terminals)/2;
the_strech_ratio=stretch-(0.08*(Num_of_terminals+3));
extra_overall_length=block_length+(the_centre_pos*10);
//end of calculations

module lumps (){
 translate([-1.5,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=2, d2=2, center=true,$fn=30);
 translate([(the_centre_pos*2)+1.5,0,6]) rotate([90,0,0]) cylinder(h=(tab_width/2)-1, d1=2, d2=2, center=true,$fn=30);
}

module cut_cover(){
translate([the_centre_pos*1.5,0,1.9]) cube([the_centre_pos*5,tab_width+2,4],true);

    translate([0,(tab_width/2)+0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

   translate([0,-(tab_width/2)-0.5,block_height/2]) cube([extra_overall_length,1,block_height+3],true);

}

module tab (){
difference(){
union(){
linear_extrude(height=2) circle(tab_width/2,$fn=32);
translate([-tab_width/2,0,0]) cube([tab_width,tab_width/2,2],false);
}
cylinder(h=45, d1=fixing_hole_size, d2=fixing_hole_size, center=true,$fn=30);

if (chamfer==1)  {
translate([0,0,0.5])  cylinder(h=2, d1=fixing_hole_size, d2=fixing_hole_size+4, center=false,$fn=30);
}

}
}

module crimp(){
difference(){
rad_sphere=wire_outter_dia*0.92;
sphere($fn = 0, $fa = 2, $fs = wire_outter_dia/10, r = rad_sphere);
translate([0,0,-rad_sphere/2]) cube([rad_sphere*2+1,rad_sphere*2+1,rad_sphere],true);
rotate([90,0,0]) translate([0,(wire_outter_dia/2+0.1),0]) cylinder(h=wire_outter_dia*2, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);
}

}

module cut_out_terminal(){
translate([0,0,2.1]){
  cube([(block_width+0.1),block_length,block_height],false);

translate([block_width-0.1,block_length/4,0])  cube([(block_gap+1),block_length/2,block_height],false);

translate([move_a_bit,-block_length/2,(block_width*.8)/2])  cube([(block_width*.8),block_length*2,block_height-(block_width*.8)/2],false);

translate([block_width/2,block_length+(block_length/2),(block_width*.8)/2]) rotate([90,0,0]) cylinder(h=block_length*2, d1=block_width*.8, d2=block_width*.8, center=false,$fn=30);
}

}

module holder(){
difference(){

union(){
translate([-2,-5,0]) cube([(block_width+block_gap)*Num_of_terminals+4,block_length+10,block_height+2],false);

}

cut_out_terminal();
    for (a =[1:Num_of_terminals-1])
translate([(block_width+block_gap)*a,0,0]) cut_out_terminal();
}
}

module base(){
hull(){
translate([the_centre_pos,-(the_centre_pos*2)*the_strech_ratio,0]) circle(wire_outter_dia+1);
translate([-2,-block_length,0]) square([(the_centre_pos*2)+4,block_length]);
}
}

module base_crimp (){
linear_extrude(height = 2, center = false, convexity = 10, twist = 0)
base();

translate([the_centre_pos,-((the_centre_pos*2)*the_strech_ratio)+0,1.95]) crimp();
}

module cover (){
module outter (){
linear_extrude(height = block_height+3, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module inner (){
linear_extrude(height = block_height+4, center = false, convexity = 2, twist = 0){
  offset(r = 0.4) {    //clearance
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module lid (){
linear_extrude(height = 2, center = false, convexity = 2, twist = 0){
  offset(r = 2) {
projection(cut = true) {
base_crimp();
mirror([0,1,0]) base_crimp();
}
     }
          }
               }

module profile (){
difference(){
      outter ();
 translate([0,0,-0.1]) inner ();

}
}

profile();
translate([0,0,block_height+3])lid ();
}

module cover2(){
difference(){
cover();
rotate([90,0,0]) translate([the_centre_pos,(wire_outter_dia/2+2.1),0]) cylinder(h=extra_overall_length, d1=wire_outter_dia, d2=wire_outter_dia, center=true,$fn=30);

 translate([the_centre_pos,(wire_outter_dia/2+2.1),2])  cube([wire_outter_dia,extra_overall_length,wire_outter_dia],center=true);

    translate([-2,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=2, d2=2, center=true,$fn=30);

    translate([(the_centre_pos*2)+2.5,0,6]) rotate([90,90,0]) cylinder(h=tab_width/2, d1=2, d2=2, center=true,$fn=30);

    cut_cover();
}
}

if ((num_of_tabs==2)&&(show_parts==1)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if ((num_of_tabs==2)&&(show_parts==3)) {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
translate([the_centre_pos*2+1.9+(tab_width/2),0,0]) rotate([0,0,90]) tab();
}

if (num_of_tabs==1)  {
translate([-1.9-tab_width/2,0,0]) rotate([0,0,-90]) tab();
}

if (show_parts==3){
    translate([0,0,65])cover2();
    }

if (show_parts==2){
    translate([0,0,block_height+5])  rotate([180,0,0])  cover2();
    }

if (show_parts==1){
translate([0,-block_length/2,0])holder();
base_crimp();
mirror([0,1,0]) base_crimp();
}

if (show_parts==3){
translate([0,-block_length/2,0])holder();
base_crimp();
mirror([0,1,0]) base_crimp();
}

if (show_parts==3){

    lumps();
}

if (show_parts==1){

    lumps();
}

```


[User]
I'm looking to create a customizable 2D design of a disposable coffee cup, similar to the one described in the provided text. I want to be able to adjust the overall size, height, and thickness of the lines.

Specifically, I need the design to be based on the provided coordinate points for both the outer outline and the inner cutouts. These points should be scaled proportionally when the overall size is changed.

Here's a breakdown of what I need:

*   **Base Shape:**  The cup shape is defined by a series of points (A1 through A14) that form the outer outline.
*   **Inner Cutouts:**  There are four inner cutouts (C1 through C4) that are also defined by a series of points, all of which are based on the A points.
*   **Customizable Size:**  I need a parameter to set the maximum size of the longest side (max_size_in_millimeter). The shorter side should automatically scale proportionally.
*   **Height:** The design should have a height (model_height_in_millimeter) to extrude when creating the 2D shape.
*   **Outline Thickness:**  The outer outline should have an adjustable thickness (outline_size_in_millimeter).
*   **Inner Cutout Thickness:** The inner cutouts should also have an adjustable thickness (inline_size_in_millimeter).
*   **Inner Cutout Radius:** I also need to adjust the roundness of the inner cutout edges (inline_edge_radius_in_millimeter).
*   **Flip Option:** I'd like an option to flip the entire model along the Y axis using the parameter `flip_model` with "yes" or "no" options.
*   **Functionality:** The code must use `resize` and `mirror` transforms as requested.  Also, the module structure in the example code is what I'd prefer.

Could you please generate the OpenSCAD code for this design? I don't need any specific libraries, just the core OpenSCAD functionality. I'm expecting to have a file with a well-organized set of parameters at the top.

[Assistant]
customizable_disposable_coffee_cup.scad:
```
/*
 * Customizable Origami - Disposable Coffee Cup - https://www.thingiverse.com/thing:2709481
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-12
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 1.4; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.7; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.3; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [296, 530];
A2 = [322, 405];
A3 = [1212, 405];
A4 = [1235, 530];
A5 = [1269, 543];
A6 = [1268, 582];
A7 = [1290, 628];
A8 = [1233, 638];
A9 = [1123, 2000];
A10 = [419, 2000];
A11 = [299, 638];
A12 = [242, 628];
A13 = [265, 582];
A14 = [260, 543];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14];

// Inner Points

// Polygons
C1 = [A2, A3, A4, A1];
C2 = [A4, A5, A6, A13, A14, A1];
C3 = [A6, A7, A8, A11, A12, A13];
C4 = [A8, A9, A10, A11];

cut_polygons = [C1, C2, C3, C4];

min_x = A12[0];
min_y = A2[1];
max_x = A7[0];
max_y = A10[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
I need a custom escutcheon design for a project, and I'd like it to be parametric so I can easily adjust the dimensions.

Basically, it should look like a kind of stepped flange with a hole in the center. The main part of the flange starts at the base with a larger radius, then tapers inwards and continues upwards at a smaller radius. The bottom part should be a certain percentage of the total height, and the top part should start at another, higher percentage of the total height.

Specifically, here are the parameters I'd like to control:

*   **`bottom_radius`**: The radius of the lower part of the flange.
*   **`top_radius`**: The radius of the upper, smaller part of the flange.
*   **`height`**: The total height of the escutcheon.
*   **`hole_radius`**: The radius of the central hole.
*   **`bottom_height_percent`**: The height of the lower part of the flange, expressed as a percentage of the total height (from 0 to 1).
*   **`top_height_percent`**: The height at which the upper part of the flange starts, expressed as a percentage of the total height (from 0 to 1).
*   **`curve_radius`**: A radius to round out the external sharp corners of the profile with an offset curve.

I need the whole thing to be a 3D object, so it should be generated by a rotation. I would like a high number of segments to make it smooth.

Could you generate the OpenSCAD code for this, please? I don't need any external libraries, so just the core OpenSCAD functionality would be perfect.

[Assistant]
escutcheon.scad:
```
//////////////////////////////////
// Parametric Escutcheon
// 2017-12-11
// Ryan Stachurski
//////////////////////////////////

// Radius of the lower part of the escutcheon flange
bottom_radius           = 15;
// Radius of the upper part of the escutcheon flange
top_radius              = 5.5;
// Total height of the escutcheon
height                  = 6;
// Radius of the hole
hole_radius             = 2.5;
// Height of the lower part of the escutcheon flange as a percent of the total height [0..1]
bottom_height_percent   = 0.15;
// Height of the location of the upper part of the escutcheon flange as a percent of the total height [0..1]
top_height_percent      = 0.5;
// Decorative outside curve radius
curve_radius            = 1;

/* [Hidden] */
$fn=200;
bs = bottom_radius - curve_radius;
ts = top_radius - curve_radius;
hs = height - curve_radius;

rotate_extrude($fn=200) {

    difference (){
        offset(r=curve_radius) polygon( points=[[0,0],[bs,0],[bs,hs*bottom_height_percent],[ts,hs*top_height_percent],[ts,hs],[0,hs]] );

        //cut out side slop and for hole
        polygon( points=[[hole_radius,-curve_radius],[-curve_radius,-curve_radius],[-curve_radius,height],[hole_radius,height] ] );

        //cut out bottom slop
        polygon( points=[[0,0],[0,-curve_radius],[bottom_radius,-curve_radius],[bottom_radius,0] ]);
    }

}
```


[User]
I'd like to generate a customizable origami bird design in OpenSCAD. I need it to be parametric, allowing me to control the overall size, height, and thickness of the outlines. I have some specific requirements:

1.  **Overall Size:** I want to be able to specify a maximum size for the longest side of the bird. The other side should scale proportionally to maintain the aspect ratio. I need to be able to set the maximum size in millimeters.
2.  **Height:** I need to be able to control the overall height of the 3D model in millimeters.
3.  **Outline Thickness:** I need to specify the thickness of both the outer and inner outlines, both in millimeters.
4.  **Inner Outline Roundness:** The inner outline should have rounded edges, and I need to control the radius of these rounded edges, again in millimeters.
5.  **Flip Option:** I'd like an option to flip the model horizontally.
6.  **Point Data:** The design is based on a set of points for the outer and inner shapes, which I can provide, along with polygon definitions specifying how the points connect. Here's the data:

    **Outer Points:**

    *   A1 = \[972, 861]
    *   A2 = \[1037, 845]
    *   A3 = \[1106, 789]
    *   A4 = \[1138, 781]
    *   A5 = \[1205, 816]
    *   A6 = \[1297, 897]
    *   A7 = \[1350, 968]
    *   A8 = \[1448, 950]
    *   A9 = \[1710, 784]
    *   A10 = \[1621, 929]
    *   A11 = \[1472, 1177]
    *   A12 = \[1552, 1300]
    *   A13 = \[1258, 1271]
    *   A14 = \[1241, 1262]
    *   A15 = \[1184, 1295]
    *   A16 = \[1198, 1227]
    *   A17 = \[1134, 1173]
    *   A18 = \[1085, 1138]
    *   A19 = \[1068, 1042]
    *   A20 = \[1050, 973]
    *   A21 = \[1033, 906]

    **Inner Points:**

    *   B1 = \[1140, 912]
    *   B2 = \[1141, 874]
    *   B3 = \[1184, 895]
    *   B4 = \[1176, 1047]

    **Polygons (for cuts):**

    *   C1 = \[A1, A2, A21] - (This one doesn't seem to be used)
    *   C2 = \[A2, A3, A4, B2, B1, A20, A21]
    *   C3 = \[A4, A5, A6, A7, B4, A17, A18, A19, B3, B2]
    *   C4 = \[B2, B3, A19, A20, B1]
    *   C5 = \[A16, A15, A14]
    *   C6 = \[A17, B4, A7, A11, A12, A13, A14, A16]
    *   C7 = \[A7, A8, A11]
    *   C8 = \[A8, A10, A11]
    *   C9 = \[A10, A9, A8]

7.  **Output:** The final output should be a 3D model where the outer shape is extruded and the inner polygons are cut out of the extrusion.

I'm looking for a single `.scad` file with this functionality, and I'm hoping you can use the built-in `offset()` function for the outline generation, as well as built-in polygon support. No other special libraries should be needed.

Thanks!

[Assistant]
customizable_origami_bird.scad:
```
/*
 * Customizable Origami - Bird - https://www.thingiverse.com/thing:2712239
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-13
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 1.8; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.7; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.7; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [972, 861];
A2 = [1037, 845];
A3 = [1106, 789];
A4 = [1138, 781];
A5 = [1205, 816];
A6 = [1297, 897];
A7 = [1350, 968];
A8 = [1448, 950];
A9 = [1710, 784];
A10 = [1621, 929];
A11 = [1472, 1177];
A12 = [1552, 1300];
A13 = [1258, 1271];
A14 = [1241, 1262];
A15 = [1184, 1295];
A16 = [1198, 1227];
A17 = [1134, 1173];
A18 = [1085, 1138];
A19 = [1068, 1042];
A20 = [1050, 973];
A21 = [1033, 906];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21];

// Inner Points
B1 = [1140, 912];
B2 = [1141, 874];
B3 = [1184, 895];
B4 = [1176, 1047];

// Polygons
C1 = [A1, A2, A21];
C2 = [A2, A3, A4, B2, B1, A20, A21];
C3 = [A4, A5, A6, A7, B4, A17, A18, A19, B3, B2];
C4 = [B2, B3, A19, A20, B1];
C5 = [A16, A15, A14];
C6 = [A17, B4, A7, A11, A12, A13, A14, A16];
C7 = [A7, A8, A11];
C8 = [A8, A10, A11];
C9 = [A10, A9, A8];

cut_polygons = [/*C1,*/ C2, C3, C4, C5, C6, C7, C8, C9];

min_x = A1[0];
min_y = A4[1];
max_x = A9[0];
max_y = A12[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
I'd like to create a customizable origami-style angel design in OpenSCAD, similar to the one described in the Thingiverse link, but I'm looking for a completely fresh design, not an altered version of the existing one.

I want to be able to control the following parameters:

*   **Overall size:** I need a parameter to specify the maximum dimension (length or width) of the angel. The shorter dimension should scale proportionally to keep the aspect ratio.
*   **Model height:**  This will control the thickness of the extruded angel.
*   **Outline thickness:** I need separate controls for the thickness of the outer and inner outlines.
*   **Inner outline edge radius:** I'd like to be able to control the roundness of the ends of the inner outline cuts, so they're not sharp.
*  **Flip model:** I'd also like to have a "flip model" option to mirror the angel along the y-axis.

The design itself should be a stylized origami-style angel, not necessarily a copy of the provided Thingiverse design. It should have an outer outline and some inner cut outlines that give it the folded paper look. I'm envisioning a relatively simple design, so it's easier to see the individual cuts. I'm flexible on the specific angel shape as long as it's recognizable.

I’d prefer to keep the code clean and organized, with clearly defined sections for parameters, the main program, and any necessary modules. Also, I don't have any OpenSCAD libraries installed, so please stick to vanilla OpenSCAD functions and modules. I also am not going to use any hidden parameters.

[Assistant]
customizable_origami_angel.scad:
```
/*
 * Customizable Origami - Angel - https://www.thingiverse.com/thing:2714843
 * by Dennis Hofmann - https://www.thingiverse.com/mightynozzle/about
 * created 2017-12-14
 * version v1.0
 *
 * Changelog
 * --------------
 * v1.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

 // Parameter Section //
//-------------------//

// preview[view:north, tilt:top]

// The maximum size of the longest side. The shorter side will be automatically resized in same ratio.
max_size_in_millimeter = 120; //[20:300]

// The height of the model.
model_height_in_millimeter = 5; //[0.2:0.2:100]

// Thickness of the outer outline.
outline_size_in_millimeter = 1.6; //[0.5:0.1:20]

// Thickness of the inner outline.
inline_size_in_millimeter = 0.75; //[0.5:0.1:20]

// Roundiness of the ends of the inner outlines.
inline_edge_radius_in_millimeter = 0.1; //[0.0:0.1:5]

// Flip model
flip_model = "no"; //[yes,no]

/*[hidden]*/
max_size = max_size_in_millimeter;
model_height = model_height_in_millimeter;
$fn=32;

// Outer Points
A1 = [1218, 1274];
A2 = [1665, 1379];
A3 = [1848, 1536];
A4 = [1829, 1499];
A5 = [1984, 1297];
A6 = [2114, 1515];
A7 = [2082, 1576];
A8 = [2153, 1544];
A9 = [2379, 1400];
A10 = [2869, 1371];
A11 = [2748, 1554];
A12 = [2637, 1698];
A13 = [2499, 1833];
A14 = [2392, 1896];
A15 = [2357, 1904];
A16 = [2326, 1934];
A17 = [2208, 1924];
A18 = [2170, 1973];
A19 = [2189, 2288];
A20 = [2171, 2428];
A21 = [2148, 2456];
A22 = [2149, 2587];
A23 = [2094, 2630];
A24 = [2084, 2679];
A25 = [2018, 2706];
A26 = [2007, 2753];
A27 = [1924, 2757];
A28 = [1854, 2724];
A29 = [1863, 2696];
A30 = [1789, 2631];
A31 = [1794, 2619];
A32 = [1732, 2527];
A33 = [1734, 2465];
A34 = [1682, 2374];
A35 = [1720, 2239];
A36 = [1698, 2190];
A37 = [1767, 1924];
A38 = [1747, 1902];
A39 = [1679, 1912];
A40 = [1613, 1863];
A41 = [1590, 1860];
A42 = [1498, 1780];
A43 = [1392, 1646];
A44 = [1292, 1460];

outline = [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32, A33, A34, A35, A36, A37, A38, A39, A40, A41, A42, A43, A44];

// Inner Points
B1 = [1947, 1419];
B2 = [1959, 1602];
B3 = [1855, 1594];
B4 = [2048, 1600];
B5 = [1960, 1719];
B6 = [1697, 1471];
B7 = [1736, 1567];
B8 = [1772, 1613];
B9 = [1831, 1606];
B10 = [2131, 1614];
B11 = [2299, 1503];
B12 = [2240, 1591];
B13 = [2200, 1660];
B14 = [2181, 1719];
B15 = [2196, 1763];
B16 = [1931, 1870];
B17 = [1894, 1710];
B18 = [1881, 1867];
B19 = [1738, 1750];
B20 = [1948, 2042];
B21 = [2049, 2157];
B22 = [2058, 2343];
B23 = [2009, 2539];
B24 = [1990, 2094];
B25 = [1983, 2663];
B26 = [1952, 2722];
B27 = [1814, 2527];
B28 = [1802, 2303];
B29 = [1767, 2277];
B30 = [1874, 2045];
B31 = [1777, 2518];
B32 = [1847, 2636];
B33 = [1895, 2702];
B34 = [1828, 2103];
B35 = [1907, 1603];
B36 = [2015, 1597];
B37 = [1868, 1505];
B38 = [2076, 1510];
B39 = [1952, 1442];
B40 = [1973, 1766];
B41 = [1856, 1751];
B42 = [2148, 1806];
B43 = [1820, 2628];

// Polygons
C1 = [A4, A5, B1];
C2 = [A5, A6, B1];
C3 = [A4, B1, A6, B38, B39, B37];
C4 = [A4, A3, B3, B35, B37];
C5 = [B2, B39, B37, B35];
C6 = [B39, B2, B36, B38];
C7 = [B36, B4, A7, A6, B38];
C8 = [B4, A7, A8, A9, B11, B10];
C9 = [B10, B11, B12, B13, B14];
C10 = [B40, B5, B4, B10];
C11 = [B5, B35, B3, B9, B41, B17, B40];
C12 = [B5, B35, B2, B36, B4];
C13 = [B10, B14, B15, B16, B40];
C14 = [B40, B17, B16];
C15 = [B17, B41, B18];
C16 = [B19, B8, B41, B18];
C17 = [B18, B17, B16];
C18 = [A9, A10, A11, B11];
C19 = [A11, A12, B12, B11];
C20 = [A12, A13, B13, B12];
C21 = [A13, A14, B13];
C22 = [A14, B13, B14, A16, A15];
C23 = [B14, A16, A17, A18, B15];
C24 = [B15, B42, A18];
C25 = [B16, B20, B42, B15];
C26 = [B42, A18, A19, B21, B24, B20];
C27 = [B21, B22, A19];
C28 = [B22, A19, A20];
C29 = [A20, A21, B23, B24, B21, B22];
C30 = [A21, A22, B23];
C31 = [A22, A23, B25, B24, B23];
C32 = [A23, A24, B25];
C33 = [A24, A25, B26, B24, B25];
C34 = [A25, A26, B26];
C35 = [A26, A27, B24, B26];
C36 = [B19, B30, B18];
C37 = [B30, B34, A36, A37, B19];
C38 = [A2, B6, B7, B8, B41, B9];
C39 = [A2, B9, B3, A3];
C40 = [A1, A2, B6, A44];
C41 = [B6, B7, A43, A44];
C42 = [B7, B8, A42, A43];
C43 = [B8, A41, A42];
C44 = [B8, B19, A39, A40, A41];
C45 = [B19, A39, A38, A37];
C46 = [B34, A36, A35, B29];
C47 = [A35, A34, B29];
C48 = [A34, B28, B34, B29];
C49 = [A34, A33, B31, B30, B34, B28];
C50 = [A33, A32, B31];
C51 = [A32, B27, B30, B31];
C52 = [A32, A31, B43, B30, B27];
C53 = [A30, B32, B30, B43, A31];
C54 = [A30, A29, B30, B32];
C55 = [B18, B30, A29, A28, B33];
C56 = [A28, B33, B18, B16, B20, B24, A27];

cut_polygons = [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43, C44, C45, C46, C47, C48, C49, C50, C51, C52, C53, C54, C55, C56];

min_x = A1[0];
min_y = A1[1];
max_x = A10[0];
max_y = A27[1];

x_size = max_x - min_x;
y_size = max_y - min_y;

x_factor = max_size / x_size;
y_factor = max_size / y_size;

inline_size = x_size > y_size ? inline_size_in_millimeter / x_factor / 2: inline_size_in_millimeter / y_factor / 2;
inline_edge_radius = x_size > y_size ? inline_edge_radius_in_millimeter / x_factor: inline_edge_radius_in_millimeter / y_factor;
outline_size = x_size > y_size ? outline_size_in_millimeter / x_factor - inline_size: outline_size_in_millimeter / y_factor - inline_size;

 // Program Section //
//-----------------//

if(x_size > y_size) {
    resize(newsize=[max_size, x_factor * y_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
} else {
    resize(newsize=[y_factor * x_size, max_size, model_height]){
        if(flip_model == "yes") {
            mirror([0,1,0]) {
                rotate([180,180,0]) {
                    create(outline, cut_polygons);
                }
            }
        } else {
            create(outline, cut_polygons);
        }
    }
}

 // Module Section //
//----------------//

module create() {
    linear_extrude(height=1) {
        difference() {
            offset(r = -0) {
                offset(r = +outline_size) {
                    polygon(points = outline, convexity = 10);
                }
            }

            for(cut_polygon = [0:len(cut_polygons)]) {
                offset(r = +inline_edge_radius) {
                    offset(r = -inline_size - inline_edge_radius) {
                        polygon(points = cut_polygons[cut_polygon], convexity = 10);
                    }
                }
            }
        }
    }
}

```


[User]
Hey, I'm trying to create a customizable rectangular prism in OpenSCAD, kind of like the "hokum" thing I saw on Thingiverse, but with more flexibility and a bit less jokey. I need to be able to control the three dimensions of the prism, and I want an option to flip it along the Y-axis.

I'd like the parameters to be:

*   `length`: Controls the length of the prism (along the X-axis).
*   `width`: Controls the width of the prism (along the Y-axis).
*   `height`: Controls the height of the prism (along the Z-axis).
*   `flip_y`: A boolean value (true or false) to flip the prism across the Y-axis. If it's `true`, the prism should be mirrored along the Y-axis after being rotated 180 degrees around the X and Y axes.

Could you generate an OpenSCAD file for me with these parameters? I don't need any complex features, just a basic rectangular prism that can be manipulated in these ways. Thanks!

[Assistant]
customizable_origami_hokum_V3.scad:
```
/*
 * Customizable Origami - Hokum
 *
 * created 2017-11-23
 * version v1.0
 *
 * Changelog
 * --------------
 * v2.0:
 *      - final design
 * --------------
 *
 * This work is licensed under the Creative Commons - Attribution - NonCommercial - ShareAlike license.
 * https://creativecommons.org/licenses/by-nc-sa/3.0/
 */

// preview[view:north, tilt:top]

// The maximum size of creation. Or the minimum, depending on your viewpoint.
hokum_pokum = 10; //[20:300]

// Higher.
dont_use_its_dangerous = 10; //[0.2:0.2:100]

// No idea what this does
No_idea_what_this_does = 5;

// Flip model
flip_model = "no"; //[yes,no]

module TheThing()
{
    cube([hokum_pokum,dont_use_its_dangerous,No_idea_what_this_does]);
}

if(flip_model == "yes") {
    mirror([0,1,0]) {
        rotate([180,180,0]) {
            TheThing();
        }
    }
} else {
    TheThing();
}

```