Skip to content

Commit edd0039

Browse files
authored
Add backface color to material struct (#1002)
* add backface color to material struct * serde magic for backface_color * redo openapi
1 parent 3c5494b commit edd0039

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

modeling-cmds/openapi/api.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,6 +3615,15 @@
36153615
"type": "number",
36163616
"format": "float"
36173617
},
3618+
"backface_color": {
3619+
"nullable": true,
3620+
"description": "Color of the backface",
3621+
"allOf": [
3622+
{
3623+
"$ref": "#/components/schemas/Color"
3624+
}
3625+
]
3626+
},
36183627
"color": {
36193628
"description": "Color of the new material",
36203629
"allOf": [

modeling-cmds/src/def_enum.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,9 @@ define_modeling_cmd_enum! {
802802
pub roughness: f32,
803803
/// Ambient Occlusion of the new material
804804
pub ambient_occlusion: f32,
805+
/// Color of the backface
806+
#[serde(default, skip_serializing_if = "Option::is_none")]
807+
pub backface_color: Option<Color>,
805808
}
806809
/// What type of entity is this?
807810
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant)]

modeling-session/examples/cube_png.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const CUBE_WIDTH: LengthUnit = LengthUnit(100.0);
2121
async fn main() -> Result<()> {
2222
// Set up the API client.
2323
let token = env::var("ZOO_API_TOKEN")
24-
.or_else(|_| env::var("KITTYCAD_API_TOKEN")) // legacy name
25-
.context("You must set $ZOO_API_TOKEN")?;
24+
.or_else(|_| env::var("KITTYCAD_API_TOKEN")) // legacy name
25+
.context("You must set $ZOO_API_TOKEN")?;
2626
let client = kittycad::Client::new(token);
2727

2828
// Where should the final PNG be saved?

0 commit comments

Comments
 (0)