Beispiel #1
0
 def test_tea(self):
     # Load data.
     bpa = BPA(path='teapot_with_normal.txt', radius=0.02, visualizer=True)
     print("Starting...")
     bpa.create_mesh(limit_iterations=1000)
     print("Finished.")
     bpa.visualizer.lock()
Beispiel #2
0
 def test_small_bunny(self):
     # Load data.
     bpa = BPA(path='bunny_with_normals.txt',
               radius=0.0005,
               visualizer=True)
     bpa.create_mesh(limit_iterations=900)
     bpa.visualizer.lock()
Beispiel #3
0
    def test_calc_normals(self):
        # Load data.
        bpa = BPA(path='normals_test.txt', radius=0.2, visualizer=True)

        # Find a seed triangle.
        bpa.find_seed_triangle()
        bpa.visualizer.update(edges=bpa.grid.edges, color='red')
        bpa.visualizer.lock()
# Written by Pransu Dash, Ryan Leung, and Ivy Nguyen

import numpy as np
import open3d as o3d
from bpa import BPA
from bpa import Triangle

if __name__ == "__main__":

    print("Load a ply point cloud, print it, and render it")
    pcd = o3d.io.read_point_cloud("madara.ply")
    pcd.estimate_normals(fast_normal_computation=False)

    pcd.normalize_normals()
    pcd.orient_normals_to_align_with_direction()
    b = BPA(pcd)
    print('making mesh')
    triangles = b.make_mesh()
    f = open("madara_r_4_3.ply", "w")

    vertices = []
    v2index = {}
    index_counter = 0
    faces = []
    for t in triangles:
        out = []
        for vertex in t.vertices:
            v = tuple(vertex)
            if v2index.get(v):
                out.append(v2index[v])
            else:
Beispiel #5
0
 def test_normal_drawing(self):
     bpa = BPA(path='../data/large_bunny_with_normals.txt',
               radius=0.0005,
               visualizer=True)
     bpa.visualizer.draw_with_normals(normals_size=0.5)
Beispiel #6
0
 def test_medium_bunny(self):
     bpa = BPA(path='../data/bunny_with_normals.txt',
               radius=0.0005,
               visualizer=True)
     bpa.create_mesh()
     bpa.visualizer.lock()
Beispiel #7
0
 def test_multi_process(self):
     bpa = BPA(path='../data/bunny_with_normals.txt',
               radius=0.0005,
               visualizer=True)
     bpa.create_mesh(limit_iterations=1000)
     bpa.visualizer.lock()