mirror of
https://github.com/imjasonh/scad-to-png
synced 2026-07-07 01:22:23 +00:00
Update README and CLAUDE.md with recent additions and learnings
- Document automatic README.md generation for outputs - Add known limitations discovered from test suite - Update repository URL to correct GitHub account - Add font support issues and workarounds - Document test suite structure and usage - Include debugging tips for test failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
54e6695451
commit
73954341fd
2 changed files with 33 additions and 3 deletions
29
CLAUDE.md
29
CLAUDE.md
|
|
@ -52,6 +52,15 @@ Since WebGL is not easily available in Node.js, the project implements a softwar
|
|||
- `node-canvas` requires complex native dependencies
|
||||
- Solution: Use `@napi-rs/canvas` which has better cross-platform support
|
||||
|
||||
4. **Font Support Issues**
|
||||
- OpenSCAD WASM cannot access system fonts in the Node.js environment
|
||||
- The `text()` function will fail with "Can't get font" errors
|
||||
- Solution: Skip text-based tests or document as a known limitation
|
||||
|
||||
5. **README Generation**
|
||||
- The tool now automatically generates README.md files with embedded images
|
||||
- Each output directory gets a README for easy web viewing on GitHub
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
|
|
@ -63,7 +72,10 @@ scad-to-png/
|
|||
│ ├── openscad.js # Emscripten-generated JS wrapper
|
||||
│ └── openscad.wasm # WebAssembly binary
|
||||
├── test.scad # Test file with cube, cylinder hole, and sphere
|
||||
└── output/ # Generated PNG files
|
||||
├── examples/ # Example SCAD files
|
||||
├── test-suite/ # Comprehensive test suite (40+ test files)
|
||||
├── generate-test-suite.sh # Script to regenerate all test outputs
|
||||
└── output/ # Generated PNG, STL, and README files
|
||||
```
|
||||
|
||||
## Development Guidelines
|
||||
|
|
@ -90,6 +102,8 @@ Test with various OpenSCAD files:
|
|||
- Complex models with many triangles
|
||||
- Both ASCII and binary STL outputs
|
||||
- Parametric models with different parameter values
|
||||
- Run `./generate-test-suite.sh` to regenerate all test outputs
|
||||
- Check `test-suite/` directory for comprehensive test coverage
|
||||
|
||||
### Future Improvements
|
||||
|
||||
|
|
@ -120,6 +134,8 @@ Test with various OpenSCAD files:
|
|||
|
||||
4. **Rendering Issues**: Export projected 2D coordinates to verify the projection math
|
||||
|
||||
5. **Test Suite Failures**: Check individual test output directories for error messages and limitation README files
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `commander`: CLI argument parsing
|
||||
|
|
@ -127,6 +143,17 @@ Test with various OpenSCAD files:
|
|||
- `@napi-rs/canvas`: Cross-platform canvas implementation
|
||||
- No direct OpenSCAD dependency - uses WASM build
|
||||
|
||||
## Known Limitations (from Test Suite)
|
||||
|
||||
Based on our comprehensive test suite, the following limitations have been identified:
|
||||
|
||||
1. **Text Rendering** (test 09): The `text()` function fails due to font access issues in WASM
|
||||
2. **Import Functions** (test 36): Cannot import external STL/DXF files in WASM environment
|
||||
3. **Mesh Deformation** (test 37): Complex mesh operations may produce non-closed meshes
|
||||
4. **File I/O** (test 38): No support for reading/writing external files
|
||||
5. **Advanced Features** (test 39): Some experimental features not available in WASM
|
||||
6. **System Integration** (test 40): No access to system resources or external commands
|
||||
|
||||
## Related Projects
|
||||
|
||||
- [OpenSCAD WASM](https://github.com/openscad/openscad-wasm) - The WebAssembly port
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ A CLI tool that converts OpenSCAD files to PNG images from multiple viewpoints w
|
|||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/yourusername/scad-to-png.git
|
||||
git clone https://github.com/imjasonh/scad-to-png.git
|
||||
cd scad-to-png
|
||||
|
||||
# Install dependencies
|
||||
|
|
@ -66,7 +66,7 @@ Options:
|
|||
|
||||
## Output
|
||||
|
||||
The tool generates 8 PNG images and an STL file in the output directory:
|
||||
The tool generates 8 PNG images, an STL file, and a README in the output directory:
|
||||
- `<filename>.stl` - The 3D model in STL format
|
||||
- `front.png` - Front view
|
||||
- `back.png` - Back view
|
||||
|
|
@ -76,6 +76,7 @@ The tool generates 8 PNG images and an STL file in the output directory:
|
|||
- `bottom.png` - Bottom view
|
||||
- `isometric.png` - Isometric view
|
||||
- `isometric-alt.png` - Alternative isometric view
|
||||
- `README.md` - Markdown file with embedded images for easy web viewing
|
||||
|
||||
## How It Works
|
||||
|
||||
|
|
@ -125,6 +126,8 @@ scad-to-png
|
|||
- Large STL files may take longer to render
|
||||
- No support for materials or textures (uses simple grayscale shading)
|
||||
- OpenSCAD WASM may have different behavior than native OpenSCAD for some edge cases
|
||||
- Text rendering is not supported (OpenSCAD WASM limitation due to font dependencies)
|
||||
- Some advanced OpenSCAD features may not work in the WASM environment
|
||||
|
||||
## Use Cases
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue