-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
83 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ build | |
.idea | ||
dist | ||
venv | ||
*.spec | ||
*.spec | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
trimesh | ||
open3d | ||
open3d | ||
fast_simplification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from distutils.core import setup | ||
from setuptools import find_packages | ||
|
||
with open("README.md", "r") as f: | ||
long_description = f.read() | ||
|
||
setup( | ||
name="stl_compressor", | ||
version="2.2", | ||
description="STL Compressor", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author="Ziqi Fan", | ||
author_email="[email protected]", | ||
url="https://github.com/fan-ziqi/stl_compressor", | ||
install_requires=[], | ||
license="Apache License 2.0", | ||
packages=find_packages(), | ||
entry_points={"console_scripts": ["stl_compressor = stl_compressor.stl_compressor_ui:main"]}, | ||
platforms=["all"], | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
], | ||
) |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import os | ||
import open3d as o3d | ||
|
||
target_number_of_triangles = 1000 | ||
|
||
current_directory = os.getcwd() | ||
|
||
input_directory = os.path.join(current_directory, 'test/input') | ||
output_directory = os.path.join(current_directory, 'test/output') | ||
|
||
if not os.path.exists(output_directory): | ||
os.makedirs(output_directory) | ||
|
||
for stl_file in os.listdir(input_directory): | ||
if stl_file.lower().endswith(".stl"): | ||
mesh = o3d.io.read_triangle_mesh(os.path.join(input_directory, stl_file)) | ||
simplified_mesh = mesh.simplify_quadric_decimation(target_number_of_triangles) | ||
simplified_mesh.compute_triangle_normals() | ||
simplified_mesh.compute_vertex_normals() | ||
output_file_path = os.path.join(output_directory, stl_file) | ||
o3d.io.write_triangle_mesh(output_file_path, simplified_mesh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.