@@ -39,6 +39,11 @@ class InputSchema(BaseModel):
3939
4040 mesh_tesseract : TesseractReference = Field (description = "Tesseract to call." )
4141
42+ scale_mesh : float = Field (
43+ default = 1.0 ,
44+ description = "Scaling factor applied to the generated mesh." ,
45+ )
46+
4247 grid_size : list [float ] = Field (
4348 description = "Size of the bounding box in x, y, z directions."
4449 )
@@ -164,6 +169,7 @@ def apply_fn(
164169 non_differentiable_parameters : np .ndarray ,
165170 static_parameters : list [int ],
166171 string_parameters : list [str ],
172+ scale_mesh : float ,
167173 grid_size : np .ndarray ,
168174 grid_elements : np .ndarray ,
169175 grid_center : np .ndarray ,
@@ -176,6 +182,8 @@ def apply_fn(
176182 static_parameters = static_parameters ,
177183 string_parameters = string_parameters ,
178184 )
185+ # scale the mesh
186+ geo = geo .apply_scale (scale_mesh )
179187
180188 sd_field = compute_sdf (
181189 geo ,
@@ -197,6 +205,7 @@ def jac_sdf_wrt_params(
197205 non_differentiable_parameters : np .ndarray ,
198206 static_parameters : list [int ],
199207 string_parameters : list [str ],
208+ scale_mesh : float ,
200209 grid_size : np .ndarray ,
201210 grid_elements : np .ndarray ,
202211 grid_center : np .ndarray ,
@@ -222,6 +231,7 @@ def jac_sdf_wrt_params(
222231 non_differentiable_parameters = non_differentiable_parameters ,
223232 static_parameters = static_parameters ,
224233 string_parameters = string_parameters ,
234+ scale_mesh = scale_mesh ,
225235 grid_elements = grid_elements ,
226236 grid_size = grid_size ,
227237 grid_center = grid_center ,
@@ -239,6 +249,7 @@ def jac_sdf_wrt_params(
239249 non_differentiable_parameters = non_differentiable_parameters ,
240250 static_parameters = static_parameters ,
241251 string_parameters = string_parameters ,
252+ scale_mesh = scale_mesh ,
242253 grid_elements = grid_elements ,
243254 grid_size = grid_size ,
244255 grid_center = grid_center ,
@@ -272,6 +283,7 @@ def apply(inputs: InputSchema) -> OutputSchema:
272283 grid_size = inputs .grid_size ,
273284 static_parameters = inputs .static_parameters ,
274285 string_parameters = inputs .string_parameters ,
286+ scale_mesh = inputs .scale_mesh ,
275287 grid_elements = inputs .grid_elements ,
276288 grid_center = inputs .grid_center ,
277289 )
@@ -319,6 +331,7 @@ def vector_jacobian_product(
319331 non_differentiable_parameters = inputs .non_differentiable_parameters ,
320332 static_parameters = inputs .static_parameters ,
321333 string_parameters = inputs .string_parameters ,
334+ scale_mesh = inputs .scale_mesh ,
322335 grid_size = inputs .grid_size ,
323336 grid_elements = inputs .grid_elements ,
324337 epsilon = inputs .epsilon ,
0 commit comments