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

From BITPlan Wiki
Jump to navigation Jump to search
Line 11: Line 11:
 
= Steps =
 
= Steps =
 
== Step 1: Create beamAt Module ==
 
== Step 1: Create beamAt Module ==
=== Prompt ===
+
'''Prompt''': Create a beamAt module that positions and rotates a cube beam at any location with any orientation. Give an example
Create a beamAt module that positions and rotates a cube beam at any location with any orientation.
+
 
=== Result ===
+
<source lang="openscad">
<source lang="scad">
 
 
module beamAt(position, rotation, dimensions) {
 
module beamAt(position, rotation, dimensions) {
 
   translate(position) {
 
   translate(position) {
Line 20: Line 19:
 
   cube(dimensions);
 
   cube(dimensions);
 
}
 
}
</source>
 
 
=== Example ===
 
<source lang="scad">
 
 
beamAt([10, 5, 0], [0, 0, 45], [40, 3, 3]);  // beam at position, rotated 45° on Z-axis
 
beamAt([10, 5, 0], [0, 0, 45], [40, 3, 3]);  // beam at position, rotated 45° on Z-axis
 
</source>
 
</source>

Revision as of 09:32, 14 June 2025

We would like to get 3D printer design for a TrussBridge load PDF

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 a beamAt module that positions and rotates a cube beam at any location with any orientation. Give an example

module beamAt(position, rotation, dimensions) {
  translate(position) {
  rotate(rotation) {
  cube(dimensions);
}
beamAt([10, 5, 0], [0, 0, 45], [40, 3, 3]);  // beam at position, rotated 45° on Z-axis