Rail Position in Blueprints
Posted: Fri Dec 01, 2023 8:48 pm
Short Description
I am parsing factorio blueprints containing a section of a rail system. These rails are supposed to be parsed into another format by their position.
The positions of entities are not right. Some blueprints have a axis inverted. This does not happen with every possible blueprint and it is not always the same axis.
Does someone have helpful links or a good explanation about how i should understand the positions of single rail entities?
What i have already done
I can successfully parse and generate blueprints and blueprint books.
I can generate and parse a variable length of rails straight up (direction: None or 4) or straight to the right (direction: 2 or 6).
These will not show me if i have understood the position in the slightest, because a axis-parallel line works no matter if it gets inverted in y or x axis.
I can parse arbitrary blueprints and put the positions of every object onto a coord system with matplotlib.
Detail explanation of the problem
With Matplotlib (or looking at the individual positions) it becomes clear that on every blueprint has at least one axis is inverted. It is mostly the X-Axis but also sometimes the Y-Axis. When i encode the json object back to a blueprint string and reimport it to factorio it is not inverted in any way.
Because the Inversion is not always on the same Axis, i don't know what could cause this (i mean i have ideas, but was not able to confirm any).
I am fairly sure that it is not a problem with my parsing, because by parsing there cant only be a problem with the x or y value of every entity.
Example for an inverted blueprint which does not contain rails: Example for inverted blueprint with rails: Inverted on y axis: does someone have an idea what i misunderstand or forgot?
I am parsing factorio blueprints containing a section of a rail system. These rails are supposed to be parsed into another format by their position.
The positions of entities are not right. Some blueprints have a axis inverted. This does not happen with every possible blueprint and it is not always the same axis.
Does someone have helpful links or a good explanation about how i should understand the positions of single rail entities?
What i have already done
I can successfully parse and generate blueprints and blueprint books.
I can generate and parse a variable length of rails straight up (direction: None or 4) or straight to the right (direction: 2 or 6).
These will not show me if i have understood the position in the slightest, because a axis-parallel line works no matter if it gets inverted in y or x axis.
I can parse arbitrary blueprints and put the positions of every object onto a coord system with matplotlib.
Detail explanation of the problem
With Matplotlib (or looking at the individual positions) it becomes clear that on every blueprint has at least one axis is inverted. It is mostly the X-Axis but also sometimes the Y-Axis. When i encode the json object back to a blueprint string and reimport it to factorio it is not inverted in any way.
Because the Inversion is not always on the same Axis, i don't know what could cause this (i mean i have ideas, but was not able to confirm any).
I am fairly sure that it is not a problem with my parsing, because by parsing there cant only be a problem with the x or y value of every entity.
Example for an inverted blueprint which does not contain rails: Example for inverted blueprint with rails: Inverted on y axis: does someone have an idea what i misunderstand or forgot?