1
0
Fork 0
mirror of https://github.com/imjasonh/scad-to-png synced 2026-07-07 01:22:23 +00:00
scad-to-png/test-suite/30-knurled-cylinder.scad
Jason Hall 0fcfc580f1
Add comprehensive test suite and automatic README generation
- Add 40 test SCAD files covering various OpenSCAD features:
  - Basic shapes (sphere, cylinder, cone, torus)
  - Boolean operations (union, difference, intersection)
  - Advanced features (polyhedron, extrusion, recursion)
  - Complex patterns (Menger sponge, voronoi, fractals)
  - Mathematical surfaces (bezier, gyroid, saddle)
  - Mechanical parts (gears, springs, knurled surfaces)

- Add automatic README.md generation for each output:
  - Links to STL file
  - Displays all 8 PNG views
  - Includes timestamp and attribution

- Document discovered limitations:
  - Text rendering requires fonts (not available in WASM)
  - Complex boolean operations may fail
  - Mesh topology constraints
  - No implicit surface support
  - No adaptive mesh refinement

- Update generate-test-suite.sh to show timing information

The test suite validates functionality and documents edge cases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 19:28:23 -04:00

25 lines
No EOL
945 B
OpenSCAD

// Knurled cylinder with diamond pattern
module knurled_cylinder(height, radius, knurl_depth, knurl_count) {
difference() {
// Base cylinder
cylinder(h = height, r = radius, $fn = 60);
// First set of helical grooves
for (i = [0:knurl_count-1]) {
rotate([0, 0, i * 360 / knurl_count])
linear_extrude(height = height * 1.2, twist = 360)
translate([radius - knurl_depth/2, 0, 0])
square([knurl_depth, knurl_depth/2], center = true);
}
// Second set of helical grooves (opposite direction)
for (i = [0:knurl_count-1]) {
rotate([0, 0, i * 360 / knurl_count])
linear_extrude(height = height * 1.2, twist = -360)
translate([radius - knurl_depth/2, 0, 0])
square([knurl_depth, knurl_depth/2], center = true);
}
}
}
knurled_cylinder(30, 10, 0.5, 30);