Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the storage into 64 bits, since sometimes it encounter the overflow multiplication #258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyntcloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .core_class import PyntCloud
from .core_class import PyntCloud
4 changes: 2 additions & 2 deletions pyntcloud/core_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ def __init__(self, points, mesh=None, structures={}, **kwargs):

kwargs: custom attributes
"""
self.points = points
self.points = points.astype(np.float64)
self.mesh = mesh
self.structures = StructuresDict()
for key, val in structures.items():
self.structures[key] = val
for key, val in kwargs.items():
setattr(self, key, val)
# store raw xyz values to share memory along structures
self.xyz = self.points[["x", "y", "z"]].values
self.xyz = self.points[["x", "y", "z"]].values.astype(np.float64)
self.centroid = self.xyz.mean(0)

def __repr__(self):
Expand Down
3 changes: 2 additions & 1 deletion pyntcloud/samplers/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def compute(self):
solution_set = remaining_points[select_idx: select_idx+1]
remaining_points = np.delete(remaining_points, select_idx, 0)

for _ in range(self.n - 1):
for idx in range(self.n - 1):
print(idx)
distance_sum = self.cal_distance(remaining_points, solution_set)
select_idx = np.argmax(distance_sum)
solution_set = np.concatenate([solution_set, remaining_points[select_idx:select_idx+1]], axis=0)
Expand Down