18 "description":
"A floating-point 3-dimensional Cartesian spatial location.",
19 "keywords": [
"coordinate" ],
45 VuoPoint3d point = {0,0,0};
47 json_type t = json_object_get_type(js);
48 if (t == json_type_string)
50 const char *s = json_object_get_string(js);
52 sscanf(s,
"%20g, %20g, %20g", &x, &y, &z);
53 return (VuoPoint3d){x, y, z};
55 else if (t == json_type_array)
57 int len = json_object_array_length(js);
59 point.x = json_object_get_double(json_object_array_get_idx(js, 0));
61 point.y = json_object_get_double(json_object_array_get_idx(js, 1));
63 point.z = json_object_get_double(json_object_array_get_idx(js, 2));
69 if (json_object_object_get_ex(js,
"x", &o))
70 point.x = json_object_get_double(o);
71 else if (json_object_object_get_ex(js,
"X", &o))
72 point.x = json_object_get_double(o);
74 if (json_object_object_get_ex(js,
"y", &o))
75 point.y = json_object_get_double(o);
76 else if (json_object_object_get_ex(js,
"Y", &o))
77 point.y = json_object_get_double(o);
79 if (json_object_object_get_ex(js,
"z", &o))
80 point.z = json_object_get_double(o);
81 else if (json_object_object_get_ex(js,
"Z", &o))
82 point.z = json_object_get_double(o);
95 json_object *xObject = json_object_new_double(value.x);
96 json_object_object_add(js,
"x", xObject);
98 json_object *yObject = json_object_new_double(value.y);
99 json_object_object_add(js,
"y", yObject);
101 json_object *zObject = json_object_new_double(value.z);
102 json_object_object_add(js,
"z", zObject);
137 min = max = points[0];
138 for (
unsigned long i = 1; i < count; ++i)
143 VuoPoint3d diff = max - min;
144 return diff.x <= tolerance.x
145 && diff.y <= tolerance.y
146 && diff.z <= tolerance.z;
168 return minimum.x <= value.x && value.x <= maximum.x
169 && minimum.y <= value.y && value.y <= maximum.y
170 && minimum.z <= value.z && value.z <= maximum.z;
186 VuoPoint3d min = FLT_MAX;
187 for (
unsigned long i = 0; i < count; ++i)
191 *outputPosition = i + 1;
210 VuoPoint3d max = -FLT_MAX;
211 for (
unsigned long i = 0; i < count; ++i)
215 *outputPosition = i + 1;
234 VuoPoint3d divisor = count;
235 return sum / divisor;