Initial open source release with CC BY-NC-SA 4.0 license
- Add complete CC BY-NC-SA 4.0 International License - Add comprehensive README with project description and usage - Add CONTRIBUTING guidelines for developers - Add Nix development environment with OpenSCAD tooling - Add .gitignore for OpenSCAD and Nix projects - Add copyright headers to source files
This commit is contained in:
commit
31bfdb83bb
6 changed files with 451 additions and 0 deletions
40
.gitignore
vendored
Normal file
40
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# Cuatro Project - .gitignore
|
||||
|
||||
# OpenSCAD generated files
|
||||
*.stl
|
||||
*.3mf
|
||||
*.amf
|
||||
|
||||
# Build artifacts
|
||||
build/
|
||||
output/
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*~
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
desktop.ini
|
||||
|
||||
# Print logs and slicing files
|
||||
*.gcode
|
||||
*.bgcode
|
||||
*.3mf
|
||||
*.factory
|
||||
|
||||
# Nix
|
||||
result
|
||||
result-*
|
||||
.direnv/
|
||||
|
||||
# Development environment
|
||||
.envrc
|
||||
105
CONTRIBUTING.md
Normal file
105
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
# Contributing to Cuatro
|
||||
|
||||
Thank you for your interest in contributing to Cuatro! This document provides guidelines for contributing to this 3D printable game pieces project.
|
||||
|
||||
## Ways to Contribute
|
||||
|
||||
### Reporting Bugs
|
||||
- Check if the bug has already been reported in the issues
|
||||
- Provide clear steps to reproduce the issue
|
||||
- Include OpenSCAD version and operating system information
|
||||
- Attach screenshots or error messages if applicable
|
||||
|
||||
### Suggesting Enhancements
|
||||
- Check existing issues for similar suggestions
|
||||
- Clearly describe the proposed feature or improvement
|
||||
- Explain the use case and benefits
|
||||
- Consider backward compatibility with existing designs
|
||||
|
||||
### Code Contributions
|
||||
We welcome improvements to the OpenSCAD code! Areas where contributions are especially valuable:
|
||||
|
||||
- **Parameterization**: Making more aspects of the design configurable
|
||||
- **New Piece Types**: Adding additional game piece variants
|
||||
- **Optimization**: Improving print efficiency or material usage
|
||||
- **Documentation**: Adding code comments and improving clarity
|
||||
- **Testing**: Validating designs across different print settings
|
||||
|
||||
## Development Guidelines
|
||||
|
||||
### OpenSCAD Code Style
|
||||
- Use descriptive variable and module names
|
||||
- Keep modules focused on single responsibilities
|
||||
- Add comments for complex calculations or design decisions
|
||||
- Use consistent indentation (4 spaces)
|
||||
- Group related modules together
|
||||
|
||||
### Design Principles
|
||||
- **Printability**: All designs must be 3D printer friendly
|
||||
- **Modularity**: Create reusable modules when possible
|
||||
- **Parameterization**: Use variables instead of magic numbers
|
||||
- **Efficiency**: Minimize material usage while maintaining strength
|
||||
- **Compatibility**: Maintain consistent scaling relationships
|
||||
|
||||
### File Organization
|
||||
- Keep the main design in `parts.scad`
|
||||
- Use meaningful module names that describe their function
|
||||
- Place configurable parameters at the top of the file
|
||||
- Document parameter units and expected ranges
|
||||
|
||||
## Submission Process
|
||||
|
||||
### Before Submitting
|
||||
1. Test your changes in OpenSCAD (both preview and render)
|
||||
2. Verify the generated STL files are printable
|
||||
3. Check that existing functionality still works
|
||||
4. Update documentation if you've added new features
|
||||
5. Ensure your changes follow the project's design principles
|
||||
|
||||
### Creating a Pull Request
|
||||
1. Fork the repository
|
||||
2. Create a descriptive branch name (e.g., `feature/hollow-star-pieces`)
|
||||
3. Make your changes with clear, focused commits
|
||||
4. Test thoroughly with different parameter values
|
||||
5. Submit a pull request with:
|
||||
- Clear description of changes made
|
||||
- Explanation of the problem solved or feature added
|
||||
- Screenshots or images of printed results (if available)
|
||||
- Any breaking changes clearly noted
|
||||
|
||||
### Commit Messages
|
||||
- Use clear, descriptive commit messages
|
||||
- Start with a verb (Add, Fix, Update, Remove, etc.)
|
||||
- Keep the first line under 72 characters
|
||||
- Example: "Add hollow star piece variant with configurable points"
|
||||
|
||||
## Testing Guidelines
|
||||
|
||||
### Design Validation
|
||||
- Preview design in OpenSCAD (F5) for quick validation
|
||||
- Full render (F6) for final verification
|
||||
- Export STL and check for printability issues
|
||||
- Test with different parameter values to ensure robustness
|
||||
|
||||
### Print Testing
|
||||
While not required for all contributions, physical print testing is highly valued:
|
||||
- Test with common 3D printer settings
|
||||
- Verify dimensional accuracy
|
||||
- Check structural integrity
|
||||
- Document any print-specific observations
|
||||
|
||||
## Questions and Support
|
||||
|
||||
- **Design Questions**: Open an issue for design-related discussions
|
||||
- **Technical Issues**: Include OpenSCAD version and code snippets
|
||||
- **Feature Requests**: Describe the use case and expected behavior
|
||||
|
||||
## License Agreement
|
||||
|
||||
By contributing to Cuatro, you agree that your contributions will be licensed under the same CC BY-NC-SA 4.0 International License that covers the project. You retain copyright of your contributions while granting the project rights to use and distribute them under this license.
|
||||
|
||||
## Recognition
|
||||
|
||||
Contributors will be acknowledged in the project documentation. Significant contributions may be recognized in release notes and project history.
|
||||
|
||||
Thank you for helping make Cuatro better!
|
||||
26
LICENSE
Normal file
26
LICENSE
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
|
||||
|
||||
Copyright (c) 2025 Cuatro Project Contributors
|
||||
|
||||
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
|
||||
|
||||
You are free to:
|
||||
- Share — copy and redistribute the material in any medium or format
|
||||
- Adapt — remix, transform, and build upon the material
|
||||
|
||||
Under the following terms:
|
||||
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
- NonCommercial — You may not use the material for commercial purposes.
|
||||
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
|
||||
|
||||
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
|
||||
|
||||
To view a copy of this license, visit:
|
||||
https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
|
||||
or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
|
||||
78
README.md
Normal file
78
README.md
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# Cuatro - 3D Printable Game Pieces
|
||||
|
||||
Cuatro is a collection of 3D printable game pieces designed for board games. The pieces include tubes and boxes with various configurations optimized for game play.
|
||||
|
||||
## Features
|
||||
|
||||
- **Tubes**: Cylindrical game pieces with hollow centers
|
||||
- **Boxes**: Square-based pieces with hollow centers
|
||||
- **Customizable**: Configurable dimensions based on board square size
|
||||
- **Print-friendly**: Designed for easy 3D printing with minimal support
|
||||
|
||||
## Requirements
|
||||
|
||||
- [OpenSCAD](https://openscad.org/) for viewing and modifying the design
|
||||
- 3D printer capable of printing PLA/PETG/ABS materials
|
||||
- Recommended print settings: 0.2mm layer height, 15% infill
|
||||
|
||||
## Usage
|
||||
|
||||
### Viewing the Model
|
||||
|
||||
1. Install OpenSCAD
|
||||
2. Open `parts.scad` in OpenSCAD
|
||||
3. Press F5 to preview or F6 to render
|
||||
|
||||
### Printing
|
||||
|
||||
The design generates four different types of pieces:
|
||||
- **Row 1**: Tube holes (negative space for creating molds)
|
||||
- **Row 2**: Solid tubes
|
||||
- **Row 3**: Solid boxes
|
||||
- **Row 4**: Box holes (negative space for creating molds)
|
||||
|
||||
Print recommendation: Create two copies in different colors for game play.
|
||||
|
||||
### Customization
|
||||
|
||||
Key parameters in `parts.scad`:
|
||||
- `board_square_size_in_mm`: Base dimension (default: 26mm)
|
||||
- `star_width`: Piece width as ratio of board square (default: 0.4)
|
||||
- `default_height`: Piece height as ratio of board square (default: 1.9)
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
cuatro/
|
||||
├── parts.scad # Main OpenSCAD file with all piece definitions
|
||||
├── README.md # This file
|
||||
├── LICENSE # CC BY-NC-SA 4.0 license
|
||||
└── CONTRIBUTING.md # Guidelines for contributors
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on:
|
||||
- Reporting bugs
|
||||
- Suggesting enhancements
|
||||
- Submitting pull requests
|
||||
- Code style guidelines
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
|
||||
|
||||
You are free to:
|
||||
- **Share** — copy and redistribute the material in any medium or format
|
||||
- **Adapt** — remix, transform, and build upon the material
|
||||
|
||||
Under these conditions:
|
||||
- **Attribution** — Give appropriate credit and indicate if changes were made
|
||||
- **NonCommercial** — You may not use the material for commercial purposes
|
||||
- **ShareAlike** — Distribute contributions under the same license
|
||||
|
||||
See the [LICENSE](LICENSE) file for full details or visit https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
|
||||
## Support
|
||||
|
||||
For questions, issues, or feature requests, please open an issue in this repository.
|
||||
113
flake.nix
Normal file
113
flake.nix
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
description = "Cuatro - 3D Printable Game Pieces";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
openscad
|
||||
# For viewing and editing STL files
|
||||
meshlab
|
||||
# For version control
|
||||
git
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "Cuatro Development Environment"
|
||||
echo "Available tools:"
|
||||
echo " openscad - OpenSCAD for 3D modeling"
|
||||
echo " meshlab - 3D mesh viewer/editor"
|
||||
echo ""
|
||||
echo "To generate STL files:"
|
||||
echo " openscad -o output.stl parts.scad"
|
||||
echo ""
|
||||
echo "To open the design in OpenSCAD GUI:"
|
||||
echo " openscad parts.scad"
|
||||
'';
|
||||
};
|
||||
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
pname = "cuatro";
|
||||
version = "1.0.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [ pkgs.openscad ];
|
||||
|
||||
buildPhase = ''
|
||||
# Generate STL files for all piece types
|
||||
mkdir -p $out/stl
|
||||
|
||||
# Create individual STL files for each piece type
|
||||
openscad -D 'tube_holes(row=1, fn=360);' -o $out/stl/tube-holes.stl parts.scad
|
||||
openscad -D 'tubes(row=1);' -o $out/stl/tubes.stl parts.scad
|
||||
openscad -D 'boxes(row=1);' -o $out/stl/boxes.stl parts.scad
|
||||
openscad -D 'box_holes(row=1);' -o $out/stl/box-holes.stl parts.scad
|
||||
|
||||
# Create combined file
|
||||
openscad -o $out/stl/all-pieces.stl parts.scad
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/cuatro
|
||||
cp -r . $out/share/cuatro/
|
||||
|
||||
# Create a script for easy STL generation
|
||||
mkdir -p $out/bin
|
||||
cat > $out/bin/cuatro-generate << 'EOF'
|
||||
#!/bin/sh
|
||||
OUTPUT_DIR="''${1:-./stl}"
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
echo "Generating Cuatro STL files to $OUTPUT_DIR"
|
||||
|
||||
openscad -D 'tube_holes(row=1, fn=360);' -o "$OUTPUT_DIR/tube-holes.stl" ${placeholder "out"}/share/cuatro/parts.scad
|
||||
openscad -D 'tubes(row=1);' -o "$OUTPUT_DIR/tubes.stl" ${placeholder "out"}/share/cuatro/parts.scad
|
||||
openscad -D 'boxes(row=1);' -o "$OUTPUT_DIR/boxes.stl" ${placeholder "out"}/share/cuatro/parts.scad
|
||||
openscad -D 'box_holes(row=1);' -o "$OUTPUT_DIR/box-holes.stl" ${placeholder "out"}/share/cuatro/parts.scad
|
||||
openscad -o "$OUTPUT_DIR/all-pieces.stl" ${placeholder "out"}/share/cuatro/parts.scad
|
||||
|
||||
echo "STL files generated successfully!"
|
||||
EOF
|
||||
chmod +x $out/bin/cuatro-generate
|
||||
'';
|
||||
};
|
||||
|
||||
checks = {
|
||||
openscad-syntax = pkgs.runCommand "cuatro-syntax-check" {
|
||||
buildInputs = [ pkgs.openscad ];
|
||||
} ''
|
||||
# Check OpenSCAD syntax
|
||||
openscad --check ${self}/parts.scad
|
||||
touch $out
|
||||
'';
|
||||
|
||||
stl-generation = pkgs.runCommand "cuatro-stl-test" {
|
||||
buildInputs = [ pkgs.openscad ];
|
||||
} ''
|
||||
mkdir -p test-output
|
||||
|
||||
# Test STL generation
|
||||
openscad -o test-output/test.stl ${self}/parts.scad
|
||||
|
||||
# Verify STL file was created and is not empty
|
||||
if [ ! -s test-output/test.stl ]; then
|
||||
echo "Error: STL file was not generated or is empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "STL generation test passed"
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
89
parts.scad
Normal file
89
parts.scad
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Cuatro - 3D Printable Game Pieces
|
||||
*
|
||||
* Copyright (c) 2025 Cuatro Project Contributors
|
||||
* Licensed under CC BY-NC-SA 4.0 International License
|
||||
*
|
||||
* This file defines modules for creating game pieces including tubes and boxes
|
||||
* with configurable dimensions for 3D printing.
|
||||
*
|
||||
* Print two copies, different colours.
|
||||
*/
|
||||
|
||||
|
||||
board_square_size_in_mm = 26;
|
||||
star_width = board_square_size_in_mm*0.4;
|
||||
default_height = board_square_size_in_mm*1.9;
|
||||
box_multiplier = 1.8;
|
||||
|
||||
module tube_hole(offset_x=80, offset_y=0, height=default_height, fn, scale) {
|
||||
$fn=fn;
|
||||
difference() {
|
||||
translate([offset_x, offset_y, 0])
|
||||
cylinder(r=star_width*scale,h=height);
|
||||
translate([offset_x, offset_y, -5])
|
||||
cylinder(r=star_width/2, h=height+10);
|
||||
}
|
||||
}
|
||||
|
||||
module tube_holes(row=1, fn=360, scale=1.0) {
|
||||
$fn=fn;
|
||||
row_offset=((star_width*2.5)+star_width/4)*row;
|
||||
tube_hole(fn=fn, offset_x=row_offset, offset_y=0, height=default_height, scale=scale);
|
||||
tube_hole(fn=fn, offset_x=row_offset, offset_y=(star_width*3)-star_width/15, height=default_height/2, scale=scale);
|
||||
}
|
||||
|
||||
module tube(offset_x=80, offset_y=0, height=default_height, fn, scale=1.0) {
|
||||
$fn=fn;
|
||||
translate([offset_x, offset_y, 0])
|
||||
cylinder(r=star_width*scale,h=height);
|
||||
}
|
||||
|
||||
module tubes(row=1, fn=360, scale=1.0) {
|
||||
row_offset=((star_width*2.5)+star_width/4)*row;
|
||||
tube(fn=fn, offset_x=row_offset, offset_y=0, height=default_height, scale=scale);
|
||||
tube(fn=fn, offset_x=row_offset, offset_y=(star_width*3)-star_width/15, height=default_height/2, scale=scale);
|
||||
|
||||
}
|
||||
|
||||
module box(offset_x=80, offset_y=0, height=default_height) {
|
||||
translate([offset_x-(star_width/2), offset_y-(star_width/2), 0])
|
||||
cube([star_width*box_multiplier, star_width*box_multiplier, height]);
|
||||
}
|
||||
|
||||
module boxes(row=1) {
|
||||
row_offset=((star_width*2.5)+star_width/4)*row;
|
||||
box(offset_x=row_offset, offset_y=0, height=default_height);
|
||||
box(offset_x=row_offset, offset_y=(star_width*3)-star_width/15, height=default_height/2);
|
||||
|
||||
}
|
||||
|
||||
module box_holes(row=1) {
|
||||
row_offset=((star_width*2.5)+star_width/4)*row;
|
||||
box_hole(offset_x=row_offset, offset_y=0, height=default_height);
|
||||
box_hole(offset_x=row_offset, offset_y=(star_width*3)-star_width/15, height=default_height/2);
|
||||
|
||||
}
|
||||
|
||||
module box_hole(offset_x=80, offset_y=0, height=default_height, $fn) {
|
||||
difference() {
|
||||
translate([offset_x-(star_width/2), offset_y-(star_width/2), 0])
|
||||
union() {
|
||||
cube([star_width*box_multiplier, star_width*box_multiplier, height]);
|
||||
//base();
|
||||
|
||||
};
|
||||
translate([offset_x+(star_width/2.5), offset_y+(star_width/2.5), -5])
|
||||
cylinder(r=star_width/2, h=height+10, $fn=360);
|
||||
}
|
||||
}
|
||||
|
||||
module base() {
|
||||
rotate([0,0,45]) cylinder(h=default_height*0.1, r1=board_square_size_in_mm-0.2, r2=board_square_size_in_mm-2, $fn=4);
|
||||
}
|
||||
|
||||
tube_holes(row=1, fn=360);
|
||||
tubes(row=2);
|
||||
boxes(row=3);
|
||||
box_holes(row=4);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue