Files
pcie/pcie.scad
T

33 lines
1.0 KiB
OpenSCAD
Raw Normal View History

2025-07-21 23:56:12 +08:00
// 2020 Extrusion Insert
// Configurable 3D printable insert for 2020 aluminum extrusion
2025-07-21 23:55:17 +08:00
2025-07-21 23:56:12 +08:00
// Import PCIe holder functionality
include <holder.scad>;
2025-07-21 23:55:17 +08:00
2025-07-21 23:59:52 +08:00
// Trapezium module - creates a centralized trapezoid shape
// Parameters:
// base_width: width of the bottom edge
// top_width: width of the top edge
// height: height of the trapezium
// depth: depth/thickness of the shape (default 1)
module trapezium(base_width, top_width, height, depth = 1) {
// Calculate the difference in width
width_diff = base_width - top_width;
2025-07-21 23:55:17 +08:00
2025-07-21 23:59:52 +08:00
// Create the trapezoid points (centered)
points = [
[-base_width/2, -height/2], // bottom left
[base_width/2, -height/2], // bottom right
[top_width/2, height/2], // top right
[-top_width/2, height/2] // top left
];
2025-07-21 23:55:17 +08:00
2025-07-21 23:59:52 +08:00
// Extrude the 2D trapezoid to create 3D shape
linear_extrude(height = depth, center = true) {
polygon(points);
2025-07-21 23:55:17 +08:00
}
}
2025-07-21 23:59:52 +08:00
// Example usage (uncomment to test):
trapezium(base_width = 20, top_width = 10, height = 15, depth = 3);