Background
As part of the viewDetails in a 3D saved view, there's a modelClipGroups property that contains an array of clipVectors (referred to as clip in core).
The clipVectors/clip array can contain both planes and shapes types.
Current Behavior
For planes (ClipPrimitivePlaneProps), our API requires a value for clips to be valid. If the clips value is undefined, the plane is filtered out and not included in the clipVectors array. This filtering occurs in:
Question
Should we also filter out planes that have a valid but empty array for clips (i.e., clips: []), similar to how we currently filter out planes with undefined clips?
Investigation
The original need to filter out planes with undefined clips likely stems from our saved view API making clips a required property, whereas in core it appears to be optional/potentially undefined.
However, core's implementation appears to accept empty arrays without issue.
Arguments for filtering empty arrays:
- Reduces data payload in saved views (which may have been the original motivation for making
clips required)
- From a graphics perspective, a plane without any clip data doesn't make logical sense
Arguments against filtering empty arrays:
- Core technically allows it
- Introduces unnecessary risk with no clear benefit
- Behavior change could have unintended impacts
Conclusion
Recommendation: Maintain current behavior without modification.
- Continue filtering planes with
undefined clips values
- Allow planes with empty
clips arrays (clips: []) to remain in the clipVectors
For the e2e test in question:
- Verify that planes with
undefined clips are properly filtered out
- Allow planes with empty clips arrays to exist without being filtered
This preserves existing behavior when extracting plane information from legacy saved views while avoiding unnecessary risk from behavioral changes.
Background
As part of the
viewDetailsin a 3D saved view, there's amodelClipGroupsproperty that contains an array ofclipVectors(referred to asclipin core).The
clipVectors/cliparray can contain bothplanesandshapestypes.Current Behavior
For planes (
ClipPrimitivePlaneProps), our API requires a value forclipsto be valid. If theclipsvalue is undefined, the plane is filtered out and not included in the clipVectors array. This filtering occurs in:Question
Should we also filter out planes that have a valid but empty array for
clips(i.e.,clips: []), similar to how we currently filter out planes withundefinedclips?Investigation
The original need to filter out planes with undefined
clipslikely stems from our saved view API makingclipsa required property, whereas in core it appears to be optional/potentially undefined.However, core's implementation appears to accept empty arrays without issue.
Arguments for filtering empty arrays:
clipsrequired)Arguments against filtering empty arrays:
Conclusion
Recommendation: Maintain current behavior without modification.
undefinedclips valuesclipsarrays (clips: []) to remain in the clipVectorsFor the e2e test in question:
undefinedclips are properly filtered outThis preserves existing behavior when extracting plane information from legacy saved views while avoiding unnecessary risk from behavioral changes.