Skip to content

Commit

Permalink
Bug/fix documention (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-matteo authored Dec 15, 2023
1 parent aed0540 commit 6ce86c8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
30 changes: 27 additions & 3 deletions doc/source/user_guide/designer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,34 @@ Designer
The PyAnsys Geometry :class:`designer <ansys.geometry.core.designer>` subpackage organizes geometry assemblies
and synchronizes to a supporting Geometry service instance.

Create the model
----------------
This code create the :class:`Modeler() <ansys.geometry.core.modeler>` object which owns the whole designs
tools and data.

.. code:: python
from ansys.geometry.core import Modeler
# Create the modeler object itself
modeler = Modeler()
Define the model
----------------
The following code define the model by creating a sketch with a circle on the client.
It then creates the model on the server.

.. code:: python
from ansys.geometry.core.sketch import Sketch
from ansys.geometry.core.math import Point2D
from ansys.geometry.core.misc import UNITS
from pint import Quantity
# Create a sketch and draw a circle on the client
sketch = Sketch()
sketch.circle(Point3D([10, 10, 0], UNITS.mm), Quantity(10, UNITS.mm))
sketch.circle(Point2D([10, 10], UNITS.mm), Quantity(10, UNITS.mm))
# Create your design on the server
design_name = "ExtrudeProfile"
Expand All @@ -26,6 +44,12 @@ This code adds the data structure and properties for individual materials:

.. code:: python
from ansys.geometry.core.materials.material import Material
from ansys.geometry.core.materials.property import (
MaterialProperty,
MaterialPropertyType,
)
density = Quantity(125, 1000 * UNITS.kg / (UNITS.m * UNITS.m * UNITS.m))
poisson_ratio = Quantity(0.33, UNITS.dimensionless)
tensile_strength = Quantity(45)
Expand Down Expand Up @@ -71,7 +95,7 @@ The following code shows how to download and save the design.

.. code:: python
file = "path/to/download"
design.download(file, as_stream=False)
file = "path/to/download.scdocx"
design.download(file)
For more information, see the :class:`Design <ansys.geometry.core.designer.design>` submodule.
2 changes: 2 additions & 0 deletions doc/source/user_guide/primitives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ the 2D feature executes as expected:

.. code:: python
from ansys.geometry.core.math import Plane, Point3D, UnitVector3D
origin = Point3D([42, 99, 13])
plane = Plane(origin, UnitVector3D([1, 0, 0]), UnitVector3D([0, 1, 0]))
4 changes: 3 additions & 1 deletion doc/source/user_guide/shapes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ which take as a starting point the last point of the previous edge.

.. code:: python
from ansys.geometry.core.math import Point2D
sketch.segment_to_point(Point2D([3, 3]), "Segment2").segment_to_point(
Point2D([3, 2]), "Segment3"
)
Expand All @@ -48,7 +50,7 @@ of user-defined labels:

.. code:: python
sketch.get("<tag>")
sketch.get("Segment2")
.. jupyter-execute::
:hide-code:
Expand Down

0 comments on commit 6ce86c8

Please sign in to comment.