-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The Editor currently uses the numpy library for vector operations in several geometric calculations, such as computing normals. While numpy is powerful, the custom Vector2 and Vector3 classes provide tailored methods that could enhance performance and reduce external dependencies.
For instance:
def compute_normal(vertex_1: Vector3, vertex_2: Vector3, vertex_3: Vector3) -> np.ndarray:
v1 = np.array(vertex_2) - np.array(vertex_1)
v2 = np.array(vertex_3) - np.array(vertex_1)
normal = np.cross(v1, v2)
return normal / np.linalg.norm(normal)Could be refactored into:
def compute_normal(vertex_1: Vector3, vertex_2: Vector3, vertex_3: Vector3) -> Vector3:
v1 = vertex_2 - vertex_1
v2 = vertex_3 - vertex_1
normal = v1.Cross(v2)
return normal.Normalize()fatiyesmanfatiyesmanfatiyesmanfatiyesmanfatiyesmanfatiyesmanfatiyesman
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request