Skip to content

Conversation

@Mael-Le-Garrec
Copy link

@Mael-Le-Garrec Mael-Le-Garrec commented Oct 22, 2025

Description

Currently, the FoorPlot uses the position of the elements to plot them but does not use the shift_x, shift_y and rotation variables like rot_s_rad.
This PR adds these shifsts and rotations to the elements positions.
I am only taking into account thick elements in this PR for now!

Linked issue: #98

Checklist

Mandatory:

  • I described my changes in this PR description
  • I have added/updated the docs (docstrings) in relation to my changes
  • The code I wrote follows good style practices (see PEP 8 and PEP 20)

Optional:

  • I have added/updated examples to show the usage of new features introduced (only for major changes)
  • I have added tests to cover my changes
  • All the tests are passing, including my new ones

Comment on lines -483 to +499
x += d * np.cos(ang(rt))
y += d * np.sin(ang(rt))
x += d * np.cos(ang(rt) + ang(shift_angle)) + shift_x
y += d * np.sin(ang(rt) + ang(shift_angle)) + shift_y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, x and y refer to the plot axis, i.e. the coordinate system of the floor. Depending on the projection this can be any two out of (X, Y, Z).
But shift and rotation is in the relative coordinate system (x, y, s) of the reference trajectory, right? So some translation of the reference trajectory coordinates to floor coordinates is required (equivalent to what the survey command does + projection). And the anchor point of the misalignment has to be taken into account (e.g. if the anchor is not the center and there is a rotation misalignment, then the shift at the center may be larger or smaller than shift_x).

Also unit scaling with scale is missing, but that seems to be missing anywhere around these lines, we can probably fix it in the process.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense, I made my tests on a straight section, that's why it was working I guess.

@eltos
Copy link
Member

eltos commented Oct 22, 2025

Okay I realised the handling of misalignments is a bit more complex. I left a comment on the diff with what I think needs to be addressed for it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants