Skip to content

docs: add MeasurementTools example notebook#2639

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-example-for-measurement-tools
Open

docs: add MeasurementTools example notebook#2639
Copilot wants to merge 5 commits intomainfrom
copilot/add-example-for-measurement-tools

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

Adds a documentation example demonstrating MeasurementTools usage, following the existing RepairTools example pattern and the contributing guide's example conventions.

Changes

  • doc/source/examples/05_tools/measurement_tools.mystnb — New example notebook covering:
    • Measuring minimum distance between two Body objects
    • Measuring between Face objects (requires Ansys 25R2+)
    • Measuring between Edge objects (requires Ansys 25R2+)
  • doc/source/examples.rst — Added entry in "Tools examples" gallery; updated section description to mention MeasurementTools
  • doc/source/conf.py — Added thumbnail mapping for the new example
  • doc/source/_static/thumbnails/measurement_tools.png — Placeholder thumbnail

Usage

from ansys.geometry.core import launch_modeler
from ansys.geometry.core.math import UNITVECTOR3D_X, Point2D
from ansys.geometry.core.misc import UNITS
from ansys.geometry.core.sketch import Sketch

modeler = launch_modeler()
design = modeler.create_design("MeasurementToolsDemo")

sketch1 = Sketch().box(Point2D([0, 0], unit=UNITS.m), width=1 * UNITS.m, height=1 * UNITS.m)
box1 = design.extrude_sketch("Box1", sketch1, 1 * UNITS.m)

sketch2 = Sketch().box(Point2D([0, 0], unit=UNITS.m), width=1 * UNITS.m, height=1 * UNITS.m)
box2 = design.extrude_sketch("Box2", sketch2, 1 * UNITS.m)
box2.translate(UNITVECTOR3D_X, 3)

gap = modeler.measurement_tools.min_distance_between_objects(box1, box2)
print(f"Minimum distance: {gap.distance}")

modeler.close()

Issue linked

Closes #[issue number — linked automatically]

Checklist

  • I have tested my changes locally.
  • I have added necessary documentation or updated existing documentation.
  • I have followed the coding style guidelines of this project.
  • I have added appropriate unit tests.
  • I have reviewed my changes before submitting this pull request.
  • I have linked the issue or issues that are solved to the PR if any.
  • I have assigned this PR to myself.
  • I have added the minimum version decorator to any new backend method implemented.
  • I have made sure that the title of my PR follows Conventional commits style (e.g. feat: extrude circle to cylinder)
Original prompt

This section details on the original issue you should resolve

<issue_title>Create an example for MeasurementTools</issue_title>
<issue_description>Using the doc/source/contributing.rst file section on Adding examples, add an example for how to use the methods in the MeasurementTools class.

Use the example template in doc/source/examples/99_misc to guide you.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jacobrkerstetter <83893427+jacobrkerstetter@users.noreply.github.com>
Copilot AI changed the title [WIP] Add example usage for MeasurementTools class docs: add MeasurementTools example notebook Mar 11, 2026
@jacobrkerstetter jacobrkerstetter marked this pull request as ready for review March 11, 2026 19:34
@jacobrkerstetter jacobrkerstetter requested review from a team and PipKat as code owners March 11, 2026 19:34
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 11, 2026
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.87%. Comparing base (34a283c) to head (6708221).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2639   +/-   ##
=======================================
  Coverage   94.87%   94.87%           
=======================================
  Files         174      174           
  Lines       14559    14559           
=======================================
  Hits        13813    13813           
  Misses        746      746           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an example for MeasurementTools

4 participants