What non-.net implementation would you prefer?
well, let’s say curl
for fun. I tried earlier this morning:
- create a point
- take point response
- create a circle around that point
- fail (point was stuck at 000)
I need to wrap my head properly around this, don’t worry. I haven’t RTFM beyond the first paragraph so to say, so please do ignore the above
You actually found a bug. Your curl instructions were probably correct. The endpoint for a Circle constructor is overloaded and I’m picking the wrong internal version to call based no your json input. I just ran a test and see the same results.
I have to figure out why {"X":1.0,"Y":2.0,"Z":3.0}
is allowable in JSON.Net for being converted into a Rhino.Geometry.Plane
This specific test should be working now. I am using the following curl
syntax
curl -H "api_token: steve@mcneel.com" -H "Content-Type: application/json"
-d '[{"X":1.0,"Y":2.0,"Z":3.0}, 12]' https://compute.rhino3d.com/Rhino/Geometry/Circle/New
I need to look into tweaking how JSON.Net serializes classes like Planes and Circles so it isn’t so heavy. Right now JSON.Net just automatically serializes all of the properties which isn’t necessary.
It works! Tried it too, got circle in the expected place
I had the same headaches with speckle, hence the speckle base geometry types that tend to strip down stuff to minimal properties. Ideally these things can be controlled through json.net decorators elegantly though like [jsonignore]
if i recall correctly.
I can’t use attributes the way that our server is set up but it looks like there are other pretty simple approaches available.