Thank you for your interest in contributing! This project welcomes contributions of all kinds.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/three-plotter-renderer.git - Install dependencies:
npm install - Start the dev server:
npm run dev
npm run dev # Start Vite dev server with hot reload
npm run build # Build production bundles (ES + UMD + sourcemaps)
npm run test # Run tests with Vitest├── src/
│ ├── index.js # Barrel export (main entry point)
│ ├── index.d.ts # TypeScript declarations
│ ├── plotter-renderer.js # Main PlotterRenderer class
│ ├── hidden-line.js # Edge-based hidden line removal
│ ├── gpu-silhouette.js # GPU normal-based region extraction
│ ├── perspective-hatch.js # Depth-aware perspective hatching
│ ├── projector.js # Three.js scene projection
│ ├── optimize.js # Path optimization for plotters
│ └── geom/ # Geometry utilities
├── examples/
│ ├── stl-viewer.html # STL file viewer demo
│ └── output/ # Example SVG outputs
├── public/ # Static assets
├── dist/ # Built bundles
└── index.html # Main primitives demo
| Module | Purpose |
|---|---|
PlotterRenderer |
Main renderer class, manages SVG layers and rendering pipeline |
computeHiddenLinesMultiple |
CPU-based hidden line computation with edge classification |
extractNormalRegions |
GPU-based region extraction using normal buffer |
generatePerspectiveHatches |
Creates perspective-aware hatch lines |
Optimize |
Path optimization to minimize pen travel |
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Test with
npm run devand verify in browser - Run tests:
npm run test - Build:
npm run build - Commit with a clear message:
git commit -m "Add feature X" - Push and open a Pull Request
- Use ES modules with explicit imports/exports
- Add JSDoc comments with types for public APIs
- Maintain TypeScript compatibility (update
index.d.tsfor API changes) - Keep functions focused and well-documented
When reporting bugs, please include:
- Browser and version
- Three.js version
- Steps to reproduce
- Expected vs actual behavior
- Console errors if any
Open an issue or reach out to @neurofuzzy.