Skip to content

Latest commit

 

History

History
87 lines (63 loc) · 2.26 KB

README.md

File metadata and controls

87 lines (63 loc) · 2.26 KB

3D Mesh Generator

Overview

The 3D Mesh Generator is a C++ project that converts 2D meshes or other models into 3D meshes. This tool reads 2D mesh data, extrudes it along the z-axis, and exports the resulting 3D mesh in a standard file format like OBJ.

Features

  • 2D to 3D Conversion: Easily convert 2D mesh data into 3D meshes.
  • Customizable Height: Specify the height for the extrusion to create the 3D mesh.
  • OBJ Export: Export the generated 3D mesh to an OBJ file for use in various 3D applications.

File Structure

Getting Started

Prerequisites

  • C++11 or later
  • CMake 3.10 or later

Building the Project

  1. Clone the repository:

    git clone <https://github.com/sergyDwhiz/3DMeshGen.git>
    cd MeshGen
  2. Create a build directory and navigate into it:

    mkdir build
    cd build
  3. Run CMake to configure the project:

    cmake ..
  4. Build the project:

    make

Running the Project

  1. Prepare your 2D mesh data in data/input_mesh.txt in the following format:
    v x1 y1
    v x2 y2
    ...
    f v1 v2 v3
    ...
    

Sample Input:

v 0.0 0.0 v 1.0 0.0 v 1.0 1.0 v 0.0 1.0 f 1 2 3 f 1 3 4

Alternatively,

you can load a file containing a 2D Mesh

  1. Run the executable:

    ./3DMeshGen
  2. The generated 3D mesh will be saved to data/output_mesh.obj.

  3. Visualize the output python3 visualize_mesh.py

Sample output:

alt text

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Inspired by various 3D modeling tools and libraries.