Skip to content
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

feat: add chamfer tool #1495

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

feat: add chamfer tool #1495

wants to merge 8 commits into from

Conversation

jonahrb
Copy link
Contributor

@jonahrb jonahrb commented Oct 18, 2024

Description

Create chamfer on an edge, or adjust the chamfer of a face. This is available on Linux via the CoreService. Created "pull_tools" to house all the incoming geometry commands that will all be available on windows+linux.

Issue linked

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)

@jonahrb jonahrb requested a review from a team as a code owner October 18, 2024 20:15
@jonahrb jonahrb self-assigned this Oct 18, 2024
@github-actions github-actions bot added the enhancement New features or code improvements label Oct 18, 2024
Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

Looks good at first sight. Again, I would initiate a "Pull tools" example module to host how to use them. We need examples for all these new features.

src/ansys/geometry/core/modeler.py Outdated Show resolved Hide resolved
src/ansys/geometry/core/designer/edge.py Show resolved Hide resolved
src/ansys/geometry/core/designer/body.py Outdated Show resolved Hide resolved
src/ansys/geometry/core/tools/pull_tools.py Outdated Show resolved Hide resolved
src/ansys/geometry/core/tools/pull_tools.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the maintenance Package and maintenance related label Oct 22, 2024
Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

LGTM @jonahrb! However, we are having some issues with the Docker images as you might have seen. Hope to see this merged soon. I'll leave it approved!

Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

Ah wait - documentation example is missing. I'll leave the approval for whenever that's done

@jonahrb
Copy link
Contributor Author

jonahrb commented Oct 22, 2024

Ah wait - documentation example is missing. I'll leave the approval for whenever that's done

@RobPasMue yes working on that now :)

@jonahrb jonahrb requested a review from PipKat as a code owner October 23, 2024 16:50
Comment on lines +61 to +65
----------
edges_or_faces : Edge | List[Edge] | Face | List[Face]
Edge(s) or face(s) to act on.
distance : Real
Chamfer distance.
Copy link
Contributor

Choose a reason for hiding this comment

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

@jonahrb @RobPasMue . Should we also have a parameter named angle?
As it is, are we assuming that the angle will always be 45deg?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it add to much complexity and that is why we don't expose such parameters.

Copy link
Member

Choose a reason for hiding this comment

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

I'll leave it to @jonahrb to decide - implementing the angle operation might imply some math but I agree it would be useful. I would expose it via 2 independent methods chamfer_by_distance and chamfer_by_angle.

---

# Modeling: Chamfer edges and faces
A chamfer is an angled cut on an edge. Chamfers can be created through the `Modeler.pull_tools` module.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A chamfer is an angled cut on an edge. Chamfers can be created through the `Modeler.pull_tools` module.
A chamfer is an angled cut on an edge. Chamfers can be created using the ``Modeler.pull_tools`` module.

Single backtick formats as italic. We need to use double backticks to format as a code entity.

```

## Chamfer faces
The chamfer of a face can also be modified. Create a chamfer on a single edge, then modify the chamfer distance value by providing the newly created face that represents the chamfer.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The chamfer of a face can also be modified. Create a chamfer on a single edge, then modify the chamfer distance value by providing the newly created face that represents the chamfer.
The chamfer of a face can also be modified. Create a chamfer on a single edge and then modify the chamfer distance value by providing the newly created face that represents the chamfer.



class PullTools:
"""Pull tools for PyAnsys Geometry.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"""Pull tools for PyAnsys Geometry.
"""Provides pull tools for PyAnsys Geometry.

Class descriptions should begin with a verb ending in "s" or "es"


@protect_grpc
def __init__(self, grpc_client: GrpcClient):
"""Initialize pull tools class."""
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"""Initialize pull tools class."""
"""Initialize an instance of the ``PullTools`` class."""

Parameters
----------
edges_or_faces : Edge | List[Edge] | Face | List[Face]
Edge(s) or face(s) to act on.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Edge(s) or face(s) to act on.
One or more edges or faces to act on.

Avoid using (s) construction.

Returns
-------
bool
Success of chamfer command.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Success of chamfer command.
``True`` when successful, ``False`` when failed.

This is our standard verbiage for a Boolean return value.

Copy link
Member

@PipKat PipKat left a comment

Choose a reason for hiding this comment

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

Minor edits suggested on doc content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements maintenance Package and maintenance related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants