11from pygem .cffd import CFFD
22import numpy as np
3+
4+
35class BFFD (CFFD ):
4- '''
6+ """
57 Class that handles the Barycenter Free Form Deformation on the mesh points.
6-
8+
79 :param list n_control_points: number of control points in the x, y, and z
810 direction. Default is [2, 2, 2].
9-
11+
1012 :cvar numpy.ndarray box_length: dimension of the FFD bounding box, in the
1113 x, y and z direction (local coordinate system).
1214 :cvar numpy.ndarray box_origin: the x, y and z coordinates of the origin of
@@ -21,8 +23,8 @@ class BFFD(CFFD):
2123 z, normalized with the box length z.
2224 :cvar callable fun: it defines the F of the constraint F(x)=c. Default is the constant 1 function.
2325 :cvar numpy.ndarray fixval: it defines the c of the constraint F(x)=c. Default is 1.
24- :cvar numpy.ndarray mask: a boolean tensor that tells to the class
25- which control points can be moved, and in what direction, to enforce the constraint.
26+ :cvar numpy.ndarray mask: a boolean tensor that tells to the class
27+ which control points can be moved, and in what direction, to enforce the constraint.
2628 The tensor has shape (n_x,n_y,n_z,3), where the last dimension indicates movement
2729 on x,y,z respectively. Default is all true.
2830
@@ -36,7 +38,7 @@ class BFFD(CFFD):
3638 >>> bffd.adjust_control_points(original_mesh_points[:-4])
3739 >>> assert np.isclose(np.linalg.norm(bffd.fun(bffd.ffd(original_mesh_points[:-4])) - b), np.array([0.]))
3840 >>> new_mesh_points = bffd.ffd(original_mesh_points)
39- '''
41+ """
4042
4143 def __init__ (self , fixval = None , n_control_points = None , ffd_mask = None ):
4244 super ().__init__ (fixval , None , n_control_points , ffd_mask , None )
@@ -46,7 +48,6 @@ def linfun(x):
4648
4749 self .fun = linfun
4850 self .fixval = fixval
49- self .fun_mask = np .array ([[True , False , False ], [False , True , False ],
50- [False , False , True ]])
51-
52-
51+ self .fun_mask = np .array (
52+ [[True , False , False ], [False , True , False ], [False , False , True ]]
53+ )
0 commit comments