-
Notifications
You must be signed in to change notification settings - Fork 247
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
1 parent
eb7ee45
commit c706056
Showing
43 changed files
with
47 additions
and
113 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
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
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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,10 @@ | ||
import sys | ||
sys.path.append("../../cmake-build-release/lib/python") | ||
|
||
|
||
import easy3d | ||
|
||
easy3d.initialize() | ||
viewer = easy3d.Viewer("Test") | ||
viewer.add_model(easy3d.directory() + "/data/bunny.ply") | ||
viewer.run() |
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,44 +1,19 @@ | ||
import sys | ||
sys.path.append("../../cmake-build-release/lib") | ||
sys.path.append("../../cmake-build-release/lib/python") | ||
# sys.path.append("/Users/lnan/Documents/Projects/PyEasy3D/cmake-build-release") | ||
|
||
import PyEasy3D | ||
import easy3d | ||
|
||
# Initialize Easy3D | ||
PyEasy3D.initialize(True) # True to print detailed log | ||
easy3d.initialize(True) # True to print detailed log | ||
|
||
file_name = PyEasy3D.directory() + "/data/bunny.bin" | ||
print("input file name: " + file_name) | ||
|
||
stopwatch = PyEasy3D.StopWatch() | ||
stopwatch.start() | ||
file_name = easy3d.directory() + "/data/bunny.ply" | ||
|
||
# Load the point cloud from a file | ||
pc = PyEasy3D.PointCloudIO.load(file_name) | ||
if not pc: | ||
raise ValueError("Failed to load the point cloud.") | ||
|
||
# Estimate normals for the point cloud | ||
if not PyEasy3D.PointCloudNormals.estimate(pc, 16, False): | ||
raise ValueError("Normal estimation failed.") | ||
|
||
# Optional: Reorient normals if needed | ||
if not PyEasy3D.PointCloudNormals.reorient(pc, 16): | ||
raise ValueError("Normal reorientation failed.") | ||
pc = easy3d.SurfaceMeshIO.load(file_name) | ||
|
||
print("Done. Time: " + stopwatch.time_string()) | ||
|
||
# # Visualize the point cloud | ||
# ToDo: python binding for the viewer is not ready | ||
# The viewer crashes when closing it (due to the ownership of pc?) | ||
# Solution: use std::shared_ptr in Viewer::add_model() | ||
viewer = PyEasy3D.Viewer("Easy3D Viewer") | ||
viewer = easy3d.Viewer("Easy3D Viewer") | ||
viewer.set_usage("") | ||
# print(pc.name()) | ||
viewer.add_model(pc) | ||
# viewer.add_model(file_name) | ||
viewer.run() | ||
|
||
# Save the point cloud into a file | ||
if not PyEasy3D.PointCloudIO.save(file_name + "-result.ply", pc): | ||
raise ValueError("Saving file failed.") |