-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tags, added Documentation.md, modified README.md
- Loading branch information
Showing
46 changed files
with
935 additions
and
20 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
AppExamples/scripted_actuals/ScriptedActualCircle/doc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Binary file added
BIN
+32.5 KB
AppExamples/scripted_actuals/ScriptedActualCircle/doc/scripted_actual_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
AppExamples/scripted_actuals/ScriptedActualCone/doc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Binary file added
BIN
+56 KB
AppExamples/scripted_actuals/ScriptedActualCone/doc/scripted_actual_cone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
AppExamples/scripted_actuals/ScriptedActualCurve/doc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Binary file added
BIN
+83.3 KB
AppExamples/scripted_actuals/ScriptedActualCurve/doc/scripted_actual_curve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
AppExamples/scripted_actuals/ScriptedActualCylinder/doc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Binary file added
BIN
+43.4 KB
...amples/scripted_actuals/ScriptedActualCylinder/doc/scripted_actual_cylinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
AppExamples/scripted_actuals/ScriptedActualPointCloud/doc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Binary file added
BIN
+238 KB
...s/scripted_actuals/ScriptedActualPointCloud/doc/scripted_actual_point_cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.