diff --git a/examples_test.go b/examples_test.go index 26dc49a..477221a 100644 --- a/examples_test.go +++ b/examples_test.go @@ -2865,6 +2865,7 @@ func ExampleExecutorService_CreateTerm() { // - `fps` // - `pool` // - `postEffect`: Post effect type +// - `showGrid` // - `unlockedFramerate` // - `videoResHeight` // - `videoResWidth` @@ -2877,7 +2878,7 @@ func ExampleModelingService_CommandsWs() { } // Create the websocket connection. - ws, err := client.Modeling.CommandsWs(123, "some-string", kittycad.PostEffectTypePhosphor, true, 123, 123, true, "") + ws, err := client.Modeling.CommandsWs(123, "some-string", kittycad.PostEffectTypePhosphor, true, true, 123, 123, true, "") if err != nil { panic(err) } diff --git a/kittycad.go.patch.json b/kittycad.go.patch.json index ac94bc5..bf8cb4f 100644 --- a/kittycad.go.patch.json +++ b/kittycad.go.patch.json @@ -1065,7 +1065,7 @@ }, { "value": { - "example": "// CommandsWs: Open a websocket which accepts modeling commands.\n// \n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n// \n// \n// Parameters\n// \n// \t- `fps`\n// \t- `pool`\n// \t- `postEffect`: Post effect type\n// \t- `unlockedFramerate`\n// \t- `videoResHeight`\n// \t- `videoResWidth`\n// \t- `webrtc`\n// \t- `body`: The websocket messages the server receives.\n// \n// CommandsWs: Open a websocket which accepts modeling commands.\n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n//\n// Parameters\n//\n// - `fps`\n// - `pool`\n// - `postEffect`: Post effect type\n// - `unlockedFramerate`\n// - `videoResHeight`\n// - `videoResWidth`\n// - `webrtc`\n// - `body`: The websocket messages the server receives.\nfunc ExampleModelingService_CommandsWs() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create the websocket connection.\n\tws, err := client.Modeling.CommandsWs(123, \"some-string\", kittycad.PostEffectTypePhosphor, true, 123, 123, true, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer ws.Close()\n\n\tdone := make(chan struct{})\n\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor {\n\t\t\t_, message, err := ws.ReadMessage()\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"read:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Printf(\"recv: %s\", message)\n\t\t}\n\t}()\n\n\tticker := time.NewTicker(time.Second)\n\tdefer ticker.Stop()\n\n\tinterrupt := make(chan os.Signal, 1)\n\tsignal.Notify(interrupt, os.Interrupt)\n\n\tfor {\n\t\tselect {\n\t\tcase \u003c-done:\n\t\t\treturn\n\t\tcase t := \u003c-ticker.C:\n\t\t\terr := ws.WriteMessage(websocket.TextMessage, []byte(t.String()))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase \u003c-interrupt:\n\t\t\tlog.Println(\"interrupt\")\n\n\t\t\t// Cleanly close the connection by sending a close message and then\n\t\t\t// waiting (with timeout) for the server to close the connection.\n\t\t\terr := ws.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, \"\"))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write close:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase \u003c-done:\n\t\t\tcase \u003c-time.After(time.Second):\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n}\n", + "example": "// CommandsWs: Open a websocket which accepts modeling commands.\n// \n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n// \n// \n// Parameters\n// \n// \t- `fps`\n// \t- `pool`\n// \t- `postEffect`: Post effect type\n// \t- `showGrid`\n// \t- `unlockedFramerate`\n// \t- `videoResHeight`\n// \t- `videoResWidth`\n// \t- `webrtc`\n// \t- `body`: The websocket messages the server receives.\n// \n// CommandsWs: Open a websocket which accepts modeling commands.\n// Pass those commands to the engine via websocket, and pass responses back to the client. Basically, this is a websocket proxy between the frontend/client and the engine.\n//\n// Parameters\n//\n// - `fps`\n// - `pool`\n// - `postEffect`: Post effect type\n// - `showGrid`\n// - `unlockedFramerate`\n// - `videoResHeight`\n// - `videoResWidth`\n// - `webrtc`\n// - `body`: The websocket messages the server receives.\nfunc ExampleModelingService_CommandsWs() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Create the websocket connection.\n\tws, err := client.Modeling.CommandsWs(123, \"some-string\", kittycad.PostEffectTypePhosphor, true, true, 123, 123, true, \"\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer ws.Close()\n\n\tdone := make(chan struct{})\n\n\tgo func() {\n\t\tdefer close(done)\n\t\tfor {\n\t\t\t_, message, err := ws.ReadMessage()\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"read:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlog.Printf(\"recv: %s\", message)\n\t\t}\n\t}()\n\n\tticker := time.NewTicker(time.Second)\n\tdefer ticker.Stop()\n\n\tinterrupt := make(chan os.Signal, 1)\n\tsignal.Notify(interrupt, os.Interrupt)\n\n\tfor {\n\t\tselect {\n\t\tcase \u003c-done:\n\t\t\treturn\n\t\tcase t := \u003c-ticker.C:\n\t\t\terr := ws.WriteMessage(websocket.TextMessage, []byte(t.String()))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\tcase \u003c-interrupt:\n\t\t\tlog.Println(\"interrupt\")\n\n\t\t\t// Cleanly close the connection by sending a close message and then\n\t\t\t// waiting (with timeout) for the server to close the connection.\n\t\t\terr := ws.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, \"\"))\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"write close:\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tselect {\n\t\t\tcase \u003c-done:\n\t\t\tcase \u003c-time.After(time.Second):\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t}\n\n}\n", "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#ModelingService.CommandsWs" }, "op": "add", diff --git a/paths.go b/paths.go index d47ae4e..633e0df 100644 --- a/paths.go +++ b/paths.go @@ -6386,12 +6386,13 @@ func (s *ExecutorService) CreateTerm() (*websocket.Conn, error) { // - `fps` // - `pool` // - `postEffect`: Post effect type +// - `showGrid` // - `unlockedFramerate` // - `videoResHeight` // - `videoResWidth` // - `webrtc` // - `body`: The websocket messages the server receives. -func (s *ModelingService) CommandsWs(fps int, pool string, postEffect PostEffectType, unlockedFramerate bool, videoResHeight int, videoResWidth int, webrtc bool, body any) (*websocket.Conn, error) { +func (s *ModelingService) CommandsWs(fps int, pool string, postEffect PostEffectType, showGrid bool, unlockedFramerate bool, videoResHeight int, videoResWidth int, webrtc bool, body any) (*websocket.Conn, error) { // Create the url. path := "/ws/modeling/commands" uri := resolveRelative(s.client.server, path) diff --git a/spec.json b/spec.json index f340e6c..82effdc 100644 --- a/spec.json +++ b/spec.json @@ -12350,6 +12350,14 @@ "$ref": "#/components/schemas/PostEffectType" } }, + { + "in": "query", + "name": "show_grid", + "description": "If true, will show the grid at the start of the session.", + "schema": { + "type": "boolean" + } + }, { "in": "query", "name": "unlocked_framerate", @@ -23913,26 +23921,24 @@ "type": "object", "properties": { "fov_y": { + "nullable": true, "description": "Camera frustum vertical field of view.", "type": "number", "format": "float" }, "z_far": { + "nullable": true, "description": "Camera frustum far plane.", "type": "number", "format": "float" }, "z_near": { + "nullable": true, "description": "Camera frustum near plane.", "type": "number", "format": "float" } - }, - "required": [ - "fov_y", - "z_far", - "z_near" - ] + } }, "PlanInterval": { "description": "A plan's interval.", diff --git a/types.go b/types.go index e378629..c7577bb 100755 --- a/types.go +++ b/types.go @@ -3837,11 +3837,11 @@ const ( // PerspectiveCameraParameters: Defines a perspective view. type PerspectiveCameraParameters struct { // FovY: Camera frustum vertical field of view. - FovY float64 `json:"fov_y" yaml:"fov_y" schema:"fov_y,required"` + FovY float64 `json:"fov_y" yaml:"fov_y" schema:"fov_y"` // ZFar: Camera frustum far plane. - ZFar float64 `json:"z_far" yaml:"z_far" schema:"z_far,required"` + ZFar float64 `json:"z_far" yaml:"z_far" schema:"z_far"` // ZNear: Camera frustum near plane. - ZNear float64 `json:"z_near" yaml:"z_near" schema:"z_near,required"` + ZNear float64 `json:"z_near" yaml:"z_near" schema:"z_near"` } // PlanInterval: A plan's interval.