
Library for generating and editing 3D geometry and it's associated data implemented in 100% golang.
If Polyform contributes to an academic publication, cite it as:
@misc{polyform,
title = {Polyform},
author = {Eli Davis},
note = {https://www.github.com/EliCDavis/polyform},
year = {2023}
}
Processing Example
Reads in a obj and applies the cube marching algorithm over the meshes 3D SDF.
package main
import (
"github.com/EliCDavis/polyform/formats/obj"
"github.com/EliCDavis/polyform/modeling"
"github.com/EliCDavis/polyform/modeling/marching"
"github.com/EliCDavis/vector"
)
func check(err error) {
if err != nil {
panic(err)
}
}
func main() {
loadedMesh, err := obj.Load("test-models/stanford-bunny.obj")
check(err)
resolution := 10.
canvas := marching.NewMarchingCanvas(resolution)
canvas.AddFieldParallel(marching.Mesh(
loadedMesh.
CenterFloat3Attribute(modeling.PositionAttribute).
Scale(vector3.Zero[float64](), vector3.New(12, 12, 12)),
.1,
10,
))
check(obj.Save("chunky-bunny.obj", canvas.MarchParallel(.3)))
}
Results in:

Helpful Procedural Generation Sub Packages
- Modeling
- marching - Multi-threaded Cube Marching algorithm and utilities.
- extrude - Functionality for generating geometry from 2D shapes.
- repeat - Functionality for copying geometry in common patterns.
- primitives - Functionality pertaining to generating common geometry.
- triangulation - Generating meshes from a set of 2D points.
- Drawing
- coloring - Color utilities for blending multiple colors together using weights.
- texturing - Image processing utilities like generating Normal maps or blurring images.
- Math
- noise - Utilities around noise functions for common usecases like stacking multiple samples of perlin noise from different frequencies.
- sample - Serves as a group of definitions for defining a mapping from one numeric value to another
- curves - Commonly curves used in animation like cubic bezier curves.
Procedural Generation Examples
You can at the different projects under the examples folder for different examples on how to procedurally generate meshes.
Evergreen Trees
This was my submission for ProcJam 2022. Pretty much uses every bit of functionality available in this repository.
[Source Here]


Other Examples
Todo List
Progress towards V1...
- Cube Marching
- Bezier Curves
- Scene Support
- GLTF Support
- Slice By Plane
- Slice By Bounding Box
- Constrained Delaunay Tesselation
- Meshing Pipeline
- Bones / Animations
- Quadric Error Decimation
- Proper Build Pipeline
- Documentation Website
Things I want to implement eventually...
- 3D Tesselation
- Slice By Octree
- Poisson Reconstruction
- Buncha texture patterns
- Noise...
- Splines...
- Spheres...
Resources
Resources either directly contributing to the code here or are just interesting finds while researching.