PHP to JSON #634
Answered
by
danmarshall
Yaroslav (Ybelyavsky)
asked this question in
Q&A
PHP to JSON
#634
|
Hi! |
Answered by
danmarshall
Oct 21, 2025
Replies: 2 comments 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 |
6 replies
|
Please add the creation of objects directly from json, otherwise it is impossible to create shapes without node.js |
0 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.