https://github.com/vitorcarvalho67/gyroid
Generate and output a set of points that are located on the surface of a gyroid, providing a discrete representation of this complex and intriguing minimal surface
https://github.com/vitorcarvalho67/gyroid
3d-geometry c-lang engineering gcc-complier gyroid marching-cubes math minimal-surfaces shell-script
Last synced: 5 months ago
JSON representation
Generate and output a set of points that are located on the surface of a gyroid, providing a discrete representation of this complex and intriguing minimal surface
- Host: GitHub
- URL: https://github.com/vitorcarvalho67/gyroid
- Owner: VitorCarvalho67
- License: gpl-3.0
- Created: 2024-02-18T22:39:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-18T23:27:01.000Z (about 1 year ago)
- Last Synced: 2024-05-11T05:45:45.403Z (12 months ago)
- Topics: 3d-geometry, c-lang, engineering, gcc-complier, gyroid, marching-cubes, math, minimal-surfaces, shell-script
- Language: C
- Homepage:
- Size: 39.1 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# GYROID
The purpose of this program is to generate a discrete representation (set of points) of the gyroid surface, which is an interesting minimal surface with applications in various areas of science and engineering, such as porous materials, photonic structures, and biomimetics. Visualizing these points can help understand the shape and structure of the gyroid, and the resulting 3D mesh from the Marching Cubes algorithm can be used in simulations, analyses of material properties, or as a basis for the design of new materials and structures.
Here's a version with improved Markdown structure:
---
The gyroid has an approximate definition given by the equation:
$$
f(x, y, z) = \sin(x) \cdot \cos(y) + \sin(y) \cdot \cos(z) + \sin(z) \cdot \cos(x) = 0
$$where the domain is defined as:
$$
-\pi < x < \pi, \quad -\pi < y < \pi, \quad -\pi < z < \pi
$$---
This C binary generates a point cloud [ points on the surface.]
```bash
gcc main.c -o gyroid -lm
``````bash
time ./gyroid > pc.json
```## Marching Cubes
The included shell script uses sensible parameters to configure [splashsurf](https://crates.io/crates/splashsurf/0.9.1). The output is a obj file which can be imported in a program like [blender](https://www.blender.org/).
```bash
./reconstruct.sh
```