@@ -15,8 +15,11 @@ use crate::cmd_kcl::write_deterministic_export;
1515
1616/// Perform operations on CAD files.
1717///
18- /// # convert a step file to an obj file
19- /// $ zoo file convert --output-format=obj ./input.step ./
18+ /// ```shell
19+ /// # convert a step file to an obj file
20+ /// zoo file convert --output-format=obj ./input.step ./
21+ /// ```
22+ ///
2023#[ derive( Parser , Debug , Clone ) ]
2124#[ clap( verbatim_doc_comment) ]
2225pub struct CmdFile {
@@ -54,17 +57,25 @@ impl crate::cmd::Command for CmdFile {
5457///
5558/// If the file being converted is larger than a certain size it will be
5659/// performed asynchronously, you can then check its status with the
57- /// `zoo api-call status <id_of_your_operation>` command.
60+ /// `zoo api-call status <id_of_your_operation>` command. The status call will return
61+ /// 404 if the size is under 25MB, it will not be processed asynchronously.
5862///
59- /// # convert step to obj
60- /// $ zoo file convert --output-format=obj my-file.step output_dir
63+ /// ```shell
64+ /// # convert step to obj
65+ /// zoo file convert --output-format=obj my-file.step output_dir
66+ /// ```
6167///
62- /// # convert obj to step
63- /// $ zoo file convert --output-format=step my-obj.obj .
68+ /// ```shell
69+ /// # convert obj to step
70+ /// zoo file convert --output-format=step my-obj.obj .
71+ /// ```
72+ ///
73+ /// ```shell
74+ /// # pass a file to convert from stdin
75+ /// # when converting from stdin, the original file type is required
76+ /// cat my-obj.obj | zoo file convert --output-format=step --src-format=obj - output_dir
77+ /// ```
6478///
65- /// # pass a file to convert from stdin
66- /// # when converting from stdin, the original file type is required
67- /// $ cat my-obj.obj | zoo file convert --output-format=step - output_dir
6879#[ derive( Parser , Debug , Clone ) ]
6980#[ clap( verbatim_doc_comment) ]
7081pub struct CmdFileConvert {
@@ -163,11 +174,16 @@ impl crate::cmd::Command for CmdFileConvert {
163174
164175/// Snapshot a render of a CAD file as any supported image format.
165176///
166- /// # snapshot as png
167- /// $ zoo file snapshot my-file.obj my-file.png
177+ /// ```shell
178+ /// # snapshot as png
179+ /// zoo file snapshot my-file.obj my-file.png
180+ /// ```
181+ ///
182+ /// ```shell
183+ /// # pass a file to snapshot from stdin
184+ /// cat my-obj.obj | zoo file snapshot --output-format=png --src-format=obj - my-file.png
185+ /// ```
168186///
169- /// # pass a file to snapshot from stdin
170- /// $ cat my-obj.obj | zoo file snapshot --output-format=png - my-file.png
171187#[ derive( Parser , Debug , Clone ) ]
172188#[ clap( verbatim_doc_comment) ]
173189pub struct CmdFileSnapshot {
@@ -370,11 +386,16 @@ impl crate::cmd::Command for CmdFileSnapshot {
370386/// performed asynchronously, you can then check the status with the
371387/// `zoo api-call status <id_of_your_operation>` command.
372388///
373- /// # get the volume of a file
374- /// $ zoo file volume my-file.step
389+ /// ```shell
390+ /// # get the volume of a file
391+ /// zoo file volume my-file.step --output-unit=mm3
392+ /// ```
375393///
376- /// # pass a file from stdin, the original file type is required
377- /// $ cat my-obj.obj | zoo file volume - --src-format=obj
394+ /// ```shell
395+ /// # pass a file from stdin, the original file type is required
396+ /// cat my-obj.obj | zoo file volume - --src-format=obj --output-unit=mm3
397+ /// ```
398+ ///
378399#[ derive( Parser , Debug , Clone ) ]
379400#[ clap( verbatim_doc_comment) ]
380401pub struct CmdFileVolume {
@@ -431,11 +452,16 @@ impl crate::cmd::Command for CmdFileVolume {
431452/// performed asynchronously, you can then check the status with the
432453/// `zoo api-call status <id_of_your_operation>` command.
433454///
434- /// # get the mass of a file
435- /// $ zoo file mass my-file.step
455+ /// ```shell
456+ /// # get the mass of a file
457+ /// zoo file mass my-file.step --material-density 500 --material-density-unit=kg-m3 --output-unit=kg
458+ /// ```
436459///
437- /// # pass a file from stdin, the original file type is required
438- /// $ cat my-obj.obj | zoo file mass - --src-format=obj
460+ /// ```shell
461+ /// # pass a file from stdin, the original file type is required
462+ /// cat my-obj.obj | zoo file mass - --src-format=obj --material-density 500 --material-density-unit=kg-m3 --output-unit=kg
463+ /// ```
464+ ///
439465#[ derive( Parser , Debug , Clone ) ]
440466#[ clap( verbatim_doc_comment) ]
441467pub struct CmdFileMass {
@@ -510,11 +536,16 @@ impl crate::cmd::Command for CmdFileMass {
510536/// performed asynchronously, you can then check the status with the
511537/// `zoo api-call status <id_of_your_operation>` command.
512538///
513- /// # get the mass of a file
514- /// $ zoo file center-of-mass my-file.step
539+ /// ```shell
540+ /// # get the mass of a file
541+ /// zoo file center-of-mass my-file.step --output-unit=m
542+ /// ```
515543///
516- /// # pass a file from stdin, the original file type is required
517- /// $ cat my-obj.obj | zoo file center-of-mass - --src-format=obj
544+ /// ```shell
545+ /// # pass a file from stdin, the original file type is required
546+ /// cat my-obj.obj | zoo file center-of-mass - --src-format=obj --output-unit=m
547+ /// ```
548+ ///
518549#[ derive( Parser , Debug , Clone ) ]
519550#[ clap( verbatim_doc_comment) ]
520551pub struct CmdFileCenterOfMass {
@@ -571,11 +602,16 @@ impl crate::cmd::Command for CmdFileCenterOfMass {
571602/// performed asynchronously, you can then check the status with the
572603/// `zoo api-call status <id_of_your_operation>` command.
573604///
574- /// # get the density of a file
575- /// $ zoo file density my-file.step
605+ /// ```shell
606+ /// # get the density of a file
607+ /// zoo file density my-file.step --material-mass 212.2923 --material-mass-unit g --output-unit kg-m3
608+ /// ```
609+ ///
610+ /// ```shell
611+ /// # pass a file from stdin, the original file type is required
612+ /// cat my-obj.obj | zoo file density - --src-format=obj -material-mass 212.2923 --material-mass-unit g --output-unit kg-m3
613+ /// ```
576614///
577- /// # pass a file from stdin, the original file type is required
578- /// $ cat my-obj.obj | zoo file density - --src-format=obj
579615#[ derive( Parser , Debug , Clone ) ]
580616#[ clap( verbatim_doc_comment) ]
581617pub struct CmdFileDensity {
@@ -650,11 +686,16 @@ impl crate::cmd::Command for CmdFileDensity {
650686/// performed asynchronously, you can then check the status with the
651687/// `zoo api-call status <id_of_your_operation>` command.
652688///
653- /// # get the surface-area of a file
654- /// $ zoo file surface-area my-file.step
689+ /// ```shell
690+ /// # get the surface-area of a file
691+ /// zoo file surface-area my-file.step --output-unit m2
692+ /// ```
693+ ///
694+ /// ```shell
695+ /// # pass a file from stdin, the original file type is required
696+ /// cat my-obj.obj | zoo file surface-area - --src-format=obj --output-unit m2
697+ /// ```
655698///
656- /// # pass a file from stdin, the original file type is required
657- /// $ cat my-obj.obj | zoo file surface-area - --src-format=obj
658699#[ derive( Parser , Debug , Clone ) ]
659700#[ clap( verbatim_doc_comment) ]
660701pub struct CmdFileSurfaceArea {
0 commit comments