Begin with three named dimensions
The example below describes a cylindrical spacer with a central hole. The numbers are model dimensions in millimeters for this workflow. Choose values for your own project after measuring what the spacer must fit.
The outside cylinder defines the body. The second cylinder extends beyond the top and bottom and is removed by difference(), leaving a through-hole. The small extension helps avoid coincident cut surfaces.
outside_diameter = 20;
hole_diameter = 6;
height = 5;
$fn = 64;
assert(outside_diameter > hole_diameter && hole_diameter > 0);
assert(height > 0);
difference() {
cylinder(d = outside_diameter, h = height);
translate([0, 0, -1])
cylinder(d = hole_diameter, h = height + 2);
}Source: OpenSCAD official documentation.
Change one parameter and inspect the relationship
Change height from 5 to 8, render again, and check that the hole still passes through the whole body. Then return height to 5 and change the hole diameter. The outside diameter should stay fixed because it is controlled by a separate value.
The assertions reject non-positive dimensions and a hole that is as large as the outside body. They protect this example’s basic relationships. They do not establish whether a particular wall thickness or material is suitable for a real load.
Use the source as your editable record
A mesh export captures the resulting shape. The OpenSCAD program retains the variables and the way the shape is built. Keep both if you expect to make several sizes or revisit a part after a fit test.
In Extrudely, you can inspect a design’s OpenSCAD code, edit it directly, and save a new version. AI can help with changes, but you can also make a small, clearly understood parameter edit yourself.
Check the model before printing
Export the saved version to a compatible slicer. Confirm the outside diameter, hole diameter, and height against your intended values. Inspect the layer preview and select the printer and material settings for that attempt.
For a spacer that must fit a shaft or fastener, make a small fit test before relying on the result. Keep the printed observations with the source version so a later parameter change does not inherit an older fit claim.
Try a part you can measure
Start with a simple shape, inspect the dimensions, and save a version before your next revision.