json
Convert your points to (and from) JSON.
(new Point).toJSON()
For a list of points: let listStr = stage.gearBox.points.toJSON() stage.gearBox.points.fromJSON(listStr)
The fromJSON returns a new list. To mutate in place, apply mutate=true
stage.gearBox.points.fromJSON(listStr, true)
when mutating, additional points (from the json string) are created and applied immediately. For example, if the target pointlist has 4 points, applying a listStr of 6 points will generate 2 new points.
let points = new PointList(
[20, 40, 23 ]
, [30, 30, 200, 30]
, [10, 20, 200, 30]
).cast()
let s = points.toJSON()
points.fromJSON(s, true)
Meta Data
| filepath_exists | True |
| path | json |
| filepath | json.js |
| clean_files | () |