PHP to JSON #634
Answered
by
danmarshall
Ybelyavsky
asked this question in
Q&A
PHP to JSON
#634
-
|
Hi! |
Beta Was this translation helpful? Give feedback.
Answered by
danmarshall
Oct 21, 2025
Replies: 1 comment 6 replies
-
|
Hello, the final drawing is made up of paths. Here's the json from the rectangle example: {
"models": {
"example": {
"paths": {
"ShapeLine1": {
"type": "line",
"origin": [
0,
0
],
"end": [
50,
0
]
},
"ShapeLine2": {
"type": "line",
"origin": [
50,
0
],
"end": [
50,
100
]
},
"ShapeLine3": {
"type": "line",
"origin": [
50,
100
],
"end": [
0,
100
]
},
"ShapeLine4": {
"type": "line",
"origin": [
0,
100
],
"end": [
0,
0
]
}
}
}
},
"origin": [
0,
0
]
}So your model object will need to generate the |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You can use maker.js on the backend, in node.js - from php you’d probably need to spawn a shell command.
Your example json:
{ "models": { "myRectangle": { "type": "rectangle", "width": 100, "height": 50, "origin": [0, 0] } } }Is not in the schema that maker.js uses. Maker.js does have concepts like Rectangle but that is code driven, and not in declarative json. When using json directly you will be working at a low level with the 3 primitives: line, circle and arc.