Skip to content

Allow an optional origin in world frame constructors - #1534

Open
ArianMoeini wants to merge 2 commits into
compas-dev:mainfrom
ArianMoeini:feat/frame-world-origin
Open

ArianMoeini wants to merge 2 commits into
compas-dev:mainfrom
ArianMoeini:feat/frame-world-origin

Conversation

@ArianMoeini

Copy link
Copy Markdown

Closes #1141.

Allow Frame.worldXY(), Frame.worldYZ(), and Frame.worldZX() to take an optional origin as a coordinate sequence or Point. Calls without an argument still use [0, 0, 0], and each frame keeps its existing axis directions.

The constructor docstrings show the new usage, and a parameterized test covers all three frames with both accepted point forms. I also added the changelog entry and contributor credit required by CONTRIBUTING.md.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

  • I added a line to CHANGELOG.md under Unreleased.
  • I ran the full pytest suite: 1,017 passed, 12 skipped.
  • I ran project-wide lint with no errors. ruff check . reports 12 existing issues outside the changed files; ruff check and ruff format --check pass for the changed Python files.
  • I added new functions/classes and made them available on a second-level import (not applicable; existing constructors were extended).
  • I added tests for the new behavior.
  • I updated the constructor documentation.

The frame module doctests also pass (19 passed).

This branch has not been deployed

No deployments
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.

Optionally set origin point to Frame.worldXY()

1 participant