-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy documentation of '20240903-news-scripted-diagrams' to GitHub P…
…ages
- Loading branch information
Showing
396 changed files
with
38,089 additions
and
0 deletions.
There are no files selected for viewing
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,4 @@ | ||
# Sphinx build info version 1 | ||
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: fe80d32e0caabf5fb3b4f1ed543d5913 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file added
BIN
+42.5 KB
...ted-diagrams/.doctrees/howtos/adding_workspaces_to_apps/adding_workspaces_to_apps.doctree
Binary file not shown.
Binary file added
BIN
+23.3 KB
20240903-news-scripted-diagrams/.doctrees/howtos/app_documentation/app_documentation.doctree
Binary file not shown.
Binary file added
BIN
+7.53 KB
...903-news-scripted-diagrams/.doctrees/howtos/app_documentation/assets/Releasenotes.doctree
Binary file not shown.
Binary file added
BIN
+39.1 KB
20240903-news-scripted-diagrams/.doctrees/howtos/app_file_format/app_file_format.doctree
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+38.5 KB
20240903-news-scripted-diagrams/.doctrees/howtos/localization/localization.doctree
Binary file not shown.
Binary file added
BIN
+13.1 KB
20240903-news-scripted-diagrams/.doctrees/howtos/project_keywords/project_keywords.doctree
Binary file not shown.
Binary file added
BIN
+36 KB
...cripted-diagrams/.doctrees/howtos/python_api_introduction/creating_wizard_dialogs.doctree
Binary file not shown.
Binary file added
BIN
+19.6 KB
...-scripted-diagrams/.doctrees/howtos/python_api_introduction/file_selection_dialog.doctree
Binary file not shown.
Binary file added
BIN
+47 KB
...cripted-diagrams/.doctrees/howtos/python_api_introduction/python_api_introduction.doctree
Binary file not shown.
Binary file added
BIN
+33.1 KB
...ews-scripted-diagrams/.doctrees/howtos/python_api_introduction/selecting_elements.doctree
Binary file not shown.
Binary file added
BIN
+428 KB
...s-scripted-diagrams/.doctrees/howtos/python_api_introduction/user_defined_dialogs.doctree
Binary file not shown.
Binary file added
BIN
+11.2 KB
...scripted-diagrams/.doctrees/howtos/python_api_introduction/using_script_resources.doctree
Binary file not shown.
Binary file added
BIN
+26.3 KB
20240903-news-scripted-diagrams/.doctrees/howtos/scripted_elements/scripted_actuals.doctree
Binary file not shown.
Binary file added
BIN
+17.3 KB
20240903-news-scripted-diagrams/.doctrees/howtos/scripted_elements/scripted_checks.doctree
Binary file not shown.
Binary file added
BIN
+20.1 KB
...ripted-diagrams/.doctrees/howtos/scripted_elements/scripted_elements_introduction.doctree
Binary file not shown.
Binary file added
BIN
+10.1 KB
...pted-diagrams/.doctrees/howtos/scripted_elements/scripted_elements_noninteractive.doctree
Binary file not shown.
Binary file added
BIN
+3.95 KB
...3-news-scripted-diagrams/.doctrees/howtos/scripted_elements/scripted_elements_toc.doctree
Binary file not shown.
Binary file added
BIN
+17 KB
...-scripted-diagrams/.doctrees/howtos/scripted_elements/tokens_on_scripted_elements.doctree
Binary file not shown.
Binary file added
BIN
+24.7 KB
...ted-diagrams/.doctrees/howtos/scripting_legacy_projects/scripting_legacy_projects.doctree
Binary file not shown.
Binary file added
BIN
+40 KB
...3-news-scripted-diagrams/.doctrees/howtos/scripting_solutions/scripting_solutions.doctree
Binary file not shown.
Binary file added
BIN
+18.5 KB
20240903-news-scripted-diagrams/.doctrees/howtos/stages/stages.doctree
Binary file not shown.
Binary file added
BIN
+44.3 KB
20240903-news-scripted-diagrams/.doctrees/howtos/starting_options/starting_options.doctree
Binary file not shown.
Binary file added
BIN
+53.8 KB
20240903-news-scripted-diagrams/.doctrees/howtos/testing_apps/testing_apps.doctree
Binary file not shown.
Binary file added
BIN
+35.7 KB
20240903-news-scripted-diagrams/.doctrees/howtos/using_app_editor/using_app_editor.doctree
Binary file not shown.
Binary file added
BIN
+12.8 KB
...3-news-scripted-diagrams/.doctrees/howtos/using_gui_libraries/using_gui_libraries.doctree
Binary file not shown.
Binary file added
BIN
+24.3 KB
...cripted-diagrams/.doctrees/howtos/using_scripted_diagrams/using_scripted_diagrams.doctree
Binary file not shown.
Binary file added
BIN
+32.5 KB
20240903-news-scripted-diagrams/.doctrees/howtos/using_services/using_services.doctree
Binary file not shown.
Binary file added
BIN
+20.4 KB
...ted-diagrams/.doctrees/howtos/using_shared_environments/using_shared_environments.doctree
Binary file not shown.
Binary file added
BIN
+3.66 KB
...3-news-scripted-diagrams/.doctrees/howtos/using_vscode_editor/using_vscode_editor.doctree
Binary file not shown.
Binary file added
BIN
+8.7 KB
20240903-news-scripted-diagrams/.doctrees/howtos/using_wheelhouses/using_wheelhouses.doctree
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.08 KB
20240903-news-scripted-diagrams/.doctrees/news/20231215-api-examples.doctree
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.13 KB
20240903-news-scripted-diagrams/.doctrees/news/20240115-project-keywords.doctree
Binary file not shown.
Binary file added
BIN
+4.33 KB
20240903-news-scripted-diagrams/.doctrees/news/20240115-software-starting-options.doctree
Binary file not shown.
Binary file added
BIN
+5.57 KB
20240903-news-scripted-diagrams/.doctrees/news/20240119-scripted-elements-examples.doctree
Binary file not shown.
Binary file added
BIN
+5.01 KB
20240903-news-scripted-diagrams/.doctrees/news/20240130-using-wheelhouses.doctree
Binary file not shown.
Binary file added
BIN
+4.51 KB
20240903-news-scripted-diagrams/.doctrees/news/20240130-working-with-stages.doctree
Binary file not shown.
Binary file added
BIN
+5.38 KB
20240903-news-scripted-diagrams/.doctrees/news/20240205-using-gui-libraries.doctree
Binary file not shown.
Binary file added
BIN
+5.04 KB
20240903-news-scripted-diagrams/.doctrees/news/20240209-test-coverage.doctree
Binary file not shown.
Binary file added
BIN
+4.28 KB
20240903-news-scripted-diagrams/.doctrees/news/20240307-csharp_dotnet.doctree
Binary file not shown.
Binary file added
BIN
+4.61 KB
20240903-news-scripted-diagrams/.doctrees/news/20240307-mesh-selection.doctree
Binary file not shown.
Binary file added
BIN
+4.55 KB
...3-news-scripted-diagrams/.doctrees/news/20240314-internationalization-tool-update.doctree
Binary file not shown.
Binary file added
BIN
+4.61 KB
20240903-news-scripted-diagrams/.doctrees/news/20240315-element-selection.doctree
Binary file not shown.
Binary file added
BIN
+5.61 KB
20240903-news-scripted-diagrams/.doctrees/news/20241028-insert-file.doctree
Binary file not shown.
Binary file added
BIN
+4.15 KB
20240903-news-scripted-diagrams/.doctrees/news/20241125-release-2025.doctree
Binary file not shown.
Binary file added
BIN
+4.89 KB
20240903-news-scripted-diagrams/.doctrees/news/20241205-autodialogcontext.doctree
Binary file not shown.
Binary file added
BIN
+5.34 KB
20240903-news-scripted-diagrams/.doctrees/news/20241211-services.doctree
Binary file not shown.
Binary file added
BIN
+4.82 KB
20240903-news-scripted-diagrams/.doctrees/news/20241217-scripted-diagrams.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+314 KB
20240903-news-scripted-diagrams/.doctrees/python_api/python_api.doctree
Binary file not shown.
Binary file added
BIN
+271 KB
20240903-news-scripted-diagrams/.doctrees/python_api/resource_api.doctree
Binary file not shown.
Binary file added
BIN
+96.5 KB
20240903-news-scripted-diagrams/.doctrees/python_api/scripted_elements_api.doctree
Binary file not shown.
Binary file added
BIN
+275 KB
20240903-news-scripted-diagrams/.doctrees/python_examples/examples_overview.doctree
Binary file not shown.
Binary file added
BIN
+11.8 KB
20240903-news-scripted-diagrams/.doctrees/python_examples/index.doctree
Binary file not shown.
Empty file.
85 changes: 85 additions & 0 deletions
85
...cripted-diagrams/_downloads/103208b9004accadabdd7dfe3eea9371/dialog_custom_elem_select.py
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,85 @@ | ||
import gom | ||
|
||
DIALOG4 = gom.script.sys.create_user_defined_dialog(dialog={ | ||
"content": [ | ||
[ | ||
{ | ||
"columns": 1, | ||
"name": "label_6", | ||
"rows": 1, | ||
"text": { | ||
"id": "", | ||
"text": "New", | ||
"translatable": True | ||
}, | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": True | ||
}, | ||
"type": "label", | ||
"word_wrap": False | ||
}, | ||
{ | ||
"columns": 1, | ||
"fast_filter": False, | ||
"name": "input_new", | ||
"rows": 1, | ||
"supplier": "custom", | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": True | ||
}, | ||
"type": "input::point3d" | ||
} | ||
] | ||
], | ||
"control": { | ||
"id": "OkCancel" | ||
}, | ||
"embedding": "", | ||
"position": "", | ||
"size": { | ||
"height": 112, | ||
"width": 200 | ||
}, | ||
"sizemode": "", | ||
"style": "", | ||
"title": { | ||
"id": "", | ||
"text": "Demo \"New selection element\"", | ||
"translatable": True | ||
} | ||
}) | ||
|
||
|
||
def dialog_event_handler(widget): | ||
pass | ||
|
||
|
||
# filter system planes | ||
def element_filter(element): | ||
try: | ||
if element.type == 'plane': | ||
return True | ||
except Exception as e: | ||
pass | ||
return False | ||
|
||
|
||
DIALOG4.handler = dialog_event_handler | ||
DIALOG4.input_new.filter = element_filter | ||
|
||
# Alternative: use fast filtering | ||
# from typing import Iterable | ||
# | ||
# def fast_element_filter(*elements) -> Iterable[bool]: | ||
# return [element_filter(e) for e in elements] | ||
# | ||
# DIALOG4.input_new.fast_filter = True | ||
# DIALOG4.input_new.filter = fast_element_filter | ||
|
||
RESULT = gom.script.sys.show_user_defined_dialog(dialog=DIALOG4) | ||
|
||
print("Chosen system plane:", RESULT.input_new.name) |
127 changes: 127 additions & 0 deletions
127
20240903-news-scripted-diagrams/_downloads/548b76d0a411422a7f2f34c1ce30ecab/dialog_yes_no.py
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,127 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import gom | ||
|
||
DIALOG=gom.script.sys.create_user_defined_dialog (dialog={ | ||
"content": [ | ||
[ | ||
{ | ||
"columns": 2, | ||
"name": "label", | ||
"rows": 1, | ||
"text": { | ||
"id": "", | ||
"text": "Choose a button. Any button.", | ||
"translatable": True | ||
}, | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": True | ||
}, | ||
"type": "label", | ||
"word_wrap": False | ||
}, | ||
{ | ||
} | ||
], | ||
[ | ||
{ | ||
"button_type": "push", | ||
"columns": 1, | ||
"icon": "AAAAAA==", | ||
"icon_file_name": "", | ||
"icon_size": { | ||
"value": "icon" | ||
}, | ||
"icon_system_size": { | ||
"value": "default" | ||
}, | ||
"icon_system_type": { | ||
"value": "ok" | ||
}, | ||
"icon_type": { | ||
"value": "none" | ||
}, | ||
"name": "button_yes", | ||
"rows": 1, | ||
"text": { | ||
"id": "", | ||
"text": "Yes", | ||
"translatable": True | ||
}, | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": True | ||
}, | ||
"type": "button::pushbutton" | ||
}, | ||
{ | ||
"button_type": "push", | ||
"columns": 1, | ||
"icon": "AAAAAA==", | ||
"icon_file_name": "", | ||
"icon_size": { | ||
"value": "icon" | ||
}, | ||
"icon_system_size": { | ||
"value": "default" | ||
}, | ||
"icon_system_type": { | ||
"value": "ok" | ||
}, | ||
"icon_type": { | ||
"value": "none" | ||
}, | ||
"name": "button_no", | ||
"rows": 1, | ||
"text": { | ||
"id": "", | ||
"text": "No", | ||
"translatable": True | ||
}, | ||
"tooltip": { | ||
"id": "", | ||
"text": "", | ||
"translatable": True | ||
}, | ||
"type": "button::pushbutton" | ||
} | ||
] | ||
], | ||
"control": { | ||
"id": "Empty" | ||
}, | ||
"embedding": "", | ||
"position": "", | ||
"size": { | ||
"height": 121, | ||
"width": 230 | ||
}, | ||
"sizemode": "", | ||
"style": "", | ||
"title": { | ||
"id": "", | ||
"text": "Push a button", | ||
"translatable": True | ||
} | ||
}) | ||
|
||
# | ||
# Event handler function called if anything happens inside of the dialog | ||
# | ||
def dialog_event_handler (widget): | ||
if widget == DIALOG.button_yes: | ||
gom.script.sys.close_user_defined_dialog( dialog = DIALOG, result = 'Yes' ) | ||
if widget == DIALOG.button_no: | ||
gom.script.sys.close_user_defined_dialog( dialog = DIALOG, result = 'No' ) | ||
|
||
DIALOG.handler = dialog_event_handler | ||
|
||
try: | ||
RESULT=gom.script.sys.show_user_defined_dialog (dialog=DIALOG) | ||
except gom.BreakError as e: | ||
RESULT = 'Cheater' | ||
|
||
print('RESULT', RESULT) |
644 changes: 644 additions & 0 deletions
644
...-news-scripted-diagrams/_downloads/7358cc5321d10932c3b63f88db9dc229/SingleLayoutWizard.py
Large diffs are not rendered by default.
Oops, something went wrong.
459 changes: 459 additions & 0 deletions
459
...3-news-scripted-diagrams/_downloads/80984896c0fd765493602c64d84d4d35/MultiLayoutWizard.py
Large diffs are not rendered by default.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...-news-scripted-diagrams/_downloads/bab594f916667a1393cc743397e08882/localize_triangles.py
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,23 @@ | ||
def localize_triangles(triangles:np.ndarray, global_vertices:np.ndarray) -> tuple[np.ndarray, np.ndarray]: | ||
"""This function resets the triangles' indices to be relative to the selection on mesh | ||
Args: | ||
triangles (np.ndarray): array of triangles from 'np.array(mesh.selection.triangles)[stage]' | ||
global_vertices (np.ndarray): all vertices of the mesh 'np.array(mesh.data.coordinate)[stage]' | ||
Returns: | ||
tuple[np.ndarray, np.ndarray]: localized triangles' array and indices, for remapping of global vertices, values, etc. | ||
Usage: | ||
>>> global_vertices = np.array(mesh.data.coordinate) | ||
>>> triangles = np.array(mesh.selection.triangle) | ||
>>> number_of_stages = len(global_vertices) | ||
>>> for stage in range(number_of_stages): | ||
... localized_triangles, indices = localize_triangles(triangles[stage], global_vertices[stage]) | ||
... localized_vertices = global_vertices[stage][indices] | ||
""" | ||
indices = np.nonzero(np.bincount(triangles.ravel(), minlength=len(global_vertices)))[0] | ||
remap = np.ndarray(len(global_vertices), dtype=np.int32) | ||
remap[indices] = np.arange(0, len(indices)) | ||
triangles = remap[triangles.ravel()].reshape(triangles.shape) | ||
return triangles, indices |
Oops, something went wrong.