 |
CLIP Score: 22.34
openscad
// Parameters
pen_length = 140; // total length of the pen
cap_length = 60;
section_length = 20; // section (grip) length
nib_length = 15; // nib length
barrel_radius = 5; // radius of the pen barrel
cap_radius = 6; // radius of the pen cap, slightly bigger than the barrel
section_radius = 4; // radius of the grip section
nib_width = 2; // half-width of the nib (for 2D representation)
// Barrel - main body of the fountain pen
module barrel() {
linear_extrude(height = 2)
translate([0, 0])
square([pen_length - cap_length, barrel_radius * 2]);
}
// Cap - the removable top of the fountain pen
module cap() {
linear_extrude(height = 2)
translate([pen_length - cap_length, 0])
square([cap_length, cap_radius * 2]);
}
// Section - grip part of the pen
module section() {
linear_extrude(height = 2)
translate([pen_length - cap_length - section_length, 0])
square([section_length, section_radius * 2]);
}
// Nib - writing tip of the pen
module nib() {
linear_extrude(height = 2)
translate([pen_length - cap_length - section_length - nib_length, 0])
polygon(points=[
[pen_length - cap_length - section_length, section_radius],
[pen_length - cap_length - section_length, -section_radius],
[pen_length - cap_length - section_length - nib_length, -nib_width],
[pen_length - cap_length - section_length - nib_length, nib_width]
]);
}
// Assemble all parts into the complete pen
module fountain_pen() {
barrel();
cap();
section();
nib();
}
// Render the fountain pen
fountain_pen();
|
Please generate a 2D CAD file in OpenSCAD for fountain pen
Creating a detailed 2D CAD drawing of a fountain pen in OpenSCAD requires understanding the basic geometric shapes and their transformations. Below is a simple 2D representation of a fountain pen, focusing on a side profile. This will likely include the barrel, cap, nib, and section details. Here is the OpenSCAD script:
```openscad
// Parameters
pen_length = 140; // total length of the pen
cap_length = 60;
section_length = 20; // section (grip) length
nib_length = 15; // nib length
barrel_radius = 5; // radius of the pen barrel
cap_radius = 6; // radius of the pen cap, slightly bigger than the barrel
section_radius = 4; // radius of the grip section
nib_width = 2; // half-width of the nib (for 2D representation)
// Barrel - main body of the fountain pen
module barrel() {
linear_extrude(height = 2)
translate([0, 0])
square([pen_length - cap_length, barrel_radius * 2]);
}
// Cap - the removable top of the fountain pen
module cap() {
linear_extrude(height = 2)
translate([pen_length - cap_length, 0])
square([cap_length, cap_radius * 2]);
}
// Section - grip part of the pen
module section() {
linear_extrude(height = 2)
translate([pen_length - cap_length - section_length, 0])
square([section_length, section_radius * 2]);
}
// Nib - writing tip of the pen
module nib() {
linear_extrude(height = 2)
translate([pen_length - cap_length - section_length - nib_length, 0])
polygon(points=[
[pen_length - cap_length - section_length, section_radius],
[pen_length - cap_length - section_length, -section_radius],
[pen_length - cap_length - section_length - nib_length, -nib_width],
[pen_length - cap_length - section_length - nib_length, nib_width]
]);
}
// Assemble all parts into the complete pen
module fountain_pen() {
barrel();
cap();
section();
nib();
}
// Render the fountain pen
fountain_pen();
```
To use this script:
1. Copy and paste the above code into an OpenSCAD editor.
2. Render the model by pressing F5, and then press F6 to compile and view the final 2D drawing.
This script creates a simplified 2D side profile representation of a fountain pen with key components: barrel, cap, section (grip), and nib. You can adjust the parameters for length and radius to better match the specifications of your desired pen.
|