Code
Catan River Tile Optimizer
April 2026 - Present
Python · Combinatorics · Optimization · Visualization · Terrain Generation
Problem: I am in the process of creating a custom Catan board where rivers run continuously across tile edges, either terminating at the board's outer boundary or connecting to a river edge on an adjacent tile. Given several river types (Sources, Sinks, Flows, Splits, and Riverless) and a minimum of nine river tiles, I needed to find the tile set maximizing the number of valid configurations, while also ensuring no pair of tiles was disproportionately likely to end up adjacent.
Solution: I solved this using a Monte Carlo simulation paired with a depth-first search to resolve rotation conflicts.
Terrain: I initially wanted to find real world topography data and place it into the tiles, however that makes the edge connection difficult, therefore I opted for building a terrain generation tool. This tool ensures that the terrain approaches the edge tangentially, gets cut down where rivers are, and attempts to recreate realistic looking terrain. There is still work to be done to improve the erosion calculation on the mountain terrain type to make the mountains look more realistic.
OnShape Engrave Feature
May 2025
OnShape FeatureScript · Computational Geometry
Background: Onshape is an in-browser CAD system which has a language called FeatureScript. FeatureScript allows you to make custom tools to optimize your workflow or make parts that would be very difficult or impossible with the default CAD tools. I have used this tool extensively in many of my projects.
The feature: This tool creates the profile that a V-bit would produce using an engrave toolpath on a CNC. This is useful for cutting out pockets that a larger bit would have missed. The window on the left shows the stages of the feature. Initially, it rounds the corners, then it adds a chamfer to straight lines and circles, and then it adds a chamfer to spline segments.
The hard part: The last step is the most difficult because the spline has a variable corner radius, and if the corner goes from having a larger radius to a smaller radius than the chamfer radius, then this results in a self-intersecting spline, resulting in a failure. I had to create several workarounds to ensure that the spline never self-intersects.
More Projects
- This Website: React + Three.js, Built With AI-Assisted Development
- Inverse Kinematics Simulation From Scratch
- Disc Golf Speed Calculator From Video
- 3D Connect Four
- Square Tiling Optimizer
- Sudoku Solver
- Minesweeper Solver (via Screenshot)
- 2048 Solver
- Tragically Hip Heardle