Rail Position in Blueprints

Place to get help with not working mods / modding interface.
Post Reply
chibbi
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Dec 01, 2023 7:47 pm
Contact:

Rail Position in Blueprints

Post by chibbi »

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:
inverted_chest_blueprint.png
inverted_chest_blueprint.png (452.17 KiB) Viewed 329 times
Example for inverted blueprint with rails:
inverted_rail_blueprint.png
inverted_rail_blueprint.png (305.03 KiB) Viewed 329 times
Inverted on y axis:
inverted_on_y.png
inverted_on_y.png (489.66 KiB) Viewed 329 times
does someone have an idea what i misunderstand or forgot?

Qon
Smart Inserter
Smart Inserter
Posts: 2126
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Rail Position in Blueprints

Post by Qon »

When making blueprint strings, positive x is to the right, positive y is down. Your plots have positive y up. So I assume that is your issue. All your plots in your pictures are upside down.
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser

chibbi
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Dec 01, 2023 7:47 pm
Contact:

Re: Rail Position in Blueprints

Post by chibbi »

Ahhh, that makes sense.
basically i always have my y axis inverted and sometimes misinterpreted that as having my x axis inverted.

Post Reply

Return to “Modding help”