Skip to content

Commit

Permalink
Added tags, added Documentation.md, modified README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mprinkezs committed Jul 18, 2024
1 parent 8074eb2 commit 88f74e4
Show file tree
Hide file tree
Showing 46 changed files with 935 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ScriptedActualCircle

![Scripted circle element example](scripted_actual_circle.png)

This is an example for a scripted 'circle' element.

```{note}
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


## Source code excerpt

```{code-block} python
---
linenos:
---
def dialog(context, params):
#[...]
def calculation(context, params):
valid_results = False
# Calculating all available stages
for stage in context.stages:
# Access element properties with error handling
try:
context.result[stage] = {
'center': (params['center_x'], params['center_y'], params['center_z']),
'direction': (params['dir_x'], params['dir_y'], params['dir_z']),
'radius': params['radius']
}
context.data[stage] = {"ude_mykey": "Example 2"}
except Exception as error:
context.error[stage] = str(error)
else:
valid_results = True
return valid_results
```

## Related

* [Scripted actuals - Circle](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#circle)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"circle", "scripted-actual"
],
"title": "ScriptedActualCircle",
"uuid": "26eacb0d-2046-4757-9b16-0df005eb62b7",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ScriptedActualCone

![Scripted cone element example](scripted_actual_cone.png)

This is an example for a scripted 'cone' element.

```{caution}
Due to the internal represenstation of a Cone Element, the direction of the vector `point1` -> `point2` is always from the smaller to the larger circle (`radius1` < `radius2`).
If you specify `radius1` > `radius2` in the creation parameters, [`point1`; `radius1`] and [`point2`; `radius2`] are swapped automatically.
```

```{note}
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


## Source code excerpt

```{code-block} python
---
linenos:
---
def dialog(context, params):
#[...]
def calculation(context, params):
valid_results = False
# Calculating all available stages
for stage in context.stages:
# Access element properties with error handling
try:
context.result[stage] = {'default': {
'point1': gom.Vec3d(params['p1_x'], params['p1_y'], params['p1_z']),
'radius1': params['radius_1'],
'point2': gom.Vec3d(params['p2_x'], params['p2_y'], params['p2_z']),
'radius2': params['radius_2']
}}
context.data[stage] = {"ude_mykey": "Example 6"}
except Exception as error:
context.error[stage] = str(error)
else:
valid_results = True
return valid_results
```

## Related

* [Scripted actuals - Cone](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#cone)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"cone", "scripted-actual"
],
"title": "ScriptedActualCone",
"uuid": "8174c7e9-52de-4c18-9723-1d0f3ae66607",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# ScriptedActualCurve

![Scripted curve element example](scripted_actual_curve.png)

This is an example for a scripted 'curve' element. A parametric function is used to create a 3-dimensional curve - a helix - with a fixed number of points. `np.arange()` is used to iterate from `t_min` to `t_max` with a non-integer step size.

```{note}
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


## Source code excerpt

```{code-block} python
---
linenos:
---
import math
import numpy as np
def dialog(context, params):
#[...]
def calculation(context, params):
valid_results = False
# Calculating all available stages
for stage in context.stages:
# Access element properties with error handling
try:
# Creating a list of points using a parametric curve function:
# P(t) = ( x0 + (j * t + r) * cos(t), y0 + (j * t + r) * cos(t), z0 + k * t )
# with t in [t_min...t_max], 1000 steps
points = []
for t in np.arange(params['t_min'], params['t_max'], (params['t_max'] - params['t_min']) / 1000):
points.append((params['x0'] + (params['j'] * t + params['radius']) * math.cos(t),
params['y0'] + (params['j'] * t + params['radius']) * math.sin(t),
params['z0'] + params['k'] * t)
)
context.result[stage] = [{'points': points}]
context.data[stage] = {"ude_mykey": "Example 3"}
except Exception as error:
context.error[stage] = str(error)
else:
valid_results = True
return valid_results
```

## Related

* [Scripted actuals - Curve](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#curve)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"curve", "scripted-actual"
],
"title": "ScriptedActualCurve",
"uuid": "c1c0e973-0ca3-4aec-9909-0bef808b2dbc",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ScriptedActualCylinder

![Scripted cylinder element example](scripted_actual_cylinder.png)

This is an example for a scripted 'cylinder' element.

```{note}
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


## Source code excerpt

```{code-block} python
---
linenos:
---
def dialog(context, params):
#[...]
def calculation(context, params):
valid_results = False
# Calculating all available stages
for stage in context.stages:
# Access element properties with error handling
try:
# point = gom.Vec3d(params['point_x'], params['point_y'], params['point_z'])
# direction = gom.Vec3d(params['dir_x'], params['dir_y'], params['dir_z'])
context.result[stage] = {'default': {
'point': gom.Vec3d(params['point_x'], params['point_y'], params['point_z']),
'radius': params['radius'],
'direction': gom.Vec3d(params['dir_x'], params['dir_y'], params['dir_z']),
'inner': params['inner']
}}
context.data[stage] = {"ude_mykey": "Example 5"}
except Exception as error:
context.error[stage] = str(error)
else:
valid_results = True
return valid_results
```

## Related

* [Scripted actuals - Cylinder](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#cylinder)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"cylinder", "scripted-actual"
],
"title": "ScriptedActualCylinder",
"uuid": "3afe4b3c-97b5-49de-b20e-3f4ac9ddf814",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# distance
# ScriptedActualPoint

![Scripted distance element example](distance.png)

This is an example for a scripted 'distance' element.

```{note}
Please see [offset_point_v2.md](offset_point_v2.md) for a complete scripted elements example with detailed description.
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


Expand Down Expand Up @@ -40,5 +40,5 @@ def calculation(context, params):

## Related

* [Scripted actuals - Distance](../../python_api/scripted_elements_api.md#distance)
* [How-to: User-defined dialogs](../../howtos/python_api_introduction/user_defined_dialogs.md)
* [Scripted actuals - Distance](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#distance)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"distance", "scripted-actual"
],
"title": "ScriptedActualDistance",
"uuid": "e355ce61-6e17-45f5-bcd2-3495aabef37d",
"version": "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# ScriptedActualPointCloud

![Scripted point cloud element example](scripted_actual_point_cloud.png)

This is an example for a scripted 'point cloud' element. A parametric function is used to define the points, in this case the surface points of a torus. `np.arange()` is used to iterate from `u_min` to `u_max` and from `v_min` to `v_max` with non-integer step sizes. The step sizes `u_steps` and `v_steps` define the point density.

```{note}
Please see [ScriptedActualPoint](https://github.com/ZEISS/zeiss-inspect-app-examples/blob/dev/AppExamples/scripted_actuals/ScriptedActualPoint/doc/Documentation.md) for a complete scripted elements example with detailed description.
```


## Source code excerpt

```{code-block} python
---
linenos:
---
def dialog(context, params):
#[...]
def calculation(context, params):
valid_results = False
# Calculating all available stages
for stage in context.stages:
# Access element properties with error handling
try:
# Creating a list of points using a parametric curve function:
# / (R+r*cos(v))*cos(u) \
# P(u, v) = | (R+r*cos(v))*sin(u) |
# \ r*sin(v) /
# with u in [u_min...u_max], v in [v_min...v_max]
points = []
for u in np.arange(params['u_min'], params['u_max'], (params['u_max'] - params['u_min']) / params['u_steps']):
for v in np.arange(params['v_min'], params['v_max'], (params['v_max'] - params['v_min']) / params['v_steps']):
p = gom.Vec3d(
(params['R'] + params['r'] * math.cos(v * math.pi)) * math.cos(u * math.pi),
(params['R'] + params['r'] * math.cos(v * math.pi)) * math.sin(u * math.pi),
params['r'] * math.sin(v * math.pi)
)
points.append(p)
context.result[stage] = {'points': points}
context.data[stage] = {"ude_mykey": "Example 9"}
except Exception as error:
context.error[stage] = str(error)
else:
valid_results = True
return valid_results
```

## Related

* [Scripted actuals - Point cloud](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/python_api/scripted_elements_api.md#point-cloud)
* [How-to: User-defined dialogs](https://zeissiqs.github.io/zeiss-inspect-addon-api/2025/howtos/python_api_introduction/user_defined_dialogs.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"software-revision": "0000",
"software-version": "ZEISS INSPECT 2025",
"tags": [],
"tags": [
"point-cloud", "scripted-actual"
],
"title": "ScriptedActualPointCloud",
"uuid": "a6d289ff-3ff2-4369-9698-d768861eb2ed",
"version": "1.0.0"
Expand Down
Loading

0 comments on commit 88f74e4

Please sign in to comment.