Prompt: Create an OpenSCAD module named beamAt that places a cube beam at a specified 3D position x,y,z, applies a 3D rotation rx,ry,rz, and uses given dimensions sx,sy,sz. Add an example usage creating a horizontal and vertical beam. Add a header comment with a link to https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI and // Copyright Wolfgang Fahl with current iso date
// Prompt:
// Create an OpenSCAD module named `polygonAt` that places a polygon-based beam at a 3D position `x,y,z`,
// applies 3D rotation `rx,ry,rz`, and extrudes the polygon with `linear_extrude(height=length)`.
// The polygon is defined via `points` and should be extruded symmetrically around its local origin.
// Define a second module `beamAt(x, y, z, rx, ry, rz, sx, sy, sz)` that creates a centered rectangular beam
// cross-section of width `sy`, height `sz` and extrudes it along its axis with length `sx`.
// Add example usage for a horizontal beam (extruded along X) and vertical beam (extruded along Z).
// Add a header comment with a link to https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI
// and // Copyright Wolfgang Fahl with current iso date
// https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI
// Copyright Wolfgang Fahl 2025-06-15
// place and extrude a 2D polygon at given 3D position and rotation
module polygonAt(x, y, z, rx, ry, rz, length, points) {
translate([x, y, z])
rotate([rx, ry, rz])
translate([0, 0, -length/2]) // center extrusion symmetrically
linear_extrude(height=length)
polygon(points);
}
// place a rectangular beam at 3D position with given rotation and dimensions
module beamAt(x, y, z, rx, ry, rz, sx, sy, sz) {
polygonAt(x, y, z, rx, ry, rz, sx, [
[-sy/2, -sz/2],
[ sy/2, -sz/2],
[ sy/2, sz/2],
[-sy/2, sz/2]
]);
}
l=10; // length
h=1; // height
w=1; // width
// Example usage
// Horizontal beam along X â rotate ZâX
ry=90;
beamAt(
0, 0, 0,
0, ry, 0,
l, w, h
);
// Vertical beam
beamAt(
-l/2+w/2, 0, l/2,
0, 0, 0,
l, w, h
);Note that this answer was never created by ChatGPT - there was a loop of a dozen hallucinations and the variables and calculations for the example have been introduced manually after giving up.
Prompt: Based on module
beamAt(x, y, z, rx, ry, rz, sx, sy, sz) {
translate([x, y, z])
rotate([rx, ry, rz])
cube([sx, sy, sz]);
}
// Example usage
// horizontal beam
beamAt(
0, 0, 0,
0, 0, 0,
10, 1, 1);
// vertical beam
beamAt(
0, 0, 0,
0, 270, 0,
10, 1, 1);
create a rightTriangle function consisting of three beams and allow a positioned/rotated version rightTriangleAt. Add an example usage creating a warren truss pattern. Add a header comment with a link to https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI and // Copyright Wolfgang Fahl with current iso date
Prompt: For a european single track railway bridge - Length: 19.1m - Width: 3.3m - Height: 4.5m - Top beam: 16.2m - we want the Model scale: H0 (1:87) - open scad design. Use the existing beamAt to create a WarrenTruss pattern function. The base of the pattern are pairs of right angled triangles which in turn form isosceles triangles with a support beam in the middle.
Add a header comment with a link to https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI and // Copyright Wolfgang Fahl with current iso date
see HISTORIC AMERICAN EINGINEERIING RECORD
The last editor of this page did not have the right to Embed PDFs into pages.
see HISTORIC AMERICAN EINGINEERIING RECORD
The last editor of this page did not have the right to Embed PDFs into pages.