@@ -8,57 +8,33 @@ use crate::{coord, format::Selection, units::UnitLength};
8
8
pub mod import {
9
9
use super :: * ;
10
10
11
- /// Options for exporting STL.
12
- #[ derive( Clone , Debug , Eq , Hash , PartialEq , Serialize , Deserialize , JsonSchema , Display , FromStr ) ]
13
- #[ display( "coords: {coords}, selection: {selection}, storage: {storage}, units: {units}" ) ]
14
- #[ serde( rename = "StlExportOptions" ) ]
11
+ /// Options for importing STL.
12
+ #[ derive(
13
+ Clone , Debug , Eq , Hash , PartialEq , Serialize , Deserialize , JsonSchema , Display , FromStr ,
14
+ ) ]
15
+ #[ display( "coords: {coords}, units: {units}" ) ]
16
+ #[ serde( rename = "StlImportOptions" ) ]
15
17
pub struct Options {
16
- /// Co-ordinate system of output data.
18
+ /// Co-ordinate system of input data.
17
19
///
18
20
/// Defaults to the [KittyCAD co-ordinate system].
19
21
///
20
22
/// [KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html
21
23
pub coords : coord:: System ,
22
-
23
- /// Export selection.
24
- pub selection : Selection ,
25
-
26
- /// Export storage.
27
- pub storage : Storage ,
28
-
29
- /// Export length unit.
30
- ///
31
- /// Defaults to meters.
32
- pub units : UnitLength ,
24
+ /// The units of the input data.
25
+ /// This is very important for correct scaling and when calculating physics properties like
26
+ /// mass, etc.
27
+ pub units : crate :: units:: UnitLength ,
33
28
}
34
29
35
30
impl Default for Options {
36
31
fn default ( ) -> Self {
37
32
Self {
38
33
coords : * coord:: KITTYCAD ,
39
- selection : Default :: default ( ) ,
40
- storage : Default :: default ( ) ,
41
34
units : UnitLength :: Meters ,
42
35
}
43
36
}
44
37
}
45
-
46
- /// Export storage.
47
- #[ derive(
48
- Clone , Copy , Debug , Default , Deserialize , Display , Eq , FromStr , Hash , JsonSchema , PartialEq , Serialize ,
49
- ) ]
50
- #[ display( style = "snake_case" ) ]
51
- #[ serde( rename = "StlStorage" , rename_all = "snake_case" ) ]
52
- pub enum Storage {
53
- /// Plaintext encoding.
54
- Ascii ,
55
-
56
- /// Binary STL encoding.
57
- ///
58
- /// This is the default setting.
59
- #[ default]
60
- Binary ,
61
- }
62
38
}
63
39
64
40
/// Export models in STL format.
0 commit comments