Creating a Model Truss Bridge with AI
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, applies a 3D rotation, and uses given dimensions. Add an example usage rotating the beam 45 degrees around the Z-axis. 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
// nicescad truss bridge example
// see https://wiki.bitplan.com/index.php/Creating_a_Model_Truss_Bridget_with_AI
// Copyright Wolfgang Fahl 2025-06-14
// 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 rotating the beam 45 degrees around the Z-axis. 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"
module beamAt(position, rotation, dimensions) {
translate(position)
rotate(rotation)
cube(dimensions);
}
// example usage
beamAt([10, 5, 0], [0, 0, 45], [40, 3, 3]); // beam at position, rotated 45° on Z-axis
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 triangles with one side
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