Difference between revisions of "Creating a Model Truss Bridge with AI"

From BITPlan Wiki
Jump to navigation Jump to search
Line 32: Line 32:
  
 
== Step 2: Crude Bridge ==
 
== Step 2: Crude Bridge ==
'''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 creating the necessary frame spanning the whole way - in reality this could be a valid construction step to allow transport of material, tools and workers.  
+
'''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 creating the necessary frame spanning the whole way - in reality this could be a valid construction step to allow transport of material, tools and workers.
 +
Use loops to position 3 quadruples of 4 beams each with the beamAt function:
  
Use loops to position 6 pairs of 2 beams each with the beamAt function:
+
# Quadruple 1: Main structural frame (2 bottom chords spanning whole bridge + 2 top chords at bridge height but shorter)
# Pair 1: 2 beams spanning the whole bridge horizontally (bottom chords)
+
# Quadruple 2: End connections (2 beams connecting lower chords horizontally at bridge ends + 2 beams connecting upper chords horizontally at bridge ends)
# Pair 2: 2 beams vertically parallel over the first pair at bridge height but shorter (top chords)  
+
# Quadruple 3: Angular connections (2 angular beams connecting left ends of top/bottom chords + 2 angular beams connecting right ends of top/bottom chords)
# Pair 3: 2 beams connecting the lower pair horizontally at bridge ends
+
 
# Pair 4: 2 beams connecting the upper pair horizontally at bridge ends
+
Create reusable construction functions that can:
# Pair 5: 2 angular beams connecting left ends of top and bottom chords
+
 
# Pair 6: 2 angular beams connecting right ends of top and bottom chords
+
* Generate longitudinal spanning elements with parametric lengths
 +
* Generate transverse connecting elements at specified positions
 +
* Generate angular connecting elements between different height levels
 +
* Generate vertical connecting elements between different height levels (not used yet)
 +
* Accept parameters for scaling and positioning for future truss panel multiplication
 +
* Be combined for complete truss bridge assembly
  
 
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
 
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

Revision as of 20:27, 14 June 2025

We would like to get 3D printer design for a modelTrussBridge Trussbridge1.pngTrussbridge2.pngTrussbridge3.png


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.

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

Example answer by Deepseek

Step 2: Crude Bridge

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 creating the necessary frame spanning the whole way - in reality this could be a valid construction step to allow transport of material, tools and workers. Use loops to position 3 quadruples of 4 beams each with the beamAt function:

  1. Quadruple 1: Main structural frame (2 bottom chords spanning whole bridge + 2 top chords at bridge height but shorter)
  2. Quadruple 2: End connections (2 beams connecting lower chords horizontally at bridge ends + 2 beams connecting upper chords horizontally at bridge ends)
  3. Quadruple 3: Angular connections (2 angular beams connecting left ends of top/bottom chords + 2 angular beams connecting right ends of top/bottom chords)

Create reusable construction functions that can:

  • Generate longitudinal spanning elements with parametric lengths
  • Generate transverse connecting elements at specified positions
  • Generate angular connecting elements between different height levels
  • Generate vertical connecting elements between different height levels (not used yet)
  • Accept parameters for scaling and positioning for future truss panel multiplication
  • Be combined for complete truss bridge assembly

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

load PDF