-
Notifications
You must be signed in to change notification settings - Fork 73
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
Door-representation-improvements-ak #1057
Conversation
- Fixed Door deserialization issue - Door can be deserialized now; - Removed 'Wall' property; - Added 'isElementDefinition' property to constructors; - Added DoorTest.
The representation is a RepresentationInstance now instead of Representation.
- Moved curve representation to DoorRepresentationFactory; - Added curve representation to UpdateRepresentations.
…/srudenkoamc/Elements into door-representation-improvements
…/srudenkoamc/Elements into door-representation-improvements
- Method CreateDoorOpening is used now instead of Opening property; - Removed opening properties from constructor; - Fixed issue in Opening class; - Fixed several small issues in door opening size computation.
The tests failed because doors don't have Opening members anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 9 files at r1, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @anthonie-kramer)
Elements/src/Door.cs
line 172 at r1 (raw file):
{ var representationInstances = new List<RepresentationInstance>() {
this formatting looks pretty weird.
Elements/src/Door.cs
line 207 at r1 (raw file):
private RepresentationInstance CreateDoorCurveRepresentation() { var points = CollectPointsForSchematicVisualization();
in all of the methods that make representations it seems like we're always making a new RepresentationInstance for each door, but a big reason to move to RepresentationInstances is so that we can re-use instances. This will keep the glb model size down which makes function execution faster.
Elements/src/Door.cs
line 380 at r1 (raw file):
} public enum DoorOpeningSide
in general we like to give classes and enums their own file. looks like these got merged in for some reason?
Elements/src/StandardWall.cs
line 122 at r1 (raw file):
// Opening transform is still off... `outOfPlane` added because transform is not working correctly var outOfPlane = xAxis.Cross(Vector3.ZAxis); // Opening transform is still off?
are these comments correct? does this adjustment fix the opening transform or not?
Elements/test/DoorTest.cs
line 17 at r1 (raw file):
public void Example() { this.Name = "Elements_Door";
use nameof(MakeDoorElement)
and change the name of this method to MakeDoorElement
keeps the names in sync
Elements/test/DoorTest.cs
line 22 at r1 (raw file):
var wall = new StandardWall(line, 0.1, 3.0); var door = new Door(wall.CenterLine, 0.5, 2.0, 2.0, Door.DOOR_THICKNESS, DoorOpeningSide.LeftHand, DoorOpeningType.SingleSwing); wall.AddDoorOpening(door);
can we make an assertion about the wall having an opening here.
There was a problem hiding this 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 @wynged)
Elements/src/Door.cs
line 172 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
this formatting looks pretty weird.
Good catch, I'll fix
Elements/src/Door.cs
line 207 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
in all of the methods that make representations it seems like we're always making a new RepresentationInstance for each door, but a big reason to move to RepresentationInstances is so that we can re-use instances. This will keep the glb model size down which makes function execution faster.
What is the expected process? Should we always create representations in the function? We could do this automatically by comparing elements when they are created and seeing if they have identical properties, and then re-using the representation. I'd like to keep this as simple as possible without requiring the user to manage representations.
Elements/src/Door.cs
line 380 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
in general we like to give classes and enums their own file. looks like these got merged in for some reason?
I was trying to de-clutter the Elements folder... I could put this into the Utilities folder... I think this might be where we should break out the BIM stuff into their own folders. I just didn't want Enum files in the src folder
Elements/src/StandardWall.cs
line 122 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
are these comments correct? does this adjustment fix the opening transform or not?
Done. Removed
Elements/test/DoorTest.cs
line 17 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
use
nameof(MakeDoorElement)
and change the name of this method toMakeDoorElement
keeps the names in sync
Done.
Elements/test/DoorTest.cs
line 22 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
can we make an assertion about the wall having an opening here.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r2, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @anthonie-kramer)
Elements/src/Door.cs
line 207 at r1 (raw file):
Previously, anthonie-kramer (Anthonie Kramer) wrote…
What is the expected process? Should we always create representations in the function? We could do this automatically by comparing elements when they are created and seeing if they have identical properties, and then re-using the representation. I'd like to keep this as simple as possible without requiring the user to manage representations.
great Q, I don't think we've really formalized the pattern, but here's a doc that Kate sent to me https://www.notion.so/hyparaec/Multiple-Representations-b8a5754229c940698c5fb73608e6bd8c?pvs=4
and here's a PR where I'm starting to do this for fittings. https://github.com/hypar-io/Elements/pull/1056/files#diff-cf24189f505ad5e3c1484c59c3aa75ffb8324341ce1a61717c47af0410a4b2f5
I opted for adding a hashing method on the class that helped determine if something should be re-used. if you like this pattern we can discuss with kate if this could be elevated to "infrastructure"
Elements/src/Door.cs
line 380 at r1 (raw file):
Previously, anthonie-kramer (Anthonie Kramer) wrote…
I was trying to de-clutter the Elements folder... I could put this into the Utilities folder... I think this might be where we should break out the BIM stuff into their own folders. I just didn't want Enum files in the src folder
ah, well a folder sounds fine to me! you could make one for 'enums' or for 'doors' or .... you could start the BIM folder? I think having separate files makes code much easier to navigate though.
There was a problem hiding this 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 @wynged)
Elements/src/Door.cs
line 207 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
great Q, I don't think we've really formalized the pattern, but here's a doc that Kate sent to me https://www.notion.so/hyparaec/Multiple-Representations-b8a5754229c940698c5fb73608e6bd8c?pvs=4
and here's a PR where I'm starting to do this for fittings. https://github.com/hypar-io/Elements/pull/1056/files#diff-cf24189f505ad5e3c1484c59c3aa75ffb8324341ce1a61717c47af0410a4b2f5
I opted for adding a hashing method on the class that helped determine if something should be re-used. if you like this pattern we can discuss with kate if this could be elevated to "infrastructure"
Added a comment to the notion doc... Let me know if you want to discuss the solution in more detail and we can start building out a standard approach.
Elements/src/Door.cs
line 380 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
ah, well a folder sounds fine to me! you could make one for 'enums' or for 'doors' or .... you could start the BIM folder? I think having separate files makes code much easier to navigate though.
Done. Also started a BIM folder and updated the Doors namespace... we should migrate other BIM things into it in a future refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the final version... until we find a generic solution for storage
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @wynged)
Elements/src/Door.cs
line 207 at r1 (raw file):
Previously, anthonie-kramer (Anthonie Kramer) wrote…
Added a comment to the notion doc... Let me know if you want to discuss the solution in more detail and we can start building out a standard approach.
Added a storage class and provided some additional updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one things needs to be renamed :)
Reviewed 7 of 8 files at r3, 10 of 10 files at r4, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @anthonie-kramer)
Elements/src/BIM/Door/DoorRepresentationStorage.cs
line 9 at r4 (raw file):
static class DoorRepresentationStorage { private static readonly Dictionary<string, List<RepresentationInstance>> _fittings = new Dictionary<string, List<RepresentationInstance>>();
rename to not be _fittings
Elements/src/Door.cs
line 207 at r1 (raw file):
Previously, anthonie-kramer (Anthonie Kramer) wrote…
Added a storage class and provided some additional updates.
done lgtm
There was a problem hiding this 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 @wynged)
Elements/src/BIM/Door/DoorRepresentationStorage.cs
line 9 at r4 (raw file):
Previously, wynged (Eric Wassail) wrote…
rename to not be _fittings
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! 1 of 1 approvals obtained
BACKGROUND:
DESCRIPTION:
TESTING:
https://hypar.io/workflows/46428205-afdf-41bd-af52-4624c8e9f88e?view=b09eebe9-9857-4fcf-92e4-e4173e928289
FUTURE WORK:
REQUIRED:
CHANGELOG.md
.COMMENTS:
This change is