Difference between revisions of "Creating a Model Truss Bridge with AI"
Line 14: | Line 14: | ||
= Steps = | = Steps = | ||
== Step 1: Create beamAt Module == | == Step 1: Create beamAt Module == | ||
− | '''Prompt''': Create an OpenSCAD module named beamAt that places a cube beam at a specified 3D position, applies a 3D rotation, and uses given dimensions. Add an example usage | + | '''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 |
<source lang="openscad"> | <source lang="openscad"> | ||
− | // | + | // https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI |
− | + | // Copyright Wolfgang Fahl 2025-06-15 | |
− | // Copyright Wolfgang Fahl 2025-06- | + | |
− | + | 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 |
− | beamAt( | + | // horizontal beam |
− | + | beamAt( | |
+ | 0, 0, 0, | ||
+ | 0, 0, 0, | ||
+ | 10, 1, 1); | ||
+ | // vertical beam | ||
+ | beamAt( | ||
+ | 0, 0, 0, | ||
+ | 0, 270, 0, | ||
+ | 10, 1, 1); | ||
</source> | </source> | ||
− | [https://nicescad.bitplan.com/design/ | + | * [https://nicescad.bitplan.com/design/y24n3uuj Example answer] by [https://chatgpt.com ChatGPT] |
== Step 2: Warren Truss pattern == | == Step 2: Warren Truss pattern == |
Revision as of 07:07, 15 June 2025
We would like to get 3D printer design for a modelTrussBridge
We want a design combining a Warren truss pattern on the side with
an X Pattern on the top and bottom of the bridge.
We will use the nicescad webinterface to OpenScad for our design and Claude AI as the AI chat tool.
First we need a list of prompts that will lead to a proper scad module. Note how there area ready made models available at https://www.yeggi.com/q/n+scale+truss+bridge/ and still the AIs behave like stochastical parrots and have no clue what they are doing - see Talk page.
Steps
Step 1: Create beamAt Module
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
// https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI
// Copyright Wolfgang Fahl 2025-06-15
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);
Step 2: Warren Truss pattern
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. We can form the pattern with three types of beams: horizontal, vertical and diagonal. Create the helper functions for the three types of beams and the warren function allowing to alternate the 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
References
HAER-Truss-Poster
see HISTORIC AMERICAN EINGINEERIING RECORD