@@ -50,16 +50,16 @@ def to_mesh(self, actor: Actor):
50
50
plane_mesh .width = length
51
51
return plane_mesh
52
52
53
- def centerOfMass (self ):
53
+ def center_of_mass (self ):
54
54
return self .center
55
55
56
- def P3toP2 (self , ps ):
56
+ def p3_to_p2 (self , ps ):
57
57
# ps is a list of 3D points
58
58
# returns a list of 2D point mapped on
59
59
# the plane (u -> x axis, v -> y axis)
60
60
return (ps - self .center ) @ self .M
61
61
62
- def intersectWith (self , mesh : vd .Mesh ):
62
+ def intersect_with (self , mesh : vd .Mesh ):
63
63
return mesh .intersect_with_plane (
64
64
origin = self .center , normal = self .normal
65
65
)
@@ -69,14 +69,14 @@ def get_projections(self, actors: List[Actor]) -> Dict[str, np.ndarray]:
69
69
projected = {}
70
70
for actor in actors :
71
71
mesh : vd .Mesh = actor ._mesh
72
- intersection = self .intersectWith (mesh )
72
+ intersection = self .intersect_with (mesh )
73
73
if not intersection .vertices .shape [0 ]:
74
74
continue
75
75
pieces = intersection .split () # intersection.split() in newer vedo
76
76
for piece_n , piece in enumerate (pieces ):
77
77
# sort coordinates
78
78
points = piece .join (reset = True ).vertices
79
- projected [actor .name + f"_segment_{ piece_n } " ] = self .P3toP2 (
79
+ projected [actor .name + f"_segment_{ piece_n } " ] = self .p3_to_p2 (
80
80
points
81
81
)
82
82
return projected
0 commit comments