Skip to content

DynamoDS/DYN-10524: [Kiln Test] Add missing XML doc comments to GeometryExtension methods#17135

Closed
eamiri wants to merge 3 commits into
masterfrom
10524-add-geometry-xml-docs
Closed

DynamoDS/DYN-10524: [Kiln Test] Add missing XML doc comments to GeometryExtension methods#17135
eamiri wants to merge 3 commits into
masterfrom
10524-add-geometry-xml-docs

Conversation

@eamiri

@eamiri eamiri commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Closes https://autodesk.atlassian.net/browse/DYN-10524

h1. Add XML Doc Comments to Rect2D Geometry Methods — Implementation Plan

h2. Overview

Add {{

}} / {{}} / {{}} XML doc comments to three public geometry methods on {{Dynamo.Utilities.Rect2D}} that are part of the shipped public API but are currently undocumented: {{Contains(Rect2D)}}, {{IntersectsWith(Rect2D)}}, and {{Intersect(Rect2D)}}. Documentation-only change — no behavior, no public API surface, no tests are touched.

h2. Current State Analysis

h3. Key Discoveries

  • All three target methods live in {{src/DynamoUtilities/Rect2D.cs}} and are listed in {{src/DynamoUtilities/PublicAPI.Shipped.txt:79, 83, 84}} — they are part of the shipped consumer-facing surface.
  • {{PublicAPI.Unshipped.txt}} for {{DynamoUtilities}} has no relevant entries; nothing needs to be added or moved.
  • The file uses mixed indentation: line 66 ({{Contains(Rect2D)}}) uses tab indentation; lines 79 ({{IntersectsWith}}) and 85 ({{Intersect(Rect2D)}}) use 4-space indentation (8 spaces at body depth). Each XML doc block must match the indentation of the method below it.
  • File is UTF-8 with BOM. Preserve BOM and existing line endings exactly ({{CLAUDE.md}} rule on line endings).
  • Style to match: plain {{}} / {{}} / {{}} with no {{}} tag (these are not zero-touch nodes).

h3. Behavior the docs must capture (verified from source)

  • {{Contains(Rect2D)}} at {{Rect2D.cs:66-77}}: returns {{true}} iff the argument's {{Left/Right/Top/Bottom}} lie within this rectangle's {{Left/Right/Top/Bottom}}. Boundary-inclusive (uses {{<}} and {{>}}, not {{<=}} / {{>=}}), so a rectangle that shares an edge with this one still counts as contained.
  • {{IntersectsWith(Rect2D)}} at {{Rect2D.cs:79-83}}: returns {{true}} iff the rectangles overlap with non-zero area. Touching-only edges return {{false}} because the test uses strict {{>=}} / {{<=}}.
  • {{Intersect(Rect2D)}} at {{Rect2D.cs:85-104}}: mutates this rectangle to the intersection. If there is no overlap, this rectangle becomes the {{Empty}} sentinel ({{X = Y = +∞}}, {{Width = Height = −∞}}).

h2. Desired End State

  • The three target methods on {{Rect2D}} each have a complete XML doc block ({{}} + one {{}} per parameter + {{}} for value-returning members, or nothing for {{void}}).
  • {{dotnet build src/DynamoCore.sln -c Release}} succeeds with no new warnings (no CS1591 "missing XML comment" warnings introduced or revealed by the change).
  • {{git diff}} shows changes only inside {{src/DynamoUtilities/Rect2D.cs}}, and only as added {{///}} lines above the three target methods.
  • {{PublicAPI.Shipped.txt}} and {{PublicAPI.Unshipped.txt}} are unchanged.

h2. What We're NOT Doing

  • Not documenting any other undocumented member on {{Rect2D}} (e.g. {{Contains(double, double)}}, {{Contains(Point2D)}}, the static {{Intersect(Rect2D, Rect2D)}} overload, {{Scale}}, {{Empty}}, {{IsEmpty}}, constructors, properties, {{Equals}}, {{GetHashCode}}, {{ToString}}). The ticket calls for 2–3 methods — we stop at three.
  • Not touching {{Point2D.cs}} or any other file. Single-file change.
  • Not fixing the {{GetHashCode() => throw new NotImplementedException()}} bug at {{Rect2D.cs:61}}. Out of scope; file separately.
  • Not modifying {{PublicAPI.Shipped.txt}} / {{PublicAPI.Unshipped.txt}}. The members are already shipped; adding XML docs does not change the API surface.
  • Not adding, removing, or modifying any test.
  • Not reformatting the file's mixed indentation. Preserve the existing tabs/spaces exactly.
  • Not converting line endings or stripping the UTF-8 BOM.

h2. Implementation Approach

One file, three insertions, in a single commit. For each method, insert a {{///}}-prefixed XML doc block immediately above the method signature, using the same indentation as the method's signature line. Run a Release build to confirm there are no new warnings, then commit. No tests required; this is a doc-only change.


h3. TASK 1: Document {{Rect2D.Contains(Rect2D rect)}} [HIGH PRIORITY]

Status: DONE
Milestone: Method at {{Rect2D.cs:66}} has a complete, correctly indented XML doc block describing rect-in-rect containment, including the boundary-inclusive semantics.

  • Open {{src/DynamoUtilities/Rect2D.cs}}.
  • Insert the XML doc block immediately above line 66 using tab indentation (matching the existing line).
  • Verify indentation by visual diff (tabs, not spaces).
  • Save with UTF-8 BOM preserved and original line endings preserved.

Validation:

  • {{git diff src/DynamoUtilities/Rect2D.cs}} shows only added {{///}} lines directly above the {{Contains(Rect2D rect)}} signature.
  • {{dotnet build src/DynamoCore.sln -c Release}} succeeds with no new warnings related to this file.

Requirements from spec:

  • AC1: "At least 2 public methods have complete XML doc comments added" — contributes 1 of 3.
  • AC2: "Comments follow the existing style in the codebase" — uses plain {{}}/{{}}/{{}}.
  • AC3: "No functional changes — doc comments only."

Files to Modify:

  • {{src/DynamoUtilities/Rect2D.cs}} — add a {{///}}-block above line 66.

Implementation Details:

Exact block to insert (tab-indented to match line 66):

{noformat} ///


/// Determines whether the specified rectangle is entirely contained within this rectangle.
///

/// The rectangle to test for containment.
/// true if every point of lies within or on the boundary of this rectangle; otherwise, false.{noformat}


h3. TASK 2: Document {{Rect2D.IntersectsWith(Rect2D rect)}} [HIGH PRIORITY]

Status: DONE
Milestone: Method at {{Rect2D.cs:79}} has a complete, correctly indented XML doc block describing the boolean intersection test and the touching-edges-return-false semantics.

  • Insert the XML doc block immediately above line 79 using 4-space indentation (8 spaces at this depth — matching the existing line).
  • Verify indentation by visual diff (spaces, not tabs).
  • Save with UTF-8 BOM preserved and original line endings preserved.

Validation:

  • {{git diff src/DynamoUtilities/Rect2D.cs}} shows only added {{///}} lines directly above the {{IntersectsWith(Rect2D rect)}} signature.
  • {{dotnet build src/DynamoCore.sln -c Release}} succeeds with no new warnings.

Requirements from spec: AC1, AC2, AC3 (as in TASK 1).

Files to Modify:

  • {{src/DynamoUtilities/Rect2D.cs}} — add a {{///}}-block above line 79.

Implementation Details:

Exact block to insert (8-space-indented to match line 79):

{noformat} ///


/// Indicates whether this rectangle overlaps with the specified rectangle.
///

/// The rectangle to test for overlap.
/// true if the two rectangles share at least one interior point; otherwise, false. Rectangles that only touch along an edge (zero overlap area) are not considered intersecting.{noformat}


h3. TASK 3: Document {{Rect2D.Intersect(Rect2D rect)}} [HIGH PRIORITY]

Status: NOT STARTED
Milestone: Method at {{Rect2D.cs:85}} has a complete, correctly indented XML doc block describing in-place mutation and the {{Empty}} sentinel produced when the rectangles do not overlap.

  • Insert the XML doc block immediately above line 85 using 4-space indentation (8 spaces at this depth).
  • Verify indentation by visual diff.
  • Save with UTF-8 BOM preserved and original line endings preserved.

Validation:

  • {{git diff src/DynamoUtilities/Rect2D.cs}} shows only added {{///}} lines directly above the {{Intersect(Rect2D rect)}} signature.
  • {{dotnet build src/DynamoCore.sln -c Release}} succeeds with no new warnings.

Requirements from spec: AC1, AC2, AC3 (as in TASK 1). Method returns {{void}}, so no {{}} element.

Files to Modify:

  • {{src/DynamoUtilities/Rect2D.cs}} — add a {{///}}-block above line 85.

Implementation Details:

Exact block to insert (8-space-indented to match line 85):

{noformat} ///


/// Mutates this rectangle in place to the intersection of itself and the specified rectangle.
/// If the two rectangles do not overlap, this rectangle becomes .
///

/// The rectangle to intersect with this rectangle.{noformat}


h3. TASK 4: Build verification [HIGH PRIORITY]

Status: NOT STARTED
Milestone: Release build of the cross-platform core succeeds with no new warnings or errors introduced by this change.

  • Run {{dotnet restore src/DynamoCore.sln --runtime=win-x64 -p:Configuration=Release -p:DotNet=net10.0}}.
  • Run {{dotnet build src/DynamoCore.sln -c Release}} (or {{msbuild src/DynamoCore.sln /p:Configuration=Release}} on Windows).
  • Confirm no new CS1591 "missing XML comment" warnings appear and no warnings reference the edited file.
  • Inspect {{git status}} to confirm {{Rect2D.cs}} is the only modified file.
  • Inspect {{git diff}} to confirm only {{///}} lines were added and that BOM / line endings are preserved.

Validation:

  • Build exits with code 0.
  • {{git diff --stat}} shows exactly one file changed: {{src/DynamoUtilities/Rect2D.cs}}.
  • {{git diff --check}} reports no whitespace issues.

Requirements from spec: AC3: "No functional changes — doc comments only."

Files to Modify: (none — verification only)


h2. Testing Strategy

h3. Unit Tests

None. This is a documentation-only change; there is no behavior to assert. Repo policy and the "No functional changes" acceptance criterion both rule out adding tests here.

h3. Integration Tests

None, for the same reason.

h3. Manual Testing Steps

Open {{src/DynamoUtilities/Rect2D.cs}} in an IDE (Visual Studio / Rider / VS Code with C# extension).

Hover over a call site of {{Rect2D.Contains(Rect2D)}} — IntelliSense should display the new {{}} text.

Repeat for {{Rect2D.IntersectsWith(Rect2D)}} and {{Rect2D.Intersect(Rect2D)}}.

Run a Release build (see TASK 4 commands) and confirm a clean build.

{{git diff src/DynamoUtilities/Rect2D.cs}} should show only added {{///}} lines; no other lines should be touched.

{{git diff src/DynamoUtilities/PublicAPI.Shipped.txt src/DynamoUtilities/PublicAPI.Unshipped.txt}} should be empty.

h2. Performance Considerations

None. XML doc comments are compile-time metadata; no runtime impact.

h2. Migration Notes

None. No public API surface changes, no consumer code changes, no data migration.

eamiri added 2 commits June 2, 2026 23:14
Added complete XML documentation to three geometry-related utility methods:
- BoundaryConditionFromString in ProtoGeometryHelper
- PopulateItemsCore in PanelSurfaceBoundaryConditions
- ByParametersOnSurface in Voronoi

All methods now include <summary>, <param>, and <returns> tags
consistent with existing code style.
@eamiri eamiri added the kiln Created by kiln label Jun 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10524

Add XML doc comments to the Contains(Rect2D) public API method
describing rect-in-rect containment with boundary-inclusive semantics.
@eamiri eamiri closed this Jun 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kiln Created by kiln

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant