Returns arbitrary number of points sampled by selected method
if name in S_POINTS:
kwargs["points"] = self.xyz
valid_args = crosscheck_kwargs_function(kwargs, S_POINTS[name])
return S_POINTS[name](**valid_args)
elif name in S_MESH:
kwargs["v1"], kwargs["v2"], kwargs["v3"] = self.get_mesh_vertices()
valid_args = crosscheck_kwargs_function(kwargs, S_MESH[name])
return S_MESH[name](**valid_args)
elif name in S_VOXELGRID:
kwargs["voxelgrid"] = self.voxelgrids[kwargs["voxelgrid"]]
valid_args = crosscheck_kwargs_function(kwargs, S_VOXELGRID[name])
return S_VOXELGRID[name](**valid_args)
After Change
else:
raise ValueError("Unsupported filter. Check docstring")
def get_sample(self, name, **kwargs):
Returns arbitrary number of points sampled by selected method
Parameters
----------
name : str
One of the avaliable names. See bellow.
kwargs
Vary for each name. See bellow.
Returns
-------
sampled_points: (n, 3) ndarray
"n" vary for each method.
Notes
-----
Avaliable sampling methods are:
REQUIRE MESH
--------------
NAMES
random_mesh
n : int
Number of points to be sampled.
REQUIRE VOXELGRID
-----------------
ARGS
voxelgrid : VoxelGrid.id
voxelgrid = self.add_structure("voxelgrid", ...)
NAMES
voxelgrid_centers
voxelgrid_centroids
voxelgrid_nearest
USE POINTS
----------
NAMES
random_points
n : int
Number of points to be sampled.
if name in ALL_SAMPLING:
S = ALL_SAMPLING[name](self, **kwargs)S.extract_info()
return S.compute()
else:
raise ValueError("Unsupported sampling. Check docstring")