def __init__(self, vertices=None, normals=None, indices=None, colors=None, uvs=None, file_name=None, center_position=None): self._vertices = NumPyUtil.immutableNDArray(vertices) self._normals = NumPyUtil.immutableNDArray(normals) self._indices = NumPyUtil.immutableNDArray(indices) self._colors = NumPyUtil.immutableNDArray(colors) self._uvs = NumPyUtil.immutableNDArray(uvs) self._vertex_count = len(self._vertices) if self._vertices is not None else 0 self._face_count = len(self._indices) if self._indices is not None else 0 self._type = MeshType.faces self._file_name = file_name # original center position self._center_position = center_position self._convex_hull = None # type: scipy.spatial.qhull.ConvexHull self._convex_hull_vertices = None self._convex_hull_lock = threading.Lock()
def __init__(self, vertices=None, normals=None, indices=None, colors=None, uvs=None, file_name=None, center_position=None, zero_position=None, type = MeshType.faces, attributes=None): self._application = None # Initialize this later otherwise unit tests break self._vertices = NumPyUtil.immutableNDArray(vertices) self._normals = NumPyUtil.immutableNDArray(normals) self._indices = NumPyUtil.immutableNDArray(indices) self._colors = NumPyUtil.immutableNDArray(colors) self._uvs = NumPyUtil.immutableNDArray(uvs) self._vertex_count = len(self._vertices) if self._vertices is not None else 0 self._face_count = len(self._indices) if self._indices is not None else 0 self._type = type self._file_name = file_name # type: Optional[str] # original center position self._center_position = center_position # original zero position, is changed after transformation if zero_position is not None: self._zero_position = zero_position else: self._zero_position = Vector(0, 0, 0) # type: Vector self._convex_hull = None # type: Optional[scipy.spatial.ConvexHull] self._convex_hull_vertices = None # type: Optional[numpy.ndarray] self._convex_hull_lock = threading.Lock() self._attributes = {} if attributes is not None: for key, attribute in attributes.items(): new_value = {} for attribute_key, attribute_value in attribute.items(): if attribute_key == "value": new_value["value"] = NumPyUtil.immutableNDArray(attribute_value) else: new_value[attribute_key] = attribute_value self._attributes[key] = new_value
def __init__(self, points = None): self._points = NumPyUtil.immutableNDArray(points)
def __init__(self, points: Optional[Union[numpy.ndarray, List]] = None): self._points = NumPyUtil.immutableNDArray(points)
def __init__(self, points=None): self._points = NumPyUtil.immutableNDArray(points)