Git Product home page Git Product logo

3d-hausdorff-distance-calculator's Introduction

3D-Hausdorff-Distance-Calculator

Description

3D-Hausdorff-Distance-Calculator is a Python tool designed to calculate the Hausdorff distance between two 3D models provided in STL format. The Hausdorff distance is a measure of the maximum discrepancy between two sets of points, making it useful for comparing 3D shapes, particularly when evaluating the fidelity of 3D printed objects to their original designs.

Note

The calculation will differ depending on the orientation of the model, so be sure to calculate with the same orientation.

Features

  • Load and process STL files to extract 3D mesh data.
  • Calculate the Hausdorff distance between two 3D models.
  • Useful for quality control in 3D printing, scanning, and reverse engineering.

Requirements

  • Python 3.7+
  • numpy
  • scipy
  • numpy-stl

You can install the required packages using pip:

pip install numpy scipy numpy-stl

Setting Up the Environment with Anaconda (miniforge for macOS)

For macOS users, it is recommended to use miniforge to create a clean Anaconda environment for running the script. Follow these steps to set up the environment:

  1. Install Miniforge: follow the instructions on the Miniforge GitHub page

  2. Create a new conda environment: Create a New Conda Environment:

conda create -n hausdorff-env python=3.9
  1. Activate the new environment:
conda activate hausdorff-env
  1. Install the required packages:
pip install numpy scipy numpy-stl

Usage

  1. Place your STL files in the same directory as the script.
  2. Run the Python script to calculate the Hausdorff distance:
python main.py

Sample STL Files

You can use the provided sample STL files to test the script. The cube.stl and sphere_[mesh_size].stl files contain two simple 3D models for testing the Hausdorff distance calculation.

Results of samples files

  • cube.stl and cube.stl
Hausdorff Distance : 0.0
  • cube.stl and sphere_3840.stl
Hausdorff Distance : 25.00000704946435
  • sphere3480.stl and sphere_28560.stl
Hausdorff Distance : 1.7884412788761033
  • sphere_9024.stl and sphere_28560.stl: takes a few miniutes to calculate
Hausdorff Distance : 1.105467263395086

3d-hausdorff-distance-calculator's People

Contributors

tetsuakibaba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.