Skip to content

Commit

Permalink
feat: blitz development (#1701)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonah Boling <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Umut Soysal <[email protected]>
Co-authored-by: Ryan Ward <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: jonahrb <[email protected]>
Co-authored-by: Jacob Kerstetter <[email protected]>
Co-authored-by: jkerstet <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
Co-authored-by: MikeJanes <[email protected]>
Co-authored-by: Michael Janes <[email protected]>
Co-authored-by: David Gorman <[email protected]>
Co-authored-by: Matteo Bini <[email protected]>
Co-authored-by: Mike Kaplan <[email protected]>
Co-authored-by: smereu <[email protected]>
Co-authored-by: rward <[email protected]>
Co-authored-by: Mike Kaplan <[email protected]>
  • Loading branch information
18 people authored Jan 29, 2025
1 parent c5d5426 commit 695b425
Show file tree
Hide file tree
Showing 81 changed files with 4,732 additions and 94 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/1621.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create a fillet on an edge/face
1 change: 1 addition & 0 deletions doc/changelog.d/1623.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create a full fillet between multiple faces
1 change: 1 addition & 0 deletions doc/changelog.d/1628.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extrude existing faces, setup face offset relationships
1 change: 1 addition & 0 deletions doc/changelog.d/1633.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
interference repair tool
1 change: 1 addition & 0 deletions doc/changelog.d/1638.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extrude existing edges to create surface bodies
1 change: 1 addition & 0 deletions doc/changelog.d/1641.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create and modify linear patterns
1 change: 1 addition & 0 deletions doc/changelog.d/1643.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
body suppression state
1 change: 1 addition & 0 deletions doc/changelog.d/1645.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add more find and fix tests for repair tools
1 change: 1 addition & 0 deletions doc/changelog.d/1647.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
parameters refurbished
1 change: 1 addition & 0 deletions doc/changelog.d/1648.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rename object
1 change: 1 addition & 0 deletions doc/changelog.d/1650.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
surface body from trimmed curves
1 change: 1 addition & 0 deletions doc/changelog.d/1653.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create circular and fill patterns
1 change: 1 addition & 0 deletions doc/changelog.d/1661.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find fix simplify
1 change: 1 addition & 0 deletions doc/changelog.d/1664.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replace face
1 change: 1 addition & 0 deletions doc/changelog.d/1665.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commands for merge and intersect
1 change: 1 addition & 0 deletions doc/changelog.d/1666.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
revolve faces a set distance, up to another object, or by a helix
1 change: 1 addition & 0 deletions doc/changelog.d/1669.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add split body and tests
1 change: 1 addition & 0 deletions doc/changelog.d/1670.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add some new tests
1 change: 1 addition & 0 deletions doc/changelog.d/1671.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable get/set persistent ids for stride import/export
1 change: 1 addition & 0 deletions doc/changelog.d/1672.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find and fix edge methods
1 change: 1 addition & 0 deletions doc/changelog.d/1673.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shell methods
1 change: 1 addition & 0 deletions doc/changelog.d/1675.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation of NURBS curves
1 change: 1 addition & 0 deletions doc/changelog.d/1677.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump ansys api geometry from 0.4.30 to 0.4.32
1 change: 1 addition & 0 deletions doc/changelog.d/1680.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ensure design is closed on test exit
1 change: 1 addition & 0 deletions doc/changelog.d/1683.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add unit tests for 3 repair tools
1 change: 1 addition & 0 deletions doc/changelog.d/1684.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get assigned material
1 change: 1 addition & 0 deletions doc/changelog.d/1685.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filter set export id to only CoreService based backends
1 change: 1 addition & 0 deletions doc/changelog.d/1689.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
matrix rotation and translation
1 change: 1 addition & 0 deletions doc/changelog.d/1690.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cleanup unsupported module
1 change: 1 addition & 0 deletions doc/changelog.d/1698.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export and download stride format
1 change: 1 addition & 0 deletions doc/changelog.d/1701.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blitz development
1 change: 1 addition & 0 deletions doc/changelog.d/1703.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tech review fixes for blitz branch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ def get_wheelhouse_assets_dictionary():
if assets_context_version == "dev":
prefix_url = "https://github.com/ansys/pyansys-geometry/releases/latest/download"
else:
prefix_url = (
f"https://github.com/ansys/pyansys-geometry/releases/download/{assets_context_version}",
)
prefix_url = f"https://github.com/ansys/pyansys-geometry/releases/download/{assets_context_version}"
temp_dict = {
"os": assets_os,
"runner": assets_runner,
Expand Down Expand Up @@ -310,6 +308,7 @@ def intersphinx_pyansys_geometry(switcher_version: str):
"examples/03_modeling/design_tree": "_static/thumbnails/design_tree.png",
"examples/03_modeling/service_colors": "_static/thumbnails/service_colors.png",
"examples/03_modeling/surface_bodies": "_static/thumbnails/quarter_sphere.png",
"examples/03_modeling/design_parameters": "_static/thumbnails/block_with_parameters.png",
"examples/03_modeling/chamfer": "_static/thumbnails/chamfer.png",
"examples/04_applied/01_naca_airfoils": "_static/thumbnails/naca_airfoils.png",
"examples/04_applied/02_naca_fluent": "_static/thumbnails/naca_fluent.png",
Expand Down
1 change: 1 addition & 0 deletions doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ These examples demonstrate service-based modeling operations.
examples/03_modeling/design_tree.mystnb
examples/03_modeling/service_colors.mystnb
examples/03_modeling/surface_bodies.mystnb
examples/03_modeling/design_parameters.mystnb
examples/03_modeling/chamfer.mystnb

Applied examples
Expand Down
3 changes: 2 additions & 1 deletion doc/source/examples/03_modeling/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.scdocx
*.scdocx
*.dsco
2 changes: 0 additions & 2 deletions doc/source/examples/03_modeling/boolean_operations.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ This example shows how to use Boolean operations for geometry manipulation.
Perform the required imports.

```{code-cell} ipython3
from typing import List

from ansys.geometry.core import launch_modeler
from ansys.geometry.core.designer import Body
from ansys.geometry.core.math import Point2D
Expand Down
146 changes: 146 additions & 0 deletions doc/source/examples/03_modeling/design_parameters.mystnb
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
jupytext:
text_representation:
extension: .mystnb
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

# Modeling: Using design parameters

You can read and update parameters that are part of the design.
The simple design in this example has two associated parameters.

+++

## Perform required imports

```{code-cell} ipython3
from pathlib import Path
import requests

from ansys.geometry.core import launch_modeler
```

The file for this example is in the integration tests folder and can be downloaded.

+++

## Download the example file

+++

Download the file for this example from the integration tests folder in the PyAnsys Geometry repository.

```{code-cell} ipython3
def download_file(url, filename):
"""Download a file from a URL and save it to a local file."""
response = requests.get(url)
response.raise_for_status() # Check if the request was successful
with open(filename, 'wb') as file:
file.write(response.content)

# URL of the file to download
url = "https://raw.githubusercontent.com/ansys/pyansys-geometry/main/tests/integration/files/blockswithparameters.dsco"

# Local path to save the file to
file_path = Path.cwd() / "blockswithparameters.dsco"

# Download the file
download_file(url, file_path)
print(f"File is downloaded to {file_path}")
```

## Import a design with parameters

+++

Import the model using the ``open_file()`` method of the modeler.

```{code-cell} ipython3
# Create a modeler object
modeler = launch_modeler()
design = modeler.open_file(file_path)
design.plot()
```

## Read existing parameters of the design

You can get all the parameters of the design as a list of parameters. Because this
example has two parameters, you see two items in the list.

```{code-cell} ipython3
my_parameters = design.parameters
print(len(my_parameters))
```

A parameter object has a name, value, and unit.

```{code-cell} ipython3
print(my_parameters[0].name)
print(my_parameters[0].dimension_value)
print(my_parameters[0].dimension_type)

print(my_parameters[1].name)
print(my_parameters[1].dimension_value)
print(my_parameters[1].dimension_type)
```

Parameter values are returned in the default unit for each dimension type. Since default length
unit is meter and default area unit is meter square, the value is returned in square meters.

+++

## Edit a parameter value

You can edit the parameter's name or value by simply setting these fields.
Set the second parameter (p2 value to 350 mm).

```{code-cell} ipython3
parameter1 = my_parameters[1]
parameter1.dimension_value = 0.000440
response = design.set_parameter(parameter1)
print(response)
print(my_parameters[0].dimension_value)
print(my_parameters[1].dimension_value)
```

After a successful parameter update, the design is updated. If we request the design
plot again, we see the updated design.

```{code-cell} ipython3
design.plot()
```

The ``set_parameter()`` method returns a ``Success`` status message if the parameter is updated or
a "FAILURE" status message if the update fails. If the ``p2`` parameter depends on the ``p1``
parameter, updating the ``p1`` parameter might also change the ``p2`` parameter. In such cases,
the method returns ``CONSTRAINED_PARAMETERS``, which indicates other parameters were also updated.

```{code-cell} ipython3
parameter1 = my_parameters[0]
parameter1.dimension_value = 0.000250
response = design.set_parameter(parameter1)
print(response)
```

To get the updated list, query the parameters once again.

```{code-cell} ipython3
my_parameters = design.parameters
print(my_parameters[0].dimension_value)
print(my_parameters[1].dimension_value)
```

## Close the modeler

Close the modeler to free up resources and release the connection.

```{code-cell} ipython3
modeler.close()
```
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies = [
"ansys-tools-visualization-interface>=0.2.6,<1",
"attrs!=24.3.0",
"beartype>=0.11.0,<0.20",
"geomdl>=5,<6",
"grpcio>=1.35.0,<1.68",
"grpcio-health-checking>=1.45.0,<1.68",
"numpy>=1.20.3,<3",
Expand All @@ -54,6 +55,7 @@ tests = [
"ansys-tools-visualization-interface==0.8.1",
"beartype==0.19.0",
"docker==7.1.0",
"geomdl==5.3.1",
"grpcio==1.67.1",
"grpcio-health-checking==1.67.1",
"numpy==2.2.2",
Expand Down Expand Up @@ -82,6 +84,7 @@ doc = [
"ansys-tools-visualization-interface==0.8.1",
"beartype==0.19.0",
"docker==7.1.0",
"geomdl==5.3.1",
"grpcio==1.67.1",
"grpcio-health-checking==1.67.1",
"ipyvtklink==0.2.3",
Expand Down
1 change: 1 addition & 0 deletions src/ansys/geometry/core/connection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
grpc_frame_to_frame,
grpc_matrix_to_matrix,
grpc_surface_to_surface,
line_to_grpc_line,
plane_to_grpc_plane,
point3d_to_grpc_point,
sketch_shapes_to_grpc_geometries,
Expand Down
Loading

0 comments on commit 695b425

Please sign in to comment.