1
0
Fork 0
mirror of https://github.com/imjasonh/scad-to-png synced 2026-07-08 01:45:13 +00:00
scad-to-png/test-suite/40-adaptive-mesh.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

39 lines
No EOL
1 KiB
OpenSCAD

// Adaptive mesh refinement based on curvature
module adaptive_mesh_sphere() {
// Create sphere with varying detail based on viewing angle
// High detail front hemisphere
intersection() {
sphere(r = 20, $fn = 80);
translate([10, 0, 0])
cube([40, 40, 40], center = true);
}
// Medium detail sides
intersection() {
sphere(r = 20, $fn = 40);
difference() {
cube([40, 40, 40], center = true);
translate([10, 0, 0])
cube([40, 40, 40], center = true);
translate([-30, 0, 0])
cube([40, 40, 40], center = true);
}
}
// Low detail back
intersection() {
sphere(r = 20, $fn = 20);
translate([-30, 0, 0])
cube([40, 40, 40], center = true);
}
// Add surface features that need high detail
for (i = [0:5]) {
rotate([0, i * 60, 0])
translate([20, 0, 0])
sphere(r = 2, $fn = 30);
}
}
adaptive_mesh_sphere();