Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project line orthogonally onto another #1086

Merged
merged 4 commits into from
May 30, 2024
Merged

project line orthogonally onto another #1086

merged 4 commits into from
May 30, 2024

Conversation

jamesbradleym
Copy link
Contributor

@jamesbradleym jamesbradleym commented May 29, 2024

BACKGROUND:

  • Some hy-ccups indicated that while we allowed tolerance within our Walls LOD 200 function, we we're not successfully merging these lines which fell out of tolerance for the merge collinear function

DESCRIPTION:

  • Adds a method to orthogonally project a line onto another

TESTING:

  • Project line A onto line B and observe line A projected orthogonally onto line B.

FUTURE WORK:

  • Is there any future work needed or anticipated? Does this PR create any obvious technical debt?

REQUIRED:

  • All changes are up to date in CHANGELOG.md.

COMMENTS:

  • Any other notes.

This change is Reviewable

@jamesbradleym jamesbradleym requested a review from wynged May 29, 2024 19:08
Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @jamesbradleym)


Elements/src/Geometry/Line.cs line 1227 at r1 (raw file):

        /// <summary>
        /// Projects current line orthogonally onto another line

I don't we need to specify orthogonally.


Elements/src/Geometry/Line.cs line 1234 at r1 (raw file):

        {
            var lineDirection = line.Direction();
            var normalizedDirection = new Vector3(lineDirection.X, lineDirection.Y, lineDirection.Z);

I think you don't need to do this, Direction is already unit length, and even if not there's a Unitized() method that returns a unit length vector.


Elements/src/Geometry/Line.cs line 1236 at r1 (raw file):

            var normalizedDirection = new Vector3(lineDirection.X, lineDirection.Y, lineDirection.Z);

            Vector3 ProjectPoint(Vector3 point, Vector3 lineStart)

I was looking at this thinking it seems generically useful in it's own right, and then realized that I think that the DistanceTo(Ray) method might be doing some similar work? maybe make that method output it's closestPointOnRay that's computed internally and use that?

Copy link
Member

@wynged wynged left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@jamesbradleym jamesbradleym merged commit 2a88a1d into master May 30, 2024
2 checks passed
@jamesbradleym jamesbradleym deleted the project-line branch May 30, 2024 21:17
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