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

Updated Intersection method to support multiple representations #1034

Merged
merged 5 commits into from
Oct 6, 2023

Conversation

katehryhorenko
Copy link
Contributor

@katehryhorenko katehryhorenko commented Oct 3, 2023

BACKGROUND:

  • _bounds and _csg are used by GeometricElement.Intersection method. Both this variables are calculated from SolidOperations. So currently Intersection method ignores RepresentationInstances

DESCRIPTION:
This PR adds:

  • CalculateIntersactionPoints and ComputeBounds to the SolidRepresentation. It's a duplicated code from the GeometricElement.
  • SolidRepresentations are added to the Bounds calculations and to the Intersections

TESTING:

  • I tested it with SVGSection method

FUTURE WORK:

  • Add other Representation types to the calculations

REQUIRED:

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

This change is Reviewable

Copy link
Member

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

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

Looks good! can we add a test or two?

Reviewed 3 of 4 files at r1, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @katehryhorenko)


Elements/src/Representations/SolidRepresentation.cs line 150 at r1 (raw file):

        /// <param name="beyondPolygons">The output collection of the polygons beyond the input plane.</param>
        /// <returns>Returns the collection of intersection points.</returns>
        public List<Vector3> CalculateIntersactionPoints(GeometricElement element, Plane plane, out List<Polygon> beyondPolygons)

CalculateIntersactionPoints => CalculateIntersectionPoints :)


Elements/src/Representations/SolidRepresentation.cs line 157 at r1 (raw file):

            var csg = SolidOperationUtils.GetFinalCsgFromSolids(SolidOperations, element, true);

            var localCsg = csg.Transform(element.Transform.ToMatrix4x4()); ;

lose extra ; here

Copy link
Member

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

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

And update changelog 😄

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @katehryhorenko)

Copy link
Contributor Author

@katehryhorenko katehryhorenko left a comment

Choose a reason for hiding this comment

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

I added two tests :)

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @andrewheumann)


Elements/src/Representations/SolidRepresentation.cs line 150 at r1 (raw file):

Previously, andrewheumann (Andrew Heumann) wrote…

CalculateIntersactionPoints => CalculateIntersectionPoints :)

Done.


Elements/src/Representations/SolidRepresentation.cs line 157 at r1 (raw file):

Previously, andrewheumann (Andrew Heumann) wrote…

lose extra ; here

Done.

Copy link
Member

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @katehryhorenko)


Elements/src/GeometricElement.cs line 263 at r2 (raw file):

                foreach (var instance in RepresentationInstances)
                {
                    if (!instance.IsDefault)

can we leave a TODO here about potentially accepting a representation type filter as input?


Elements/test/GeometricElementTests.cs line 89 at r2 (raw file):

            var width = 10;
            var height = 10;
            var hhickness = 0.2;

hhickness => thickness

Copy link
Contributor Author

@katehryhorenko katehryhorenko left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @andrewheumann)


Elements/src/GeometricElement.cs line 263 at r2 (raw file):

Previously, andrewheumann (Andrew Heumann) wrote…

can we leave a TODO here about potentially accepting a representation type filter as input?

Done.


Elements/test/GeometricElementTests.cs line 89 at r2 (raw file):

Previously, andrewheumann (Andrew Heumann) wrote…

hhickness => thickness

Done.

Copy link
Member

@andrewheumann andrewheumann left a comment

Choose a reason for hiding this comment

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

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

@katehryhorenko katehryhorenko merged commit 9bcdbe9 into master Oct 6, 2023
1 check passed
@katehryhorenko katehryhorenko deleted the multiple-representations-two branch October 6, 2023 19:26
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