Skip to content

Clarify handling of planes with empty vs undefined clips in modelClipGroups #178

@hnn0003

Description

@hnn0003

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions