Coder Social home page Coder Social logo

kittycad.go's Introduction

kittycad.go

The Golang API client for KittyCAD.

Generating

You can trigger a build with the GitHub action to generate the client. This will automatically update the client to the latest version based on the spec hosted at api.kittycad.io.

Alternatively, if you wish to generate the client locally, run:

$ make generate

Contributing

Please do not change the code directly since it is generated. PRs that change the code directly will be automatically closed by a bot.

kittycad.go's People

Contributors

jessfraz avatar github-actions[bot] avatar dependabot[bot] avatar zoo-github-actions-auth[bot] avatar irev-dev avatar

Stargazers

Timon Relitzki avatar astrolemonade avatar Charlie Haley avatar Glenn Lewis avatar Cody Krieger avatar

Watchers

Adam Sunderland avatar Mike Sager avatar  avatar Mike Farrell avatar David Harvey-Macaulay avatar Vonni Williams avatar Pierre Jacquier avatar Ben Crabbe avatar  avatar

kittycad.go's Issues

Center of mass bug

I noticed a problem with the CreateCenterOfMass function when adding a sample in KittyCAD/litterbox#52. The below code produces this error

panic: error decoding response body: json: cannot unmarshal number into Go struct field FileCenterOfMass.center_of_mass of type string

To me that seems like there might be a typing issue in the generated code?
https://github.com/KittyCAD/kittycad.go/blob/main/types.go#L1286 has

type FileCenterOfMass struct {
	// CenterOfMass: The resulting center of mass.
	CenterOfMass []string `json:"center_of_mass" yaml:"center_of_mass" schema:"center_of_mass"`
        // ...
}

Which should probably be []float64?

example code I was using ๐Ÿ‘‡

package main

import (
	"fmt"
	"github.com/kittycad/kittycad.go"
	"os"
)

func main() {
	client, _ := kittycad.NewClientFromEnv("your apps user agent")

	fileBytes, _ := os.ReadFile("./ORIGINALVOXEL-3.obj")

	densitySteelGramsPerCubicMillimeter := 0.00784

	fc, err := client.File.CreateCenterOfMass(
		densitySteelGramsPerCubicMillimeter,
		"obj",
		fileBytes,
	)
	if err != nil {
		panic(err)
	}
	fmt.Print(fc)
	fmt.Println("File center of mass: ", fc.CenterOfMass)

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.