@@ -224,9 +224,8 @@ def gen_case(
224
224
workdir = None ,
225
225
casetype = "s32" ,
226
226
nparts = 4 ,
227
- expand_head_model = 0.1 ,
228
227
customizations = DEFAULT_CUSTOMIZATIONS ,
229
- ):
228
+ expand_head_model = 0.1 ):
230
229
"""
231
230
Generate a headcase.
232
231
@@ -246,11 +245,11 @@ def gen_case(
246
245
nparts : int, optional
247
246
Number of parts to divide the head case into. Possible values are 2 or 4.
248
247
Default is 4.
249
- expand_head_model : float, optional
250
- Factor (in mm) to expand the head model by. Default is 0.1.
251
248
customizations : str, optional
252
249
Path to the customizations file to remove additional parts from the headcase.
253
250
Default is `default_customizations.stl` in the `stls` folder.
251
+ expand_head_model : float, optional
252
+ Factor (in mm) to expand the head model by. Default is 0.1.
254
253
255
254
Examples
256
255
--------
@@ -313,6 +312,7 @@ def pipeline(
313
312
nparts = 4 ,
314
313
workdir = None ,
315
314
customizations = DEFAULT_CUSTOMIZATIONS ,
315
+ expand_head_model = 0.1 ,
316
316
):
317
317
"""
318
318
Run the pipeline to generate a head case from a head model.
@@ -333,6 +333,8 @@ def pipeline(
333
333
Path to the working directory, default is None.
334
334
customizations : dict, optional
335
335
Customizations for the head case, default is `default_customizations.stl`.
336
+ expand_head_model : float, optional
337
+ Factor (in mm) to expand the head model by, default is 0.1.
336
338
337
339
Notes
338
340
-----
@@ -368,6 +370,7 @@ def pipeline(
368
370
casetype = casetype ,
369
371
nparts = nparts ,
370
372
customizations = customizations ,
373
+ expand_head_model = expand_head_model
371
374
)
372
375
373
376
if workdir is None :
@@ -388,15 +391,6 @@ def pipeline(
388
391
type = str ,
389
392
help = "output headcase model (*.zip)" ,
390
393
)
391
- parser .add_argument (
392
- "--expand-head-model" ,
393
- type = float ,
394
- default = "0.1" ,
395
- help = "Expand the head model by this amount (in mm) before generating the "
396
- "headcase. The default (0.1 mm) should work for most cases. If the resulting "
397
- "headcase is too tight, one can try increasing this value. It is not "
398
- "recommended to pass a value greater than 1 mm." ,
399
- )
400
394
parser .add_argument (
401
395
"--headcoil" ,
402
396
"-c" ,
@@ -416,6 +410,18 @@ def pipeline(
416
410
help = "Split the headcase model into 4 (default) or 2 parts. Four parts require "
417
411
"less support material when 3d printing the headcase." ,
418
412
)
413
+ parser .add_argument (
414
+ "--workdir" ,
415
+ type = str ,
416
+ required = False ,
417
+ default = None ,
418
+ help = "Working directory to use. If this flag is not used, "
419
+ "then a temporary directory is created and deleted at the end. "
420
+ "If this flag is used, the intermediate models are stored "
421
+ "in the working directory and not deleted. "
422
+ "This option is useful for manual tuning of the alignment, "
423
+ "in combination with the flag --generated-headcase-only" ,
424
+ )
419
425
parser .add_argument (
420
426
"--generate-headcase-only" ,
421
427
action = "store_true" ,
@@ -432,16 +438,15 @@ def pipeline(
432
438
f"to fine-tune the headcase. The default file is { DEFAULT_CUSTOMIZATIONS } " ,
433
439
)
434
440
parser .add_argument (
435
- "--workdir" ,
436
- type = str ,
437
- required = False ,
438
- default = None ,
439
- help = "Working directory to use. If this flag is not used, "
440
- "then a temporary directory is created and deleted at the end. "
441
- "If this flag is used, the intermediate models are stored "
442
- "in the working directory and not deleted. "
443
- "This option is useful for manual tuning of the alignment, "
444
- "in combination with the flag --generated-headcase-only" ,
441
+ "--expand-head-model" ,
442
+ type = float ,
443
+ default = 0.1 ,
444
+ help = "Expand the head model by this amount (in mm) before generating the "
445
+ "headcase. The default (0.1 mm) should work for most cases. If the resulting "
446
+ "headcase is too tight, one can try increasing this value. If the resulting "
447
+ "headcase is too loose, one can try passing a negative value to shrink the head"
448
+ "model. It is not recommended to pass a value greater than 1 mm or less than "
449
+ "-1 mm." ,
445
450
)
446
451
args = parser .parse_args ()
447
452
infile = os .path .abspath (args .infile )
@@ -451,6 +456,7 @@ def pipeline(
451
456
workdir = args .workdir
452
457
customizations = args .customizations_file
453
458
generate_headcase_only = args .generate_headcase_only
459
+ expand_head_model = args .expand_head_model
454
460
455
461
if generate_headcase_only :
456
462
print ("Making head case" )
@@ -461,6 +467,7 @@ def pipeline(
461
467
nparts = nparts ,
462
468
workdir = workdir ,
463
469
customizations = customizations ,
470
+ expand_head_model = expand_head_model ,
464
471
)
465
472
else :
466
473
pipeline (
@@ -470,4 +477,5 @@ def pipeline(
470
477
nparts = nparts ,
471
478
workdir = workdir ,
472
479
customizations = customizations ,
480
+ expand_head_model = expand_head_model ,
473
481
)
0 commit comments