fake-bpy-module 20240210__py3-none-any.whl → 20240326__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- addon_utils/__init__.pyi +54 -11
- animsys_refactor/__init__.pyi +36 -7
- aud/__init__.pyi +307 -321
- bgl/__init__.pyi +2926 -865
- bl_app_override/__init__.pyi +14 -4
- bl_app_override/helpers/__init__.pyi +24 -3
- bl_app_template_utils/__init__.pyi +19 -5
- bl_console_utils/__init__.pyi +0 -1
- bl_console_utils/autocomplete/__init__.pyi +2 -3
- bl_console_utils/autocomplete/complete_calltip/__init__.pyi +24 -6
- bl_console_utils/autocomplete/complete_import/__init__.pyi +14 -4
- bl_console_utils/autocomplete/complete_namespace/__init__.pyi +24 -6
- bl_console_utils/autocomplete/intellisense/__init__.pyi +9 -3
- bl_i18n_utils/__init__.pyi +2 -3
- bl_i18n_utils/bl_extract_messages/__init__.pyi +74 -16
- bl_i18n_utils/merge_po/__init__.pyi +4 -2
- bl_i18n_utils/settings/__init__.pyi +53 -7
- bl_i18n_utils/utils/__init__.pyi +332 -45
- bl_i18n_utils/utils_cli/__init__.pyi +29 -7
- bl_i18n_utils/utils_languages_menu/__init__.pyi +4 -2
- bl_i18n_utils/utils_rtl/__init__.pyi +9 -3
- bl_keymap_utils/__init__.pyi +2 -3
- bl_keymap_utils/io/__init__.pyi +44 -10
- bl_keymap_utils/keymap_from_toolbar/__init__.pyi +4 -2
- bl_keymap_utils/keymap_hierarchy/__init__.pyi +4 -2
- bl_keymap_utils/platform_helpers/__init__.pyi +9 -3
- bl_keymap_utils/versioning/__init__.pyi +4 -2
- bl_math/__init__.pyi +21 -22
- bl_operators/__init__.pyi +30 -24
- bl_operators/add_mesh_torus/__init__.pyi +171 -38
- bl_operators/anim/__init__.pyi +1065 -227
- bl_operators/assets/__init__.pyi +427 -93
- bl_operators/bmesh/__init__.pyi +0 -1
- bl_operators/bmesh/find_adjacent/__init__.pyi +44 -10
- bl_operators/clip/__init__.pyi +1342 -288
- bl_operators/console/__init__.pyi +647 -141
- bl_operators/constraint/__init__.pyi +524 -113
- bl_operators/file/__init__.pyi +396 -85
- bl_operators/freestyle/__init__.pyi +532 -114
- bl_operators/geometry_nodes/__init__.pyi +2412 -597
- bl_operators/image/__init__.pyi +380 -83
- bl_operators/mesh/__init__.pyi +401 -86
- bl_operators/node/__init__.pyi +1756 -385
- bl_operators/object/__init__.pyi +2022 -553
- bl_operators/object_align/__init__.pyi +145 -32
- bl_operators/object_quick_effects/__init__.pyi +555 -125
- bl_operators/object_randomize_transform/__init__.pyi +136 -33
- bl_operators/presets/__init__.pyi +3516 -709
- bl_operators/rigidbody/__init__.pyi +401 -86
- bl_operators/screen_play_rendered_anim/__init__.pyi +129 -30
- bl_operators/sequencer/__init__.pyi +731 -150
- bl_operators/spreadsheet/__init__.pyi +145 -31
- bl_operators/userpref/__init__.pyi +3416 -825
- bl_operators/uvcalc_follow_active/__init__.pyi +149 -33
- bl_operators/uvcalc_lightmap/__init__.pyi +187 -35
- bl_operators/uvcalc_transform/__init__.pyi +344 -74
- bl_operators/vertexpaint_dirt/__init__.pyi +140 -31
- bl_operators/view3d/__init__.pyi +697 -147
- bl_operators/wm/__init__.pyi +6287 -1534
- bl_previews_utils/__init__.pyi +0 -1
- bl_previews_utils/bl_previews_render/__init__.pyi +34 -8
- bl_rna_utils/__init__.pyi +0 -1
- bl_rna_utils/data_path/__init__.pyi +12 -3
- bl_text_utils/__init__.pyi +0 -1
- bl_text_utils/external_editor/__init__.pyi +4 -2
- bl_ui/__init__.pyi +567 -170
- bl_ui/anim/__init__.pyi +164 -34
- bl_ui/asset_shelf/__init__.pyi +146 -32
- bl_ui/generic_ui_list/__init__.pyi +471 -100
- bl_ui/node_add_menu/__init__.pyi +196 -41
- bl_ui/node_add_menu_compositor/__init__.pyi +3017 -622
- bl_ui/node_add_menu_geometry/__init__.pyi +8075 -1592
- bl_ui/node_add_menu_shader/__init__.pyi +1709 -349
- bl_ui/node_add_menu_texture/__init__.pyi +1502 -306
- bl_ui/properties_animviz/__init__.pyi +32 -3
- bl_ui/properties_collection/__init__.pyi +787 -180
- bl_ui/properties_constraint/__init__.pyi +28635 -5524
- bl_ui/properties_data_armature/__init__.pyi +1905 -449
- bl_ui/properties_data_bone/__init__.pyi +1560 -337
- bl_ui/properties_data_camera/__init__.pyi +2269 -495
- bl_ui/properties_data_curve/__init__.pyi +2362 -535
- bl_ui/properties_data_curves/__init__.pyi +951 -204
- bl_ui/properties_data_empty/__init__.pyi +317 -70
- bl_ui/properties_data_gpencil/__init__.pyi +2924 -735
- bl_ui/properties_data_grease_pencil/__init__.pyi +1631 -189
- bl_ui/properties_data_lattice/__init__.pyi +472 -105
- bl_ui/properties_data_light/__init__.pyi +1570 -338
- bl_ui/properties_data_lightprobe/__init__.pyi +938 -209
- bl_ui/properties_data_mesh/__init__.pyi +3205 -768
- bl_ui/properties_data_metaball/__init__.pyi +774 -171
- bl_ui/properties_data_modifier/__init__.pyi +1554 -329
- bl_ui/properties_data_pointcloud/__init__.pyi +821 -195
- bl_ui/properties_data_shaderfx/__init__.pyi +154 -35
- bl_ui/properties_data_speaker/__init__.pyi +782 -169
- bl_ui/properties_data_volume/__init__.pyi +1243 -282
- bl_ui/properties_freestyle/__init__.pyi +4071 -1031
- bl_ui/properties_grease_pencil_common/__init__.pyi +2399 -484
- bl_ui/properties_mask_common/__init__.pyi +1256 -250
- bl_ui/properties_material/__init__.pyi +2351 -543
- bl_ui/properties_material_gpencil/__init__.pyi +1590 -366
- bl_ui/properties_object/__init__.pyi +2179 -513
- bl_ui/properties_output/__init__.pyi +2956 -706
- bl_ui/properties_paint_common/__init__.pyi +947 -141
- bl_ui/properties_particle/__init__.pyi +8322 -1971
- bl_ui/properties_physics_cloth/__init__.pyi +2254 -509
- bl_ui/properties_physics_common/__init__.pyi +200 -45
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +4454 -966
- bl_ui/properties_physics_field/__init__.pyi +1695 -365
- bl_ui/properties_physics_fluid/__init__.pyi +6127 -1281
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +157 -33
- bl_ui/properties_physics_rigidbody/__init__.pyi +1254 -279
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +2053 -484
- bl_ui/properties_physics_softbody/__init__.pyi +2394 -543
- bl_ui/properties_render/__init__.pyi +8312 -1934
- bl_ui/properties_scene/__init__.pyi +2211 -540
- bl_ui/properties_texture/__init__.pyi +4185 -1014
- bl_ui/properties_view_layer/__init__.pyi +2803 -665
- bl_ui/properties_workspace/__init__.pyi +626 -149
- bl_ui/properties_world/__init__.pyi +1092 -235
- bl_ui/space_clip/__init__.pyi +11475 -2806
- bl_ui/space_console/__init__.pyi +967 -203
- bl_ui/space_dopesheet/__init__.pyi +4260 -967
- bl_ui/space_filebrowser/__init__.pyi +4852 -1188
- bl_ui/space_graph/__init__.pyi +3251 -703
- bl_ui/space_image/__init__.pyi +12218 -2968
- bl_ui/space_info/__init__.pyi +964 -201
- bl_ui/space_nla/__init__.pyi +2756 -585
- bl_ui/space_node/__init__.pyi +5661 -1266
- bl_ui/space_outliner/__init__.pyi +2294 -479
- bl_ui/space_properties/__init__.pyi +417 -93
- bl_ui/space_sequencer/__init__.pyi +12436 -3010
- bl_ui/space_spreadsheet/__init__.pyi +184 -37
- bl_ui/space_statusbar/__init__.pyi +135 -31
- bl_ui/space_text/__init__.pyi +2556 -543
- bl_ui/space_time/__init__.pyi +1151 -244
- bl_ui/space_toolsystem_common/__init__.pyi +368 -67
- bl_ui/space_toolsystem_toolbar/__init__.pyi +1378 -229
- bl_ui/space_topbar/__init__.pyi +4214 -888
- bl_ui/space_userpref/__init__.pyi +13920 -3468
- bl_ui/space_view3d/__init__.pyi +42751 -9613
- bl_ui/space_view3d_toolbar/__init__.pyi +16379 -3860
- bl_ui/utils/__init__.pyi +42 -5
- bl_ui_utils/__init__.pyi +0 -1
- bl_ui_utils/bug_report_url/__init__.pyi +4 -2
- bl_ui_utils/layout/__init__.pyi +4 -2
- blend_render_info/__init__.pyi +13 -4
- blf/__init__.pyi +15 -18
- bmesh/__init__.pyi +18 -18
- bmesh/geometry/__init__.pyi +5 -6
- bmesh/ops/__init__.pyi +1337 -1158
- bmesh/types/__init__.pyi +464 -374
- bmesh/utils/__init__.pyi +64 -70
- bpy/__init__.pyi +6 -7
- bpy/app/__init__.pyi +36 -38
- bpy/app/handlers/__init__.pyi +37 -38
- bpy/app/icons/__init__.pyi +8 -11
- bpy/app/timers/__init__.pyi +18 -17
- bpy/app/translations/__init__.pyi +32 -30
- bpy/msgbus/__init__.pyi +25 -20
- bpy/ops/__init__.pyi +63 -64
- bpy/ops/action/__init__.pyi +408 -436
- bpy/ops/anim/__init__.pyi +459 -577
- bpy/ops/armature/__init__.pyi +396 -498
- bpy/ops/asset/__init__.pyi +187 -213
- bpy/ops/boid/__init__.pyi +50 -68
- bpy/ops/brush/__init__.pyi +72 -97
- bpy/ops/buttons/__init__.pyi +202 -193
- bpy/ops/cachefile/__init__.pyi +198 -188
- bpy/ops/camera/__init__.pyi +24 -31
- bpy/ops/clip/__init__.pyi +1021 -1082
- bpy/ops/cloth/__init__.pyi +11 -15
- bpy/ops/collection/__init__.pyi +36 -51
- bpy/ops/console/__init__.pyi +155 -209
- bpy/ops/constraint/__init__.pyi +286 -254
- bpy/ops/curve/__init__.pyi +597 -659
- bpy/ops/curves/__init__.pyi +191 -225
- bpy/ops/cycles/__init__.pyi +21 -30
- bpy/ops/dpaint/__init__.pyi +34 -47
- bpy/ops/ed/__init__.pyi +160 -176
- bpy/ops/export_anim/__init__.pyi +51 -34
- bpy/ops/export_mesh/__init__.pyi +47 -45
- bpy/ops/export_scene/__init__.pyi +659 -504
- bpy/ops/file/__init__.pyi +469 -474
- bpy/ops/fluid/__init__.pyi +89 -119
- bpy/ops/font/__init__.pyi +325 -361
- bpy/ops/geometry/__init__.pyi +86 -114
- bpy/ops/gizmogroup/__init__.pyi +22 -28
- bpy/ops/gpencil/__init__.pyi +1900 -1976
- bpy/ops/graph/__init__.pyi +875 -894
- bpy/ops/grease_pencil/__init__.pyi +572 -508
- bpy/ops/image/__init__.pyi +805 -855
- bpy/ops/import_anim/__init__.pyi +66 -46
- bpy/ops/import_curve/__init__.pyi +7 -11
- bpy/ops/import_mesh/__init__.pyi +19 -25
- bpy/ops/import_scene/__init__.pyi +164 -147
- bpy/ops/info/__init__.pyi +88 -85
- bpy/ops/lattice/__init__.pyi +86 -90
- bpy/ops/marker/__init__.pyi +135 -146
- bpy/ops/mask/__init__.pyi +372 -436
- bpy/ops/material/__init__.pyi +18 -25
- bpy/ops/mball/__init__.pyi +93 -99
- bpy/ops/mesh/__init__.pyi +2525 -2664
- bpy/ops/nla/__init__.pyi +398 -455
- bpy/ops/node/__init__.pyi +1015 -1207
- bpy/ops/object/__init__.pyi +3423 -3390
- bpy/ops/outliner/__init__.pyi +667 -685
- bpy/ops/paint/__init__.pyi +719 -672
- bpy/ops/paintcurve/__init__.pyi +64 -85
- bpy/ops/palette/__init__.pyi +48 -67
- bpy/ops/particle/__init__.pyi +323 -367
- bpy/ops/pose/__init__.pyi +569 -474
- bpy/ops/poselib/__init__.pyi +77 -100
- bpy/ops/preferences/__init__.pyi +460 -512
- bpy/ops/ptcache/__init__.pyi +46 -63
- bpy/ops/render/__init__.pyi +121 -155
- bpy/ops/rigidbody/__init__.pyi +148 -143
- bpy/ops/scene/__init__.pyi +336 -380
- bpy/ops/screen/__init__.pyi +454 -530
- bpy/ops/script/__init__.pyi +19 -28
- bpy/ops/sculpt/__init__.pyi +734 -587
- bpy/ops/sculpt_curves/__init__.pyi +51 -56
- bpy/ops/sequencer/__init__.pyi +1617 -1500
- bpy/ops/sound/__init__.pyi +392 -315
- bpy/ops/spreadsheet/__init__.pyi +31 -42
- bpy/ops/surface/__init__.pyi +198 -163
- bpy/ops/text/__init__.pyi +479 -545
- bpy/ops/text_editor/__init__.pyi +11 -15
- bpy/ops/texture/__init__.pyi +26 -36
- bpy/ops/transform/__init__.pyi +825 -941
- bpy/ops/ui/__init__.pyi +246 -295
- bpy/ops/uilist/__init__.pyi +34 -38
- bpy/ops/uv/__init__.pyi +912 -824
- bpy/ops/view2d/__init__.pyi +157 -197
- bpy/ops/view3d/__init__.pyi +777 -878
- bpy/ops/wm/__init__.pyi +4102 -3595
- bpy/ops/workspace/__init__.pyi +42 -58
- bpy/ops/world/__init__.pyi +6 -9
- bpy/path/__init__.pyi +166 -109
- bpy/props/__init__.pyi +478 -395
- bpy/types/__init__.pyi +87194 -81467
- bpy/utils/__init__.pyi +325 -169
- bpy/utils/previews/__init__.pyi +108 -21
- bpy/utils/units/__init__.pyi +37 -39
- bpy_extras/__init__.pyi +4 -9
- bpy_extras/anim_utils/__init__.pyi +25 -55
- bpy_extras/asset_utils/__init__.pyi +3 -13
- bpy_extras/id_map_utils/__init__.pyi +1 -4
- bpy_extras/image_utils/__init__.pyi +33 -23
- bpy_extras/io_utils/__init__.pyi +116 -66
- bpy_extras/keyconfig_utils/__init__.pyi +5 -3
- bpy_extras/mesh_utils/__init__.pyi +42 -34
- bpy_extras/node_utils/__init__.pyi +4 -4
- bpy_extras/object_utils/__init__.pyi +58 -43
- bpy_extras/view3d_utils/__init__.pyi +64 -63
- bpy_restrict_state/__init__.pyi +14 -2
- bpy_types/__init__.pyi +3873 -998
- console_python/__init__.pyi +41 -8
- console_shell/__init__.pyi +24 -6
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/METADATA +1 -1
- fake_bpy_module-20240326.dist-info/RECORD +343 -0
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/WHEEL +1 -1
- freestyle/__init__.pyi +4 -5
- freestyle/chainingiterators/__init__.pyi +229 -73
- freestyle/functions/__init__.pyi +624 -402
- freestyle/predicates/__init__.pyi +381 -169
- freestyle/shaders/__init__.pyi +424 -155
- freestyle/types/__init__.pyi +1572 -726
- freestyle/utils/ContextFunctions/__init__.pyi +54 -43
- freestyle/utils/__init__.pyi +67 -31
- gpu/__init__.pyi +3 -4
- gpu/capabilities/__init__.pyi +57 -37
- gpu/matrix/__init__.pyi +14 -17
- gpu/platform/__init__.pyi +5 -6
- gpu/select/__init__.pyi +2 -5
- gpu/shader/__init__.pyi +14 -12
- gpu/state/__init__.pyi +48 -62
- gpu/texture/__init__.pyi +7 -7
- gpu/types/__init__.pyi +670 -229
- gpu_extras/__init__.pyi +1 -2
- gpu_extras/batch/__init__.pyi +27 -6
- gpu_extras/presets/__init__.pyi +67 -27
- graphviz_export/__init__.pyi +9 -3
- idprop/__init__.pyi +0 -1
- idprop/types/__init__.pyi +42 -13
- imbuf/__init__.pyi +6 -10
- imbuf/types/__init__.pyi +8 -16
- keyingsets_builtins/__init__.pyi +3149 -702
- keyingsets_utils/__init__.pyi +69 -15
- mathutils/__init__.pyi +951 -876
- mathutils/bvhtree/__init__.pyi +47 -48
- mathutils/geometry/__init__.pyi +237 -242
- mathutils/interpolate/__init__.pyi +3 -6
- mathutils/kdtree/__init__.pyi +23 -26
- mathutils/noise/__init__.pyi +50 -51
- nodeitems_builtins/__init__.pyi +50 -11
- nodeitems_utils/__init__.pyi +58 -11
- rna_info/__init__.pyi +230 -27
- rna_keymap_ui/__init__.pyi +29 -7
- rna_prop_ui/__init__.pyi +69 -13
- rna_xml/__init__.pyi +29 -7
- sys_info/__init__.pyi +4 -2
- bpy_extras/bmesh_utils/__init__.pyi +0 -7
- bpy_extras/extensions/__init__.pyi +0 -5
- bpy_extras/extensions/junction_module/__init__.pyi +0 -13
- bpy_extras/node_shader_utils/__init__.pyi +0 -132
- bpy_extras/wm_utils/__init__.pyi +0 -5
- bpy_extras/wm_utils/progress_report/__init__.pyi +0 -30
- fake_bpy_module-20240210.dist-info/RECORD +0 -349
- {fake_bpy_module-20240210.dist-info → fake_bpy_module-20240326.dist-info}/top_level.txt +0 -0
freestyle/types/__init__.pyi
CHANGED
|
@@ -1,35 +1,61 @@
|
|
|
1
|
-
import sys
|
|
2
1
|
import typing
|
|
3
2
|
import mathutils
|
|
4
3
|
|
|
5
4
|
GenericType = typing.TypeVar("GenericType")
|
|
6
5
|
|
|
7
6
|
class AdjacencyIterator:
|
|
8
|
-
"""Class hierarchy: `Iterator` > `AdjacencyIterator`
|
|
7
|
+
"""Class hierarchy: `Iterator` > `AdjacencyIterator`Class for representing adjacency iterators used in the chaining
|
|
8
|
+
process. An AdjacencyIterator is created in the increment() and
|
|
9
|
+
decrement() methods of a `ChainingIterator` and passed to the
|
|
10
|
+
traverse() method of the ChainingIterator.
|
|
11
|
+
"""
|
|
9
12
|
|
|
10
13
|
is_incoming: bool
|
|
11
|
-
""" True if the current ViewEdge is coming towards the iteration vertex, and
|
|
14
|
+
""" True if the current ViewEdge is coming towards the iteration vertex, and
|
|
15
|
+
False otherwise.
|
|
12
16
|
|
|
13
17
|
:type: bool
|
|
14
18
|
"""
|
|
15
19
|
|
|
16
|
-
object:
|
|
20
|
+
object: ViewEdge
|
|
17
21
|
""" The ViewEdge object currently pointed to by this iterator.
|
|
18
22
|
|
|
19
|
-
:type:
|
|
23
|
+
:type: ViewEdge
|
|
20
24
|
"""
|
|
21
25
|
|
|
22
26
|
def __init__(self):
|
|
23
|
-
"""
|
|
27
|
+
"""Builds an `AdjacencyIterator` using the default constructor,
|
|
28
|
+
copy constructor or the overloaded constructor.
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
def __init__(self, brother: AdjacencyIterator):
|
|
34
|
+
"""Builds an `AdjacencyIterator` using the default constructor,
|
|
35
|
+
copy constructor or the overloaded constructor.
|
|
36
|
+
|
|
37
|
+
:param brother: An AdjacencyIterator object.
|
|
38
|
+
:type brother: AdjacencyIterator
|
|
39
|
+
"""
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
def __init__(
|
|
43
|
+
self,
|
|
44
|
+
vertex: ViewVertex,
|
|
45
|
+
restrict_to_selection: bool = True,
|
|
46
|
+
restrict_to_unvisited: bool = True,
|
|
47
|
+
):
|
|
48
|
+
"""Builds an `AdjacencyIterator` using the default constructor,
|
|
49
|
+
copy constructor or the overloaded constructor.
|
|
24
50
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
51
|
+
:param vertex: The vertex which is the next crossing.
|
|
52
|
+
:type vertex: ViewVertex
|
|
53
|
+
:param restrict_to_selection: Indicates whether to force the chaining
|
|
54
|
+
to stay within the set of selected ViewEdges or not.
|
|
55
|
+
:type restrict_to_selection: bool
|
|
56
|
+
:param restrict_to_unvisited: Indicates whether a ViewEdge that has
|
|
57
|
+
already been chained must be ignored ot not.
|
|
58
|
+
:type restrict_to_unvisited: bool
|
|
33
59
|
"""
|
|
34
60
|
...
|
|
35
61
|
|
|
@@ -41,7 +67,12 @@ class BBox:
|
|
|
41
67
|
...
|
|
42
68
|
|
|
43
69
|
class BinaryPredicate0D:
|
|
44
|
-
"""Base class for binary predicates working on `Interface0D`
|
|
70
|
+
"""Base class for binary predicates working on `Interface0D`
|
|
71
|
+
objects. A BinaryPredicate0D is typically an ordering relation
|
|
72
|
+
between two Interface0D objects. The predicate evaluates a relation
|
|
73
|
+
between the two Interface0D instances and returns a boolean value (true
|
|
74
|
+
or false). It is used by invoking the __call__() method.
|
|
75
|
+
"""
|
|
45
76
|
|
|
46
77
|
name: str
|
|
47
78
|
""" The name of the binary 0D predicate.
|
|
@@ -53,20 +84,26 @@ class BinaryPredicate0D:
|
|
|
53
84
|
"""Default constructor."""
|
|
54
85
|
...
|
|
55
86
|
|
|
56
|
-
def __call__(self, inter1:
|
|
57
|
-
"""Must be overload by inherited classes. It evaluates a relation
|
|
87
|
+
def __call__(self, inter1: Interface0D, inter2: Interface0D) -> Interface0D:
|
|
88
|
+
"""Must be overload by inherited classes. It evaluates a relation
|
|
89
|
+
between two Interface0D objects.
|
|
58
90
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
91
|
+
:param inter1: The first Interface0D object.
|
|
92
|
+
:type inter1: Interface0D
|
|
93
|
+
:param inter2: The second Interface0D object.
|
|
94
|
+
:type inter2: Interface0D
|
|
95
|
+
:return: True or false.
|
|
96
|
+
:rtype: bool
|
|
65
97
|
"""
|
|
66
98
|
...
|
|
67
99
|
|
|
68
100
|
class BinaryPredicate1D:
|
|
69
|
-
"""Base class for binary predicates working on `Interface1D`
|
|
101
|
+
"""Base class for binary predicates working on `Interface1D`
|
|
102
|
+
objects. A BinaryPredicate1D is typically an ordering relation
|
|
103
|
+
between two Interface1D objects. The predicate evaluates a relation
|
|
104
|
+
between the two Interface1D instances and returns a boolean value (true
|
|
105
|
+
or false). It is used by invoking the __call__() method.
|
|
106
|
+
"""
|
|
70
107
|
|
|
71
108
|
name: str
|
|
72
109
|
""" The name of the binary 1D predicate.
|
|
@@ -78,53 +115,82 @@ class BinaryPredicate1D:
|
|
|
78
115
|
"""Default constructor."""
|
|
79
116
|
...
|
|
80
117
|
|
|
81
|
-
def __call__(self, inter1:
|
|
82
|
-
"""Must be overload by inherited classes. It evaluates a relation
|
|
118
|
+
def __call__(self, inter1: Interface1D, inter2: Interface1D) -> Interface1D:
|
|
119
|
+
"""Must be overload by inherited classes. It evaluates a relation
|
|
120
|
+
between two Interface1D objects.
|
|
83
121
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
122
|
+
:param inter1: The first Interface1D object.
|
|
123
|
+
:type inter1: Interface1D
|
|
124
|
+
:param inter2: The second Interface1D object.
|
|
125
|
+
:type inter2: Interface1D
|
|
126
|
+
:return: True or false.
|
|
127
|
+
:rtype: bool
|
|
90
128
|
"""
|
|
91
129
|
...
|
|
92
130
|
|
|
93
131
|
class Chain:
|
|
94
|
-
"""Class hierarchy: `Interface1D` > `Curve` > `Chain`
|
|
132
|
+
"""Class hierarchy: `Interface1D` > `Curve` > `Chain`Class to represent a 1D elements issued from the chaining process. A
|
|
133
|
+
Chain is the last step before the `Stroke` and is used in the
|
|
134
|
+
Splitting and Creation processes.
|
|
135
|
+
"""
|
|
95
136
|
|
|
96
137
|
def __init__(self):
|
|
97
|
-
"""
|
|
138
|
+
"""Builds a `Chain` using the default constructor,
|
|
139
|
+
copy constructor or from an `Id`.
|
|
140
|
+
|
|
141
|
+
"""
|
|
142
|
+
...
|
|
98
143
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
144
|
+
def __init__(self, brother: Chain):
|
|
145
|
+
"""Builds a `Chain` using the default constructor,
|
|
146
|
+
copy constructor or from an `Id`.
|
|
147
|
+
|
|
148
|
+
:param brother: A Chain object.
|
|
149
|
+
:type brother: Chain
|
|
150
|
+
"""
|
|
151
|
+
...
|
|
152
|
+
|
|
153
|
+
def __init__(self, id: Id):
|
|
154
|
+
"""Builds a `Chain` using the default constructor,
|
|
155
|
+
copy constructor or from an `Id`.
|
|
156
|
+
|
|
157
|
+
:param id: An Id object.
|
|
158
|
+
:type id: Id
|
|
103
159
|
"""
|
|
104
160
|
...
|
|
105
161
|
|
|
106
|
-
def push_viewedge_back(self, viewedge:
|
|
162
|
+
def push_viewedge_back(self, viewedge: ViewEdge, orientation: bool):
|
|
107
163
|
"""Adds a ViewEdge at the end of the Chain.
|
|
108
164
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
165
|
+
:param viewedge: The ViewEdge that must be added.
|
|
166
|
+
:type viewedge: ViewEdge
|
|
167
|
+
:param orientation: The orientation with which the ViewEdge must be
|
|
168
|
+
processed.
|
|
169
|
+
:type orientation: bool
|
|
113
170
|
"""
|
|
114
171
|
...
|
|
115
172
|
|
|
116
|
-
def push_viewedge_front(self, viewedge:
|
|
173
|
+
def push_viewedge_front(self, viewedge: ViewEdge, orientation: bool):
|
|
117
174
|
"""Adds a ViewEdge at the beginning of the Chain.
|
|
118
175
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
176
|
+
:param viewedge: The ViewEdge that must be added.
|
|
177
|
+
:type viewedge: ViewEdge
|
|
178
|
+
:param orientation: The orientation with which the ViewEdge must be
|
|
179
|
+
processed.
|
|
180
|
+
:type orientation: bool
|
|
123
181
|
"""
|
|
124
182
|
...
|
|
125
183
|
|
|
126
184
|
class ChainingIterator:
|
|
127
|
-
"""Class hierarchy: `Iterator` > `ViewEdgeIterator` > `ChainingIterator`
|
|
185
|
+
"""Class hierarchy: `Iterator` > `ViewEdgeIterator` > `ChainingIterator`Base class for chaining iterators. This class is designed to be
|
|
186
|
+
overloaded in order to describe chaining rules. It makes the
|
|
187
|
+
description of chaining rules easier. The two main methods that need
|
|
188
|
+
to overloaded are traverse() and init(). traverse() tells which
|
|
189
|
+
`ViewEdge` to follow, among the adjacent ones. If you specify
|
|
190
|
+
restriction rules (such as "Chain only ViewEdges of the selection"),
|
|
191
|
+
they will be included in the adjacency iterator (i.e, the adjacent
|
|
192
|
+
iterator will only stop on "valid" edges).
|
|
193
|
+
"""
|
|
128
194
|
|
|
129
195
|
is_incrementing: bool
|
|
130
196
|
""" True if the current iteration is an incrementation.
|
|
@@ -132,56 +198,76 @@ class ChainingIterator:
|
|
|
132
198
|
:type: bool
|
|
133
199
|
"""
|
|
134
200
|
|
|
135
|
-
next_vertex:
|
|
201
|
+
next_vertex: ViewVertex
|
|
136
202
|
""" The ViewVertex that is the next crossing.
|
|
137
203
|
|
|
138
|
-
:type:
|
|
204
|
+
:type: ViewVertex
|
|
139
205
|
"""
|
|
140
206
|
|
|
141
|
-
object:
|
|
207
|
+
object: ViewEdge
|
|
142
208
|
""" The ViewEdge object currently pointed by this iterator.
|
|
143
209
|
|
|
144
|
-
:type:
|
|
210
|
+
:type: ViewEdge
|
|
145
211
|
"""
|
|
146
212
|
|
|
147
213
|
def __init__(
|
|
148
214
|
self,
|
|
149
215
|
restrict_to_selection: bool = True,
|
|
150
216
|
restrict_to_unvisited: bool = True,
|
|
151
|
-
begin
|
|
217
|
+
begin=None,
|
|
152
218
|
orientation: bool = True,
|
|
153
219
|
):
|
|
154
|
-
"""
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
220
|
+
"""Builds a Chaining Iterator from the first ViewEdge used for
|
|
221
|
+
iteration and its orientation or by using the copy constructor.
|
|
222
|
+
|
|
223
|
+
:param restrict_to_selection: Indicates whether to force the chaining
|
|
224
|
+
to stay within the set of selected ViewEdges or not.
|
|
225
|
+
:type restrict_to_selection: bool
|
|
226
|
+
:param restrict_to_unvisited: Indicates whether a ViewEdge that has
|
|
227
|
+
already been chained must be ignored ot not.
|
|
228
|
+
:type restrict_to_unvisited: bool
|
|
229
|
+
:param begin: The ViewEdge from which to start the chain.
|
|
230
|
+
:param orientation: The direction to follow to explore the graph. If
|
|
231
|
+
true, the direction indicated by the first ViewEdge is used.
|
|
232
|
+
:type orientation: bool
|
|
233
|
+
"""
|
|
234
|
+
...
|
|
235
|
+
|
|
236
|
+
def __init__(self, brother: ChainingIterator):
|
|
237
|
+
"""Builds a Chaining Iterator from the first ViewEdge used for
|
|
238
|
+
iteration and its orientation or by using the copy constructor.
|
|
239
|
+
|
|
240
|
+
:param brother:
|
|
241
|
+
:type brother: ChainingIterator
|
|
166
242
|
"""
|
|
167
243
|
...
|
|
168
244
|
|
|
169
245
|
def init(self):
|
|
170
|
-
"""Initializes the iterator context. This method is called each
|
|
246
|
+
"""Initializes the iterator context. This method is called each
|
|
247
|
+
time a new chain is started. It can be used to reset some
|
|
248
|
+
history information that you might want to keep.
|
|
249
|
+
|
|
250
|
+
"""
|
|
171
251
|
...
|
|
172
252
|
|
|
173
|
-
def traverse(self, it:
|
|
174
|
-
"""This method iterates over the potential next ViewEdges and returns
|
|
253
|
+
def traverse(self, it: AdjacencyIterator) -> AdjacencyIterator:
|
|
254
|
+
"""This method iterates over the potential next ViewEdges and returns
|
|
255
|
+
the one that will be followed next. Returns the next ViewEdge to
|
|
256
|
+
follow or None when the end of the chain is reached.
|
|
175
257
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
258
|
+
:param it: The iterator over the ViewEdges adjacent to the end vertex
|
|
259
|
+
of the current ViewEdge. The adjacency iterator reflects the
|
|
260
|
+
restriction rules by only iterating over the valid ViewEdges.
|
|
261
|
+
:type it: AdjacencyIterator
|
|
262
|
+
:return: Returns the next ViewEdge to follow, or None if chaining ends.
|
|
180
263
|
"""
|
|
181
264
|
...
|
|
182
265
|
|
|
183
266
|
class Curve:
|
|
184
|
-
"""Class hierarchy: `Interface1D` > `Curve`
|
|
267
|
+
"""Class hierarchy: `Interface1D` > `Curve`Base class for curves made of CurvePoints. `SVertex` is the
|
|
268
|
+
type of the initial curve vertices. A `Chain` is a
|
|
269
|
+
specialization of a Curve.
|
|
270
|
+
"""
|
|
185
271
|
|
|
186
272
|
is_empty: bool
|
|
187
273
|
""" True if the Curve doesn't have any Vertex yet.
|
|
@@ -196,50 +282,74 @@ class Curve:
|
|
|
196
282
|
"""
|
|
197
283
|
|
|
198
284
|
def __init__(self):
|
|
199
|
-
"""
|
|
285
|
+
"""Builds a `FrsCurve` using a default constructor,
|
|
286
|
+
copy constructor or from an `Id`.
|
|
287
|
+
|
|
288
|
+
"""
|
|
289
|
+
...
|
|
290
|
+
|
|
291
|
+
def __init__(self, brother: Curve):
|
|
292
|
+
"""Builds a `FrsCurve` using a default constructor,
|
|
293
|
+
copy constructor or from an `Id`.
|
|
294
|
+
|
|
295
|
+
:param brother: A Curve object.
|
|
296
|
+
:type brother: Curve
|
|
297
|
+
"""
|
|
298
|
+
...
|
|
200
299
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
300
|
+
def __init__(self, id: Id):
|
|
301
|
+
"""Builds a `FrsCurve` using a default constructor,
|
|
302
|
+
copy constructor or from an `Id`.
|
|
303
|
+
|
|
304
|
+
:param id: An Id object.
|
|
305
|
+
:type id: Id
|
|
205
306
|
"""
|
|
206
307
|
...
|
|
207
308
|
|
|
208
|
-
def push_vertex_back(self, vertex: typing.Union[
|
|
309
|
+
def push_vertex_back(self, vertex: typing.Union[SVertex, CurvePoint]):
|
|
209
310
|
"""Adds a single vertex at the end of the Curve.
|
|
210
311
|
|
|
211
312
|
:param vertex: A vertex object.
|
|
212
|
-
:type vertex: typing.Union[
|
|
313
|
+
:type vertex: typing.Union[SVertex, CurvePoint]
|
|
213
314
|
"""
|
|
214
315
|
...
|
|
215
316
|
|
|
216
|
-
def push_vertex_front(self, vertex: typing.Union[
|
|
317
|
+
def push_vertex_front(self, vertex: typing.Union[SVertex, CurvePoint]):
|
|
217
318
|
"""Adds a single vertex at the front of the Curve.
|
|
218
319
|
|
|
219
320
|
:param vertex: A vertex object.
|
|
220
|
-
:type vertex: typing.Union[
|
|
321
|
+
:type vertex: typing.Union[SVertex, CurvePoint]
|
|
221
322
|
"""
|
|
222
323
|
...
|
|
223
324
|
|
|
224
325
|
class CurvePoint:
|
|
225
|
-
"""Class hierarchy: `Interface0D` > `CurvePoint`
|
|
326
|
+
"""Class hierarchy: `Interface0D` > `CurvePoint`Class to represent a point of a curve. A CurvePoint can be any point
|
|
327
|
+
of a 1D curve (it doesn't have to be a vertex of the curve). Any
|
|
328
|
+
`Interface1D` is built upon ViewEdges, themselves built upon
|
|
329
|
+
FEdges. Therefore, a curve is basically a polyline made of a list of
|
|
330
|
+
`SVertex` objects. Thus, a CurvePoint is built by linearly
|
|
331
|
+
interpolating two `SVertex` instances. CurvePoint can be used
|
|
332
|
+
as virtual points while querying 0D information along a curve at a
|
|
333
|
+
given resolution.
|
|
334
|
+
"""
|
|
226
335
|
|
|
227
|
-
fedge:
|
|
228
|
-
""" Gets the FEdge for the two SVertices that given CurvePoints consists out of.
|
|
336
|
+
fedge: FEdge
|
|
337
|
+
""" Gets the FEdge for the two SVertices that given CurvePoints consists out of.
|
|
338
|
+
A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).
|
|
229
339
|
|
|
230
|
-
:type:
|
|
340
|
+
:type: FEdge
|
|
231
341
|
"""
|
|
232
342
|
|
|
233
|
-
first_svertex:
|
|
343
|
+
first_svertex: SVertex
|
|
234
344
|
""" The first SVertex upon which the CurvePoint is built.
|
|
235
345
|
|
|
236
|
-
:type:
|
|
346
|
+
:type: SVertex
|
|
237
347
|
"""
|
|
238
348
|
|
|
239
|
-
second_svertex:
|
|
349
|
+
second_svertex: SVertex
|
|
240
350
|
""" The second SVertex upon which the CurvePoint is built.
|
|
241
351
|
|
|
242
|
-
:type:
|
|
352
|
+
:type: SVertex
|
|
243
353
|
"""
|
|
244
354
|
|
|
245
355
|
t2d: float
|
|
@@ -249,30 +359,67 @@ class CurvePoint:
|
|
|
249
359
|
"""
|
|
250
360
|
|
|
251
361
|
def __init__(self):
|
|
252
|
-
"""
|
|
362
|
+
"""Builds a CurvePoint using the default constructor, copy constructor,
|
|
363
|
+
or one of the overloaded constructors. The over loaded constructors
|
|
364
|
+
can either take two `SVertex` or two `CurvePoint`
|
|
365
|
+
objects and an interpolation parameter
|
|
366
|
+
|
|
367
|
+
"""
|
|
368
|
+
...
|
|
369
|
+
|
|
370
|
+
def __init__(self, brother: CurvePoint):
|
|
371
|
+
"""Builds a CurvePoint using the default constructor, copy constructor,
|
|
372
|
+
or one of the overloaded constructors. The over loaded constructors
|
|
373
|
+
can either take two `SVertex` or two `CurvePoint`
|
|
374
|
+
objects and an interpolation parameter
|
|
375
|
+
|
|
376
|
+
:param brother: A CurvePoint object.
|
|
377
|
+
:type brother: CurvePoint
|
|
378
|
+
"""
|
|
379
|
+
...
|
|
380
|
+
|
|
381
|
+
def __init__(self, first_vertex: SVertex, second_vertex: SVertex, t2d: float):
|
|
382
|
+
"""Builds a CurvePoint using the default constructor, copy constructor,
|
|
383
|
+
or one of the overloaded constructors. The over loaded constructors
|
|
384
|
+
can either take two `SVertex` or two `CurvePoint`
|
|
385
|
+
objects and an interpolation parameter
|
|
386
|
+
|
|
387
|
+
:param first_vertex: The first SVertex.
|
|
388
|
+
:type first_vertex: SVertex
|
|
389
|
+
:param second_vertex: The second SVertex.
|
|
390
|
+
:type second_vertex: SVertex
|
|
391
|
+
:param t2d: A 2D interpolation parameter used to linearly interpolate
|
|
392
|
+
first_vertex and second_vertex or first_point and second_point.
|
|
393
|
+
:type t2d: float
|
|
394
|
+
"""
|
|
395
|
+
...
|
|
396
|
+
|
|
397
|
+
def __init__(self, first_point: CurvePoint, second_point: CurvePoint, t2d: float):
|
|
398
|
+
"""Builds a CurvePoint using the default constructor, copy constructor,
|
|
399
|
+
or one of the overloaded constructors. The over loaded constructors
|
|
400
|
+
can either take two `SVertex` or two `CurvePoint`
|
|
401
|
+
objects and an interpolation parameter
|
|
253
402
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
:type first_point: 'CurvePoint'
|
|
262
|
-
:param second_point: The second CurvePoint.
|
|
263
|
-
:type second_point: 'CurvePoint'
|
|
264
|
-
:param t2d: A 2D interpolation parameter used to linearly interpolate first_vertex and second_vertex or first_point and second_point.
|
|
265
|
-
:type t2d: float
|
|
403
|
+
:param first_point: The first CurvePoint.
|
|
404
|
+
:type first_point: CurvePoint
|
|
405
|
+
:param second_point: The second CurvePoint.
|
|
406
|
+
:type second_point: CurvePoint
|
|
407
|
+
:param t2d: A 2D interpolation parameter used to linearly interpolate
|
|
408
|
+
first_vertex and second_vertex or first_point and second_point.
|
|
409
|
+
:type t2d: float
|
|
266
410
|
"""
|
|
267
411
|
...
|
|
268
412
|
|
|
269
413
|
class CurvePointIterator:
|
|
270
|
-
"""Class hierarchy: `Iterator` > `CurvePointIterator`
|
|
414
|
+
"""Class hierarchy: `Iterator` > `CurvePointIterator`Class representing an iterator on a curve. Allows an iterating
|
|
415
|
+
outside initial vertices. A CurvePoint is instantiated and returned
|
|
416
|
+
through the .object attribute.
|
|
417
|
+
"""
|
|
271
418
|
|
|
272
|
-
object:
|
|
419
|
+
object: CurvePoint
|
|
273
420
|
""" The CurvePoint object currently pointed by this iterator.
|
|
274
421
|
|
|
275
|
-
:type:
|
|
422
|
+
:type: CurvePoint
|
|
276
423
|
"""
|
|
277
424
|
|
|
278
425
|
t: float
|
|
@@ -288,28 +435,54 @@ class CurvePointIterator:
|
|
|
288
435
|
"""
|
|
289
436
|
|
|
290
437
|
def __init__(self):
|
|
291
|
-
"""
|
|
438
|
+
"""Builds a CurvePointIterator object using either the default constructor,
|
|
439
|
+
copy constructor, or the overloaded constructor.
|
|
292
440
|
|
|
293
|
-
:param brother: A CurvePointIterator object.
|
|
294
|
-
:type brother: 'CurvePointIterator'
|
|
295
|
-
:param step: A resampling resolution with which the curve is resampled. If zero, no resampling is done (i.e., the iterator iterates over initial vertices).
|
|
296
|
-
:type step: float
|
|
297
441
|
"""
|
|
298
442
|
...
|
|
299
443
|
|
|
300
|
-
|
|
301
|
-
|
|
444
|
+
def __init__(self, brother: CurvePointIterator):
|
|
445
|
+
"""Builds a CurvePointIterator object using either the default constructor,
|
|
446
|
+
copy constructor, or the overloaded constructor.
|
|
447
|
+
|
|
448
|
+
:param brother: A CurvePointIterator object.
|
|
449
|
+
:type brother: CurvePointIterator
|
|
450
|
+
"""
|
|
451
|
+
...
|
|
452
|
+
|
|
453
|
+
def __init__(self, step: float = 0.0):
|
|
454
|
+
"""Builds a CurvePointIterator object using either the default constructor,
|
|
455
|
+
copy constructor, or the overloaded constructor.
|
|
456
|
+
|
|
457
|
+
:param step: A resampling resolution with which the curve is resampled.
|
|
458
|
+
If zero, no resampling is done (i.e., the iterator iterates over
|
|
459
|
+
initial vertices).
|
|
460
|
+
:type step: float
|
|
461
|
+
"""
|
|
462
|
+
...
|
|
302
463
|
|
|
303
|
-
|
|
464
|
+
class FEdge:
|
|
465
|
+
"""Class hierarchy: `Interface1D` > `FEdge`Base Class for feature edges. This FEdge can represent a silhouette,
|
|
466
|
+
a crease, a ridge/valley, a border or a suggestive contour. For
|
|
467
|
+
silhouettes, the FEdge is oriented so that the visible face lies on
|
|
468
|
+
the left of the edge. For borders, the FEdge is oriented so that the
|
|
469
|
+
face lies on the left of the edge. An FEdge can represent an initial
|
|
470
|
+
edge of the mesh or runs across a face of the initial mesh depending
|
|
471
|
+
on the smoothness or sharpness of the mesh. This class is specialized
|
|
472
|
+
into a smooth and a sharp version since their properties slightly vary
|
|
473
|
+
from one to the other.
|
|
474
|
+
"""
|
|
475
|
+
|
|
476
|
+
first_svertex: SVertex
|
|
304
477
|
""" The first SVertex constituting this FEdge.
|
|
305
478
|
|
|
306
|
-
:type:
|
|
479
|
+
:type: SVertex
|
|
307
480
|
"""
|
|
308
481
|
|
|
309
|
-
id:
|
|
482
|
+
id: Id
|
|
310
483
|
""" The Id of this FEdge.
|
|
311
484
|
|
|
312
|
-
:type:
|
|
485
|
+
:type: Id
|
|
313
486
|
"""
|
|
314
487
|
|
|
315
488
|
is_smooth: bool
|
|
@@ -318,50 +491,62 @@ class FEdge:
|
|
|
318
491
|
:type: bool
|
|
319
492
|
"""
|
|
320
493
|
|
|
321
|
-
nature:
|
|
494
|
+
nature: Nature
|
|
322
495
|
""" The nature of this FEdge.
|
|
323
496
|
|
|
324
|
-
:type:
|
|
497
|
+
:type: Nature
|
|
325
498
|
"""
|
|
326
499
|
|
|
327
|
-
next_fedge:
|
|
328
|
-
""" The FEdge following this one in the ViewEdge. The value is None if
|
|
500
|
+
next_fedge: FEdge
|
|
501
|
+
""" The FEdge following this one in the ViewEdge. The value is None if
|
|
502
|
+
this FEdge is the last of the ViewEdge.
|
|
329
503
|
|
|
330
|
-
:type:
|
|
504
|
+
:type: FEdge
|
|
331
505
|
"""
|
|
332
506
|
|
|
333
|
-
previous_fedge:
|
|
334
|
-
""" The FEdge preceding this one in the ViewEdge. The value is None if
|
|
507
|
+
previous_fedge: FEdge
|
|
508
|
+
""" The FEdge preceding this one in the ViewEdge. The value is None if
|
|
509
|
+
this FEdge is the first one of the ViewEdge.
|
|
335
510
|
|
|
336
|
-
:type:
|
|
511
|
+
:type: FEdge
|
|
337
512
|
"""
|
|
338
513
|
|
|
339
|
-
second_svertex:
|
|
514
|
+
second_svertex: SVertex
|
|
340
515
|
""" The second SVertex constituting this FEdge.
|
|
341
516
|
|
|
342
|
-
:type:
|
|
517
|
+
:type: SVertex
|
|
343
518
|
"""
|
|
344
519
|
|
|
345
|
-
viewedge:
|
|
520
|
+
viewedge: ViewEdge
|
|
346
521
|
""" The ViewEdge to which this FEdge belongs to.
|
|
347
522
|
|
|
348
|
-
:type:
|
|
523
|
+
:type: ViewEdge
|
|
349
524
|
"""
|
|
350
525
|
|
|
351
526
|
def FEdge(self):
|
|
352
|
-
"""
|
|
527
|
+
"""Builds an `FEdge` using the default constructor,
|
|
528
|
+
copy constructor, or between two `SVertex` objects.
|
|
529
|
+
|
|
530
|
+
"""
|
|
531
|
+
...
|
|
532
|
+
|
|
533
|
+
def FEdge(self, brother: FEdge):
|
|
534
|
+
"""Builds an `FEdge` using the default constructor,
|
|
535
|
+
copy constructor, or between two `SVertex` objects.
|
|
353
536
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
:param first_vertex: The first SVertex.
|
|
357
|
-
:type first_vertex: 'SVertex'
|
|
358
|
-
:param second_vertex: The second SVertex.
|
|
359
|
-
:type second_vertex: 'SVertex'
|
|
537
|
+
:param brother: An FEdge object.
|
|
538
|
+
:type brother: FEdge
|
|
360
539
|
"""
|
|
361
540
|
...
|
|
362
541
|
|
|
363
542
|
class FEdgeSharp:
|
|
364
|
-
"""Class hierarchy: `Interface1D` > `FEdge` > `FEdgeSharp`
|
|
543
|
+
"""Class hierarchy: `Interface1D` > `FEdge` > `FEdgeSharp`Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial
|
|
544
|
+
edge of the input mesh. It can be a silhouette, a crease or a border.
|
|
545
|
+
If it is a crease edge, then it is bordered by two faces of the mesh.
|
|
546
|
+
Face a lies on its right whereas Face b lies on its left. If it is a
|
|
547
|
+
border edge, then it doesn't have any face on its right, and thus Face
|
|
548
|
+
a is None.
|
|
549
|
+
"""
|
|
365
550
|
|
|
366
551
|
face_mark_left: bool
|
|
367
552
|
""" The face mark of the face lying on the left of the FEdge.
|
|
@@ -370,7 +555,9 @@ class FEdgeSharp:
|
|
|
370
555
|
"""
|
|
371
556
|
|
|
372
557
|
face_mark_right: bool
|
|
373
|
-
""" The face mark of the face lying on the right of the FEdge. If this FEdge
|
|
558
|
+
""" The face mark of the face lying on the right of the FEdge. If this FEdge
|
|
559
|
+
is a border, it has no face on the right and thus this property is set to
|
|
560
|
+
false.
|
|
374
561
|
|
|
375
562
|
:type: bool
|
|
376
563
|
"""
|
|
@@ -382,49 +569,71 @@ class FEdgeSharp:
|
|
|
382
569
|
"""
|
|
383
570
|
|
|
384
571
|
material_index_right: int
|
|
385
|
-
""" The index of the material of the face lying on the right of the FEdge.
|
|
572
|
+
""" The index of the material of the face lying on the right of the FEdge.
|
|
573
|
+
If this FEdge is a border, it has no Face on its right and therefore
|
|
574
|
+
no material.
|
|
386
575
|
|
|
387
576
|
:type: int
|
|
388
577
|
"""
|
|
389
578
|
|
|
390
|
-
material_left:
|
|
579
|
+
material_left: Material
|
|
391
580
|
""" The material of the face lying on the left of the FEdge.
|
|
392
581
|
|
|
393
|
-
:type:
|
|
582
|
+
:type: Material
|
|
394
583
|
"""
|
|
395
584
|
|
|
396
|
-
material_right:
|
|
397
|
-
""" The material of the face lying on the right of the FEdge. If this FEdge
|
|
585
|
+
material_right: Material
|
|
586
|
+
""" The material of the face lying on the right of the FEdge. If this FEdge
|
|
587
|
+
is a border, it has no Face on its right and therefore no material.
|
|
398
588
|
|
|
399
|
-
:type:
|
|
589
|
+
:type: Material
|
|
400
590
|
"""
|
|
401
591
|
|
|
402
|
-
normal_left: typing.Union[typing.Sequence[float],
|
|
592
|
+
normal_left: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
403
593
|
""" The normal to the face lying on the left of the FEdge.
|
|
404
594
|
|
|
405
|
-
:type: typing.Union[typing.Sequence[float],
|
|
595
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
406
596
|
"""
|
|
407
597
|
|
|
408
|
-
normal_right: typing.Union[typing.Sequence[float],
|
|
409
|
-
""" The normal to the face lying on the right of the FEdge. If this FEdge
|
|
598
|
+
normal_right: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
599
|
+
""" The normal to the face lying on the right of the FEdge. If this FEdge
|
|
600
|
+
is a border, it has no Face on its right and therefore no normal.
|
|
410
601
|
|
|
411
|
-
:type: typing.Union[typing.Sequence[float],
|
|
602
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
412
603
|
"""
|
|
413
604
|
|
|
414
605
|
def __init__(self):
|
|
415
|
-
"""
|
|
606
|
+
"""Builds an `FEdgeSharp` using the default constructor,
|
|
607
|
+
copy constructor, or between two `SVertex` objects.
|
|
608
|
+
|
|
609
|
+
"""
|
|
610
|
+
...
|
|
611
|
+
|
|
612
|
+
def __init__(self, brother: FEdgeSharp):
|
|
613
|
+
"""Builds an `FEdgeSharp` using the default constructor,
|
|
614
|
+
copy constructor, or between two `SVertex` objects.
|
|
416
615
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
616
|
+
:param brother: An FEdgeSharp object.
|
|
617
|
+
:type brother: FEdgeSharp
|
|
618
|
+
"""
|
|
619
|
+
...
|
|
620
|
+
|
|
621
|
+
def __init__(self, first_vertex: SVertex, second_vertex: SVertex):
|
|
622
|
+
"""Builds an `FEdgeSharp` using the default constructor,
|
|
623
|
+
copy constructor, or between two `SVertex` objects.
|
|
624
|
+
|
|
625
|
+
:param first_vertex: The first SVertex object.
|
|
626
|
+
:type first_vertex: SVertex
|
|
627
|
+
:param second_vertex: The second SVertex object.
|
|
628
|
+
:type second_vertex: SVertex
|
|
423
629
|
"""
|
|
424
630
|
...
|
|
425
631
|
|
|
426
632
|
class FEdgeSmooth:
|
|
427
|
-
"""Class hierarchy: `Interface1D` > `FEdge` > `FEdgeSmooth`
|
|
633
|
+
"""Class hierarchy: `Interface1D` > `FEdge` > `FEdgeSmooth`Class defining a smooth edge. This kind of edge typically runs across
|
|
634
|
+
a face of the input mesh. It can be a silhouette, a ridge or valley,
|
|
635
|
+
a suggestive contour.
|
|
636
|
+
"""
|
|
428
637
|
|
|
429
638
|
face_mark: bool
|
|
430
639
|
""" The face mark of the face that this FEdge is running across.
|
|
@@ -432,10 +641,10 @@ class FEdgeSmooth:
|
|
|
432
641
|
:type: bool
|
|
433
642
|
"""
|
|
434
643
|
|
|
435
|
-
material:
|
|
644
|
+
material: Material
|
|
436
645
|
""" The material of the face that this FEdge is running across.
|
|
437
646
|
|
|
438
|
-
:type:
|
|
647
|
+
:type: Material
|
|
439
648
|
"""
|
|
440
649
|
|
|
441
650
|
material_index: int
|
|
@@ -444,21 +653,36 @@ class FEdgeSmooth:
|
|
|
444
653
|
:type: int
|
|
445
654
|
"""
|
|
446
655
|
|
|
447
|
-
normal: typing.Union[typing.Sequence[float],
|
|
656
|
+
normal: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
448
657
|
""" The normal of the face that this FEdge is running across.
|
|
449
658
|
|
|
450
|
-
:type: typing.Union[typing.Sequence[float],
|
|
659
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
451
660
|
"""
|
|
452
661
|
|
|
453
662
|
def __init__(self):
|
|
454
|
-
"""
|
|
663
|
+
"""Builds an `FEdgeSmooth` using the default constructor,
|
|
664
|
+
copy constructor, or between two `SVertex`.
|
|
665
|
+
|
|
666
|
+
"""
|
|
667
|
+
...
|
|
668
|
+
|
|
669
|
+
def __init__(self, brother: FEdgeSmooth):
|
|
670
|
+
"""Builds an `FEdgeSmooth` using the default constructor,
|
|
671
|
+
copy constructor, or between two `SVertex`.
|
|
672
|
+
|
|
673
|
+
:param brother: An FEdgeSmooth object.
|
|
674
|
+
:type brother: FEdgeSmooth
|
|
675
|
+
"""
|
|
676
|
+
...
|
|
677
|
+
|
|
678
|
+
def __init__(self, first_vertex: SVertex, second_vertex: SVertex):
|
|
679
|
+
"""Builds an `FEdgeSmooth` using the default constructor,
|
|
680
|
+
copy constructor, or between two `SVertex`.
|
|
455
681
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
:param second_vertex: The second SVertex object.
|
|
461
|
-
:type second_vertex: 'SVertex'
|
|
682
|
+
:param first_vertex: The first SVertex object.
|
|
683
|
+
:type first_vertex: SVertex
|
|
684
|
+
:param second_vertex: The second SVertex object.
|
|
685
|
+
:type second_vertex: SVertex
|
|
462
686
|
"""
|
|
463
687
|
...
|
|
464
688
|
|
|
@@ -477,11 +701,16 @@ class Id:
|
|
|
477
701
|
:type: int
|
|
478
702
|
"""
|
|
479
703
|
|
|
480
|
-
def __init__(self, brother
|
|
481
|
-
"""
|
|
704
|
+
def __init__(self, brother):
|
|
705
|
+
"""Build the Id from two numbers or another `Id` using the copy constructor.
|
|
482
706
|
|
|
483
707
|
:param brother: An Id object.
|
|
484
|
-
|
|
708
|
+
"""
|
|
709
|
+
...
|
|
710
|
+
|
|
711
|
+
def __init__(self, first: int = 0, second: int = 0):
|
|
712
|
+
"""Build the Id from two numbers or another `Id` using the copy constructor.
|
|
713
|
+
|
|
485
714
|
:param first:
|
|
486
715
|
:type first: int
|
|
487
716
|
:param second: The second number.
|
|
@@ -490,17 +719,20 @@ class Id:
|
|
|
490
719
|
...
|
|
491
720
|
|
|
492
721
|
class IntegrationType:
|
|
493
|
-
"""Class hierarchy: int > `IntegrationType`
|
|
722
|
+
"""Class hierarchy: int > `IntegrationType`Different integration methods that can be invoked to integrate into a
|
|
723
|
+
single value the set of values obtained from each 0D element of an 1D
|
|
724
|
+
element:
|
|
725
|
+
"""
|
|
494
726
|
|
|
495
727
|
...
|
|
496
728
|
|
|
497
729
|
class Interface0D:
|
|
498
730
|
"""Base class for any 0D element."""
|
|
499
731
|
|
|
500
|
-
id:
|
|
732
|
+
id: Id
|
|
501
733
|
""" The Id of this 0D element.
|
|
502
734
|
|
|
503
|
-
:type:
|
|
735
|
+
:type: Id
|
|
504
736
|
"""
|
|
505
737
|
|
|
506
738
|
name: str
|
|
@@ -509,22 +741,22 @@ class Interface0D:
|
|
|
509
741
|
:type: str
|
|
510
742
|
"""
|
|
511
743
|
|
|
512
|
-
nature:
|
|
744
|
+
nature: Nature
|
|
513
745
|
""" The nature of this 0D element.
|
|
514
746
|
|
|
515
|
-
:type:
|
|
747
|
+
:type: Nature
|
|
516
748
|
"""
|
|
517
749
|
|
|
518
|
-
point_2d: typing.Union[typing.Sequence[float],
|
|
750
|
+
point_2d: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
519
751
|
""" The 2D point of this 0D element.
|
|
520
752
|
|
|
521
|
-
:type: typing.Union[typing.Sequence[float],
|
|
753
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
522
754
|
"""
|
|
523
755
|
|
|
524
|
-
point_3d: typing.Union[typing.Sequence[float],
|
|
756
|
+
point_3d: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
525
757
|
""" The 3D point of this 0D element.
|
|
526
758
|
|
|
527
|
-
:type: typing.Union[typing.Sequence[float],
|
|
759
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
528
760
|
"""
|
|
529
761
|
|
|
530
762
|
projected_x: float
|
|
@@ -549,29 +781,36 @@ class Interface0D:
|
|
|
549
781
|
"""Default constructor."""
|
|
550
782
|
...
|
|
551
783
|
|
|
552
|
-
def get_fedge(self, inter:
|
|
553
|
-
"""Returns the FEdge that lies between this 0D element and the 0D
|
|
784
|
+
def get_fedge(self, inter: Interface0D) -> Interface0D:
|
|
785
|
+
"""Returns the FEdge that lies between this 0D element and the 0D
|
|
786
|
+
element given as the argument.
|
|
554
787
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
788
|
+
:param inter: A 0D element.
|
|
789
|
+
:type inter: Interface0D
|
|
790
|
+
:return: The FEdge lying between the two 0D elements.
|
|
791
|
+
:rtype: FEdge
|
|
559
792
|
"""
|
|
560
793
|
...
|
|
561
794
|
|
|
562
795
|
class Interface0DIterator:
|
|
563
|
-
"""Class hierarchy: `Iterator` > `Interface0DIterator`
|
|
796
|
+
"""Class hierarchy: `Iterator` > `Interface0DIterator`Class defining an iterator over Interface0D elements. An instance of
|
|
797
|
+
this iterator is always obtained from a 1D element.
|
|
798
|
+
"""
|
|
564
799
|
|
|
565
800
|
at_last: bool
|
|
566
|
-
""" True if the iterator points to the last valid element.
|
|
801
|
+
""" True if the iterator points to the last valid element.
|
|
802
|
+
For its counterpart (pointing to the first valid element), use it.is_begin.
|
|
567
803
|
|
|
568
804
|
:type: bool
|
|
569
805
|
"""
|
|
570
806
|
|
|
571
|
-
object:
|
|
572
|
-
""" The 0D object currently pointed to by this iterator. Note that the object
|
|
807
|
+
object: Interface0D
|
|
808
|
+
""" The 0D object currently pointed to by this iterator. Note that the object
|
|
809
|
+
may be an instance of an Interface0D subclass. For example if the iterator
|
|
810
|
+
has been created from the vertices_begin() method of the `Stroke`
|
|
811
|
+
class, the .object property refers to a `StrokeVertex` object.
|
|
573
812
|
|
|
574
|
-
:type:
|
|
813
|
+
:type: Interface0D
|
|
575
814
|
"""
|
|
576
815
|
|
|
577
816
|
t: float
|
|
@@ -586,23 +825,31 @@ class Interface0DIterator:
|
|
|
586
825
|
:type: float
|
|
587
826
|
"""
|
|
588
827
|
|
|
589
|
-
def __init__(self, brother:
|
|
590
|
-
"""
|
|
828
|
+
def __init__(self, brother: Interface0DIterator):
|
|
829
|
+
"""Construct a nested Interface0DIterator using either the copy constructor
|
|
830
|
+
or the constructor that takes an he argument of a Function0D.
|
|
831
|
+
|
|
832
|
+
:param brother: An Interface0DIterator object.
|
|
833
|
+
:type brother: Interface0DIterator
|
|
834
|
+
"""
|
|
835
|
+
...
|
|
836
|
+
|
|
837
|
+
def __init__(self, it: typing.Union[SVertexIterator, CurvePointIterator]):
|
|
838
|
+
"""Construct a nested Interface0DIterator using either the copy constructor
|
|
839
|
+
or the constructor that takes an he argument of a Function0D.
|
|
591
840
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
:param it: An iterator object to be nested.
|
|
595
|
-
:type it: typing.Union['SVertexIterator', 'CurvePointIterator', typing.Any, 'StrokeVertexIterator']
|
|
841
|
+
:param it: An iterator object to be nested.
|
|
842
|
+
:type it: typing.Union[SVertexIterator, CurvePointIterator]
|
|
596
843
|
"""
|
|
597
844
|
...
|
|
598
845
|
|
|
599
846
|
class Interface1D:
|
|
600
847
|
"""Base class for any 1D element."""
|
|
601
848
|
|
|
602
|
-
id:
|
|
849
|
+
id: Id
|
|
603
850
|
""" The Id of this Interface1D.
|
|
604
851
|
|
|
605
|
-
:type:
|
|
852
|
+
:type: Id
|
|
606
853
|
"""
|
|
607
854
|
|
|
608
855
|
length_2d: float
|
|
@@ -617,10 +864,10 @@ class Interface1D:
|
|
|
617
864
|
:type: str
|
|
618
865
|
"""
|
|
619
866
|
|
|
620
|
-
nature:
|
|
867
|
+
nature: Nature
|
|
621
868
|
""" The nature of this Interface1D.
|
|
622
869
|
|
|
623
|
-
:type:
|
|
870
|
+
:type: Nature
|
|
624
871
|
"""
|
|
625
872
|
|
|
626
873
|
time_stamp: int
|
|
@@ -633,39 +880,49 @@ class Interface1D:
|
|
|
633
880
|
"""Default constructor."""
|
|
634
881
|
...
|
|
635
882
|
|
|
636
|
-
def points_begin(self, t: float = 0.0) ->
|
|
637
|
-
"""Returns an iterator over the Interface1D points, pointing to the
|
|
883
|
+
def points_begin(self, t: float = 0.0) -> float:
|
|
884
|
+
"""Returns an iterator over the Interface1D points, pointing to the
|
|
885
|
+
first point. The difference with vertices_begin() is that here we can
|
|
886
|
+
iterate over points of the 1D element at a any given sampling.
|
|
887
|
+
Indeed, for each iteration, a virtual point is created.
|
|
638
888
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
889
|
+
:param t: A sampling with which we want to iterate over points of
|
|
890
|
+
this 1D element.
|
|
891
|
+
:type t: float
|
|
892
|
+
:return: An Interface0DIterator pointing to the first point.
|
|
893
|
+
:rtype: Interface0DIterator
|
|
643
894
|
"""
|
|
644
895
|
...
|
|
645
896
|
|
|
646
|
-
def points_end(self, t: float = 0.0) ->
|
|
647
|
-
"""Returns an iterator over the Interface1D points, pointing after the
|
|
897
|
+
def points_end(self, t: float = 0.0) -> float:
|
|
898
|
+
"""Returns an iterator over the Interface1D points, pointing after the
|
|
899
|
+
last point. The difference with vertices_end() is that here we can
|
|
900
|
+
iterate over points of the 1D element at a given sampling. Indeed,
|
|
901
|
+
for each iteration, a virtual point is created.
|
|
648
902
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
903
|
+
:param t: A sampling with which we want to iterate over points of
|
|
904
|
+
this 1D element.
|
|
905
|
+
:type t: float
|
|
906
|
+
:return: An Interface0DIterator pointing after the last point.
|
|
907
|
+
:rtype: Interface0DIterator
|
|
653
908
|
"""
|
|
654
909
|
...
|
|
655
910
|
|
|
656
|
-
def vertices_begin(self) ->
|
|
657
|
-
"""Returns an iterator over the Interface1D vertices, pointing to the
|
|
911
|
+
def vertices_begin(self) -> Interface0DIterator:
|
|
912
|
+
"""Returns an iterator over the Interface1D vertices, pointing to the
|
|
913
|
+
first vertex.
|
|
658
914
|
|
|
659
|
-
|
|
660
|
-
|
|
915
|
+
:return: An Interface0DIterator pointing to the first vertex.
|
|
916
|
+
:rtype: Interface0DIterator
|
|
661
917
|
"""
|
|
662
918
|
...
|
|
663
919
|
|
|
664
|
-
def vertices_end(self) ->
|
|
665
|
-
"""Returns an iterator over the Interface1D vertices, pointing after
|
|
920
|
+
def vertices_end(self) -> Interface0DIterator:
|
|
921
|
+
"""Returns an iterator over the Interface1D vertices, pointing after
|
|
922
|
+
the last vertex.
|
|
666
923
|
|
|
667
|
-
|
|
668
|
-
|
|
924
|
+
:return: An Interface0DIterator pointing after the last vertex.
|
|
925
|
+
:rtype: Interface0DIterator
|
|
669
926
|
"""
|
|
670
927
|
...
|
|
671
928
|
|
|
@@ -705,28 +962,28 @@ class Iterator:
|
|
|
705
962
|
class Material:
|
|
706
963
|
"""Class defining a material."""
|
|
707
964
|
|
|
708
|
-
ambient: typing.Union[typing.Sequence[float],
|
|
965
|
+
ambient: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
709
966
|
""" RGBA components of the ambient color of the material.
|
|
710
967
|
|
|
711
|
-
:type: typing.Union[typing.Sequence[float],
|
|
968
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
712
969
|
"""
|
|
713
970
|
|
|
714
|
-
diffuse: typing.Union[typing.Sequence[float],
|
|
971
|
+
diffuse: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
715
972
|
""" RGBA components of the diffuse color of the material.
|
|
716
973
|
|
|
717
|
-
:type: typing.Union[typing.Sequence[float],
|
|
974
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
718
975
|
"""
|
|
719
976
|
|
|
720
|
-
emission: typing.Union[typing.Sequence[float],
|
|
977
|
+
emission: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
721
978
|
""" RGBA components of the emissive color of the material.
|
|
722
979
|
|
|
723
|
-
:type: typing.Union[typing.Sequence[float],
|
|
980
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
724
981
|
"""
|
|
725
982
|
|
|
726
|
-
line: typing.Union[typing.Sequence[float],
|
|
983
|
+
line: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
727
984
|
""" RGBA components of the line color of the material.
|
|
728
985
|
|
|
729
|
-
:type: typing.Union[typing.Sequence[float],
|
|
986
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
730
987
|
"""
|
|
731
988
|
|
|
732
989
|
priority: int
|
|
@@ -741,52 +998,80 @@ class Material:
|
|
|
741
998
|
:type: float
|
|
742
999
|
"""
|
|
743
1000
|
|
|
744
|
-
specular: typing.Union[typing.Sequence[float],
|
|
1001
|
+
specular: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
745
1002
|
""" RGBA components of the specular color of the material.
|
|
746
1003
|
|
|
747
|
-
:type: typing.Union[typing.Sequence[float],
|
|
1004
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
748
1005
|
"""
|
|
749
1006
|
|
|
750
1007
|
def __init__(self):
|
|
751
|
-
"""
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
:
|
|
1008
|
+
"""Creates a `FrsMaterial` using either default constructor,
|
|
1009
|
+
copy constructor, or an overloaded constructor
|
|
1010
|
+
|
|
1011
|
+
"""
|
|
1012
|
+
...
|
|
1013
|
+
|
|
1014
|
+
def __init__(self, brother: Material):
|
|
1015
|
+
"""Creates a `FrsMaterial` using either default constructor,
|
|
1016
|
+
copy constructor, or an overloaded constructor
|
|
1017
|
+
|
|
1018
|
+
:param brother: A Material object to be used as a copy constructor.
|
|
1019
|
+
:type brother: Material
|
|
1020
|
+
"""
|
|
1021
|
+
...
|
|
1022
|
+
|
|
1023
|
+
def __init__(
|
|
1024
|
+
self,
|
|
1025
|
+
line: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1026
|
+
diffuse: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1027
|
+
ambient: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1028
|
+
specular: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1029
|
+
emission: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1030
|
+
shininess: float,
|
|
1031
|
+
priority: int,
|
|
1032
|
+
):
|
|
1033
|
+
"""Creates a `FrsMaterial` using either default constructor,
|
|
1034
|
+
copy constructor, or an overloaded constructor
|
|
1035
|
+
|
|
1036
|
+
:param line: The line color.
|
|
1037
|
+
:type line: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1038
|
+
:param diffuse: The diffuse color.
|
|
1039
|
+
:type diffuse: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1040
|
+
:param ambient: The ambient color.
|
|
1041
|
+
:type ambient: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1042
|
+
:param specular: The specular color.
|
|
1043
|
+
:type specular: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1044
|
+
:param emission: The emissive color.
|
|
1045
|
+
:type emission: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1046
|
+
:param shininess: The shininess coefficient.
|
|
1047
|
+
:type shininess: float
|
|
1048
|
+
:param priority: The line color priority.
|
|
1049
|
+
:type priority: int
|
|
769
1050
|
"""
|
|
770
1051
|
...
|
|
771
1052
|
|
|
772
1053
|
class MediumType:
|
|
773
|
-
"""Class hierarchy: int > `MediumType`
|
|
1054
|
+
"""Class hierarchy: int > `MediumType`The different blending modes available to simulate the interaction
|
|
1055
|
+
media-medium:
|
|
1056
|
+
"""
|
|
774
1057
|
|
|
775
1058
|
...
|
|
776
1059
|
|
|
777
1060
|
class Nature:
|
|
778
|
-
"""Class hierarchy: int > `Nature`
|
|
1061
|
+
"""Class hierarchy: int > `Nature`Different possible natures of 0D and 1D elements of the ViewMap.Vertex natures:Edge natures:"""
|
|
779
1062
|
|
|
780
1063
|
...
|
|
781
1064
|
|
|
782
1065
|
class Noise:
|
|
783
|
-
"""Class to provide Perlin noise functionalities.
|
|
1066
|
+
"""Class to provide Perlin noise functionalities.Undocumented, consider contributing.Undocumented, consider contributing."""
|
|
784
1067
|
|
|
785
|
-
def __init__(self, seed=
|
|
786
|
-
"""Builds a Noise object. Seed is an optional argument. The seed value is used
|
|
1068
|
+
def __init__(self, seed: int = -1):
|
|
1069
|
+
"""Builds a Noise object. Seed is an optional argument. The seed value is used
|
|
1070
|
+
as a seed for random number generation if it is equal to or greater than zero;
|
|
1071
|
+
otherwise, time is used as a seed.
|
|
787
1072
|
|
|
788
|
-
|
|
789
|
-
|
|
1073
|
+
:param seed: Seed for random number generation.
|
|
1074
|
+
:type seed: int
|
|
790
1075
|
"""
|
|
791
1076
|
...
|
|
792
1077
|
|
|
@@ -795,36 +1080,36 @@ class Noise:
|
|
|
795
1080
|
|
|
796
1081
|
:param v: One-dimensional sample point.
|
|
797
1082
|
:type v: float
|
|
798
|
-
:rtype: float
|
|
799
1083
|
:return: A smooth noise value.
|
|
1084
|
+
:rtype: float
|
|
800
1085
|
"""
|
|
801
1086
|
...
|
|
802
1087
|
|
|
803
1088
|
def smoothNoise2(
|
|
804
|
-
self, v: typing.Union[typing.Sequence[float],
|
|
805
|
-
) -> float:
|
|
1089
|
+
self, v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1090
|
+
) -> typing.Union[typing.Sequence[float], mathutils.Vector, list]:
|
|
806
1091
|
"""Returns a smooth noise value for a 2D element.
|
|
807
1092
|
|
|
808
1093
|
:param v: Two-dimensional sample point.
|
|
809
|
-
:type v: typing.Union[typing.Sequence[float],
|
|
810
|
-
:rtype: float
|
|
1094
|
+
:type v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
811
1095
|
:return: A smooth noise value.
|
|
1096
|
+
:rtype: float
|
|
812
1097
|
"""
|
|
813
1098
|
...
|
|
814
1099
|
|
|
815
1100
|
def smoothNoise3(
|
|
816
|
-
self, v: typing.Union[typing.Sequence[float],
|
|
817
|
-
) -> float:
|
|
1101
|
+
self, v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1102
|
+
) -> typing.Union[typing.Sequence[float], mathutils.Vector, list]:
|
|
818
1103
|
"""Returns a smooth noise value for a 3D element.
|
|
819
1104
|
|
|
820
1105
|
:param v: Three-dimensional sample point.
|
|
821
|
-
:type v: typing.Union[typing.Sequence[float],
|
|
822
|
-
:rtype: float
|
|
1106
|
+
:type v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
823
1107
|
:return: A smooth noise value.
|
|
1108
|
+
:rtype: float
|
|
824
1109
|
"""
|
|
825
1110
|
...
|
|
826
1111
|
|
|
827
|
-
def turbulence1(self, v: float, freq: float, amp: float, oct: int = 4) ->
|
|
1112
|
+
def turbulence1(self, v: float, freq: float, amp: float, oct: int = 4) -> int:
|
|
828
1113
|
"""Returns a noise value for a 1D element.
|
|
829
1114
|
|
|
830
1115
|
:param v: One-dimensional sample point.
|
|
@@ -835,151 +1120,219 @@ class Noise:
|
|
|
835
1120
|
:type amp: float
|
|
836
1121
|
:param oct: Number of octaves.
|
|
837
1122
|
:type oct: int
|
|
838
|
-
:rtype: float
|
|
839
1123
|
:return: A noise value.
|
|
1124
|
+
:rtype: float
|
|
840
1125
|
"""
|
|
841
1126
|
...
|
|
842
1127
|
|
|
843
1128
|
def turbulence2(
|
|
844
1129
|
self,
|
|
845
|
-
v: typing.Union[typing.Sequence[float],
|
|
1130
|
+
v: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
846
1131
|
freq: float,
|
|
847
1132
|
amp: float,
|
|
848
1133
|
oct: int = 4,
|
|
849
|
-
) ->
|
|
1134
|
+
) -> int:
|
|
850
1135
|
"""Returns a noise value for a 2D element.
|
|
851
1136
|
|
|
852
1137
|
:param v: Two-dimensional sample point.
|
|
853
|
-
:type v: typing.Union[typing.Sequence[float],
|
|
1138
|
+
:type v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
854
1139
|
:param freq: Noise frequency.
|
|
855
1140
|
:type freq: float
|
|
856
1141
|
:param amp: Amplitude.
|
|
857
1142
|
:type amp: float
|
|
858
1143
|
:param oct: Number of octaves.
|
|
859
1144
|
:type oct: int
|
|
860
|
-
:rtype: float
|
|
861
1145
|
:return: A noise value.
|
|
1146
|
+
:rtype: float
|
|
862
1147
|
"""
|
|
863
1148
|
...
|
|
864
1149
|
|
|
865
1150
|
def turbulence3(
|
|
866
1151
|
self,
|
|
867
|
-
v: typing.Union[typing.Sequence[float],
|
|
1152
|
+
v: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
868
1153
|
freq: float,
|
|
869
1154
|
amp: float,
|
|
870
1155
|
oct: int = 4,
|
|
871
|
-
) ->
|
|
1156
|
+
) -> int:
|
|
872
1157
|
"""Returns a noise value for a 3D element.
|
|
873
1158
|
|
|
874
1159
|
:param v: Three-dimensional sample point.
|
|
875
|
-
:type v: typing.Union[typing.Sequence[float],
|
|
1160
|
+
:type v: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
876
1161
|
:param freq: Noise frequency.
|
|
877
1162
|
:type freq: float
|
|
878
1163
|
:param amp: Amplitude.
|
|
879
1164
|
:type amp: float
|
|
880
1165
|
:param oct: Number of octaves.
|
|
881
1166
|
:type oct: int
|
|
882
|
-
:rtype: float
|
|
883
1167
|
:return: A noise value.
|
|
1168
|
+
:rtype: float
|
|
884
1169
|
"""
|
|
885
1170
|
...
|
|
886
1171
|
|
|
887
1172
|
class NonTVertex:
|
|
888
|
-
"""Class hierarchy: `Interface0D` > `ViewVertex` > `NonTVertex`
|
|
1173
|
+
"""Class hierarchy: `Interface0D` > `ViewVertex` > `NonTVertex`View vertex for corners, cusps, etc. associated to a single SVertex.
|
|
1174
|
+
Can be associated to 2 or more view edges.
|
|
1175
|
+
"""
|
|
889
1176
|
|
|
890
|
-
svertex:
|
|
1177
|
+
svertex: SVertex
|
|
891
1178
|
""" The SVertex on top of which this NonTVertex is built.
|
|
892
1179
|
|
|
893
|
-
:type:
|
|
1180
|
+
:type: SVertex
|
|
894
1181
|
"""
|
|
895
1182
|
|
|
896
1183
|
def __init__(self):
|
|
897
|
-
"""
|
|
1184
|
+
"""Builds a `NonTVertex` using the default constructor or a `SVertex`."""
|
|
1185
|
+
...
|
|
1186
|
+
|
|
1187
|
+
def __init__(self, svertex: SVertex):
|
|
1188
|
+
"""Builds a `NonTVertex` using the default constructor or a `SVertex`.
|
|
898
1189
|
|
|
899
1190
|
:param svertex: An SVertex object.
|
|
900
|
-
:type svertex:
|
|
1191
|
+
:type svertex: SVertex
|
|
901
1192
|
"""
|
|
902
1193
|
...
|
|
903
1194
|
|
|
904
1195
|
class Operators:
|
|
905
|
-
"""Class defining the operators used in a style module. There are five
|
|
1196
|
+
"""Class defining the operators used in a style module. There are five
|
|
1197
|
+
types of operators: Selection, chaining, splitting, sorting and
|
|
1198
|
+
creation. All these operators are user controlled through functors,
|
|
1199
|
+
predicates and shaders that are taken as arguments.
|
|
1200
|
+
"""
|
|
1201
|
+
|
|
1202
|
+
@staticmethod
|
|
1203
|
+
def bidirectional_chain(it: ChainingIterator, pred: UnaryPredicate1D):
|
|
1204
|
+
"""Builds a set of chains from the current set of ViewEdges. Each
|
|
1205
|
+
ViewEdge of the current list potentially starts a new chain. The
|
|
1206
|
+
chaining operator then iterates over the ViewEdges of the ViewMap
|
|
1207
|
+
using the user specified iterator. This operator iterates both using
|
|
1208
|
+
the increment and decrement operators and is therefore bidirectional.
|
|
1209
|
+
This operator works with a ChainingIterator which contains the
|
|
1210
|
+
chaining rules. It is this last one which can be told to chain only
|
|
1211
|
+
edges that belong to the selection or not to process twice a ViewEdge
|
|
1212
|
+
during the chaining. Each time a ViewEdge is added to a chain, its
|
|
1213
|
+
chaining time stamp is incremented. This allows you to keep track of
|
|
1214
|
+
the number of chains to which a ViewEdge belongs to.
|
|
1215
|
+
|
|
1216
|
+
:param it: The ChainingIterator on the ViewEdges of the ViewMap. It
|
|
1217
|
+
contains the chaining rule.
|
|
1218
|
+
:type it: ChainingIterator
|
|
1219
|
+
:param pred: The predicate on the ViewEdge that expresses the stopping condition.
|
|
1220
|
+
This parameter is optional, you make not want to pass a stopping criterion
|
|
1221
|
+
when the stopping criterion is already contained in the iterator definition.
|
|
1222
|
+
:type pred: UnaryPredicate1D
|
|
1223
|
+
"""
|
|
1224
|
+
...
|
|
906
1225
|
|
|
907
1226
|
@staticmethod
|
|
908
|
-
def bidirectional_chain(it:
|
|
909
|
-
"""
|
|
1227
|
+
def bidirectional_chain(it: ChainingIterator):
|
|
1228
|
+
"""Builds a set of chains from the current set of ViewEdges. Each
|
|
1229
|
+
ViewEdge of the current list potentially starts a new chain. The
|
|
1230
|
+
chaining operator then iterates over the ViewEdges of the ViewMap
|
|
1231
|
+
using the user specified iterator. This operator iterates both using
|
|
1232
|
+
the increment and decrement operators and is therefore bidirectional.
|
|
1233
|
+
This operator works with a ChainingIterator which contains the
|
|
1234
|
+
chaining rules. It is this last one which can be told to chain only
|
|
1235
|
+
edges that belong to the selection or not to process twice a ViewEdge
|
|
1236
|
+
during the chaining. Each time a ViewEdge is added to a chain, its
|
|
1237
|
+
chaining time stamp is incremented. This allows you to keep track of
|
|
1238
|
+
the number of chains to which a ViewEdge belongs to.
|
|
910
1239
|
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
:type pred: 'UnaryPredicate1D'
|
|
1240
|
+
:param it: The ChainingIterator on the ViewEdges of the ViewMap. It
|
|
1241
|
+
contains the chaining rule.
|
|
1242
|
+
:type it: ChainingIterator
|
|
915
1243
|
"""
|
|
916
1244
|
...
|
|
917
1245
|
|
|
918
1246
|
@staticmethod
|
|
919
1247
|
def chain(
|
|
920
|
-
it:
|
|
921
|
-
pred: "UnaryPredicate1D",
|
|
922
|
-
modifier: "UnaryFunction1DVoid",
|
|
1248
|
+
it: ViewEdgeIterator, pred: UnaryPredicate1D, modifier: UnaryFunction1DVoid
|
|
923
1249
|
):
|
|
924
|
-
"""
|
|
1250
|
+
"""Builds a set of chains from the current set of ViewEdges. Each
|
|
1251
|
+
ViewEdge of the current list starts a new chain. The chaining
|
|
1252
|
+
operator then iterates over the ViewEdges of the ViewMap using the
|
|
1253
|
+
user specified iterator. This operator only iterates using the
|
|
1254
|
+
increment operator and is therefore unidirectional.
|
|
1255
|
+
|
|
1256
|
+
:param it: The iterator on the ViewEdges of the ViewMap. It contains
|
|
1257
|
+
the chaining rule.
|
|
1258
|
+
:type it: ViewEdgeIterator
|
|
1259
|
+
:param pred: The predicate on the ViewEdge that expresses the
|
|
1260
|
+
stopping condition.
|
|
1261
|
+
:type pred: UnaryPredicate1D
|
|
1262
|
+
:param modifier: A function that takes a ViewEdge as argument and
|
|
1263
|
+
that is used to modify the processed ViewEdge state (the
|
|
1264
|
+
timestamp incrementation is a typical illustration of such a modifier).
|
|
1265
|
+
If this argument is not given, the time stamp is automatically managed.
|
|
1266
|
+
:type modifier: UnaryFunction1DVoid
|
|
1267
|
+
"""
|
|
1268
|
+
...
|
|
1269
|
+
|
|
1270
|
+
@staticmethod
|
|
1271
|
+
def chain(it: ViewEdgeIterator, pred: UnaryPredicate1D):
|
|
1272
|
+
"""Builds a set of chains from the current set of ViewEdges. Each
|
|
1273
|
+
ViewEdge of the current list starts a new chain. The chaining
|
|
1274
|
+
operator then iterates over the ViewEdges of the ViewMap using the
|
|
1275
|
+
user specified iterator. This operator only iterates using the
|
|
1276
|
+
increment operator and is therefore unidirectional.
|
|
925
1277
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1278
|
+
:param it: The iterator on the ViewEdges of the ViewMap. It contains
|
|
1279
|
+
the chaining rule.
|
|
1280
|
+
:type it: ViewEdgeIterator
|
|
1281
|
+
:param pred: The predicate on the ViewEdge that expresses the
|
|
1282
|
+
stopping condition.
|
|
1283
|
+
:type pred: UnaryPredicate1D
|
|
932
1284
|
"""
|
|
933
1285
|
...
|
|
934
1286
|
|
|
935
1287
|
@staticmethod
|
|
936
|
-
def create(pred:
|
|
937
|
-
"""Creates and shades the strokes from the current set of chains. A
|
|
1288
|
+
def create(pred: UnaryPredicate1D, shaders):
|
|
1289
|
+
"""Creates and shades the strokes from the current set of chains. A
|
|
1290
|
+
predicate can be specified to make a selection pass on the chains.
|
|
938
1291
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1292
|
+
:param pred: The predicate that a chain must verify in order to be
|
|
1293
|
+
transform as a stroke.
|
|
1294
|
+
:type pred: UnaryPredicate1D
|
|
1295
|
+
:param shaders: The list of shaders used to shade the strokes.
|
|
943
1296
|
"""
|
|
944
1297
|
...
|
|
945
1298
|
|
|
946
1299
|
@staticmethod
|
|
947
|
-
def get_chain_from_index(i: int) ->
|
|
1300
|
+
def get_chain_from_index(i: int) -> int:
|
|
948
1301
|
"""Returns the Chain at the index in the current set of Chains.
|
|
949
1302
|
|
|
950
1303
|
:param i: index (0 <= i < Operators.get_chains_size()).
|
|
951
1304
|
:type i: int
|
|
952
|
-
:rtype: 'Chain'
|
|
953
1305
|
:return: The Chain object.
|
|
1306
|
+
:rtype: Chain
|
|
954
1307
|
"""
|
|
955
1308
|
...
|
|
956
1309
|
|
|
957
1310
|
@staticmethod
|
|
958
|
-
def get_chains_size() ->
|
|
1311
|
+
def get_chains_size() -> Chain:
|
|
959
1312
|
"""Returns the number of Chains.
|
|
960
1313
|
|
|
961
|
-
:rtype: int
|
|
962
1314
|
:return: The number of Chains.
|
|
1315
|
+
:rtype: int
|
|
963
1316
|
"""
|
|
964
1317
|
...
|
|
965
1318
|
|
|
966
1319
|
@staticmethod
|
|
967
|
-
def get_stroke_from_index(i: int) ->
|
|
1320
|
+
def get_stroke_from_index(i: int) -> int:
|
|
968
1321
|
"""Returns the Stroke at the index in the current set of Strokes.
|
|
969
1322
|
|
|
970
1323
|
:param i: index (0 <= i < Operators.get_strokes_size()).
|
|
971
1324
|
:type i: int
|
|
972
|
-
:rtype: 'Stroke'
|
|
973
1325
|
:return: The Stroke object.
|
|
1326
|
+
:rtype: Stroke
|
|
974
1327
|
"""
|
|
975
1328
|
...
|
|
976
1329
|
|
|
977
1330
|
@staticmethod
|
|
978
|
-
def get_strokes_size() ->
|
|
1331
|
+
def get_strokes_size() -> Stroke:
|
|
979
1332
|
"""Returns the number of Strokes.
|
|
980
1333
|
|
|
981
|
-
:rtype: int
|
|
982
1334
|
:return: The number of Strokes.
|
|
1335
|
+
:rtype: int
|
|
983
1336
|
"""
|
|
984
1337
|
...
|
|
985
1338
|
|
|
@@ -987,106 +1340,186 @@ class Operators:
|
|
|
987
1340
|
def get_view_edges_size() -> int:
|
|
988
1341
|
"""Returns the number of ViewEdges.
|
|
989
1342
|
|
|
990
|
-
:rtype: int
|
|
991
1343
|
:return: The number of ViewEdges.
|
|
1344
|
+
:rtype: int
|
|
992
1345
|
"""
|
|
993
1346
|
...
|
|
994
1347
|
|
|
995
1348
|
@staticmethod
|
|
996
|
-
def get_viewedge_from_index(i: int) ->
|
|
1349
|
+
def get_viewedge_from_index(i: int) -> int:
|
|
997
1350
|
"""Returns the ViewEdge at the index in the current set of ViewEdges.
|
|
998
1351
|
|
|
999
1352
|
:param i: index (0 <= i < Operators.get_view_edges_size()).
|
|
1000
1353
|
:type i: int
|
|
1001
|
-
:rtype: 'ViewEdge'
|
|
1002
1354
|
:return: The ViewEdge object.
|
|
1355
|
+
:rtype: ViewEdge
|
|
1003
1356
|
"""
|
|
1004
1357
|
...
|
|
1005
1358
|
|
|
1006
1359
|
@staticmethod
|
|
1007
1360
|
def recursive_split(
|
|
1008
|
-
func:
|
|
1009
|
-
pred_1d: "UnaryPredicate1D",
|
|
1010
|
-
sampling: float = 0.0,
|
|
1361
|
+
func: UnaryFunction0DDouble, pred_1d: UnaryPredicate1D, sampling: float = 0.0
|
|
1011
1362
|
):
|
|
1012
|
-
"""
|
|
1363
|
+
"""Splits the current set of chains in a recursive way. We process the
|
|
1364
|
+
points of each chain (with a specified sampling) to find the point
|
|
1365
|
+
minimizing a specified function. The chain is split in two at this
|
|
1366
|
+
point and the two new chains are processed in the same way. The
|
|
1367
|
+
recursivity level is controlled through a predicate 1D that expresses
|
|
1368
|
+
a stopping condition on the chain that is about to be processed.The user can also specify a 0D predicate to make a first selection on the points
|
|
1369
|
+
that can potentially be split. A point that doesn't verify the 0D
|
|
1370
|
+
predicate won't be candidate in realizing the min.
|
|
1371
|
+
|
|
1372
|
+
:param func: The Unary Function evaluated at each point of the chain.
|
|
1373
|
+
The splitting point is the point minimizing this function.
|
|
1374
|
+
:type func: UnaryFunction0DDouble
|
|
1375
|
+
:param pred_1d: The Unary Predicate expressing the recursivity stopping
|
|
1376
|
+
condition. This predicate is evaluated for each curve before it
|
|
1377
|
+
actually gets split. If pred_1d(chain) is true, the curve won't be
|
|
1378
|
+
split anymore.
|
|
1379
|
+
:type pred_1d: UnaryPredicate1D
|
|
1380
|
+
:param sampling: The resolution used to sample the chain for the
|
|
1381
|
+
predicates evaluation. (The chain is not actually resampled; a
|
|
1382
|
+
virtual point only progresses along the curve using this
|
|
1383
|
+
resolution.)
|
|
1384
|
+
:type sampling: float
|
|
1385
|
+
"""
|
|
1386
|
+
...
|
|
1013
1387
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
:
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
:
|
|
1020
|
-
|
|
1021
|
-
|
|
1388
|
+
@staticmethod
|
|
1389
|
+
def recursive_split(
|
|
1390
|
+
func: UnaryFunction0DDouble,
|
|
1391
|
+
pred_0d: UnaryPredicate0D,
|
|
1392
|
+
pred_1d: UnaryPredicate1D,
|
|
1393
|
+
sampling: float = 0.0,
|
|
1394
|
+
):
|
|
1395
|
+
"""Splits the current set of chains in a recursive way. We process the
|
|
1396
|
+
points of each chain (with a specified sampling) to find the point
|
|
1397
|
+
minimizing a specified function. The chain is split in two at this
|
|
1398
|
+
point and the two new chains are processed in the same way. The
|
|
1399
|
+
recursivity level is controlled through a predicate 1D that expresses
|
|
1400
|
+
a stopping condition on the chain that is about to be processed.The user can also specify a 0D predicate to make a first selection on the points
|
|
1401
|
+
that can potentially be split. A point that doesn't verify the 0D
|
|
1402
|
+
predicate won't be candidate in realizing the min.
|
|
1403
|
+
|
|
1404
|
+
:param func: The Unary Function evaluated at each point of the chain.
|
|
1405
|
+
The splitting point is the point minimizing this function.
|
|
1406
|
+
:type func: UnaryFunction0DDouble
|
|
1407
|
+
:param pred_0d: The Unary Predicate 0D used to select the candidate
|
|
1408
|
+
points where the split can occur. For example, it is very likely
|
|
1409
|
+
that would rather have your chain splitting around its middle
|
|
1410
|
+
point than around one of its extremities. A 0D predicate working
|
|
1411
|
+
on the curvilinear abscissa allows to add this kind of constraints.
|
|
1412
|
+
:type pred_0d: UnaryPredicate0D
|
|
1413
|
+
:param pred_1d: The Unary Predicate expressing the recursivity stopping
|
|
1414
|
+
condition. This predicate is evaluated for each curve before it
|
|
1415
|
+
actually gets split. If pred_1d(chain) is true, the curve won't be
|
|
1416
|
+
split anymore.
|
|
1417
|
+
:type pred_1d: UnaryPredicate1D
|
|
1418
|
+
:param sampling: The resolution used to sample the chain for the
|
|
1419
|
+
predicates evaluation. (The chain is not actually resampled; a
|
|
1420
|
+
virtual point only progresses along the curve using this
|
|
1421
|
+
resolution.)
|
|
1422
|
+
:type sampling: float
|
|
1022
1423
|
"""
|
|
1023
1424
|
...
|
|
1024
1425
|
|
|
1025
1426
|
@staticmethod
|
|
1026
1427
|
def reset(delete_strokes: bool = True):
|
|
1027
|
-
"""Resets the line stylization process to the initial state. The results of
|
|
1428
|
+
"""Resets the line stylization process to the initial state. The results of
|
|
1429
|
+
stroke creation are accumulated if delete_strokes is set to False.
|
|
1028
1430
|
|
|
1029
|
-
|
|
1030
|
-
|
|
1431
|
+
:param delete_strokes: Delete the strokes that are currently stored.
|
|
1432
|
+
:type delete_strokes: bool
|
|
1031
1433
|
"""
|
|
1032
1434
|
...
|
|
1033
1435
|
|
|
1034
1436
|
@staticmethod
|
|
1035
|
-
def select(pred:
|
|
1036
|
-
"""Selects the ViewEdges of the ViewMap verifying a specified
|
|
1437
|
+
def select(pred: UnaryPredicate1D):
|
|
1438
|
+
"""Selects the ViewEdges of the ViewMap verifying a specified
|
|
1439
|
+
condition.
|
|
1037
1440
|
|
|
1038
|
-
|
|
1039
|
-
|
|
1441
|
+
:param pred: The predicate expressing this condition.
|
|
1442
|
+
:type pred: UnaryPredicate1D
|
|
1040
1443
|
"""
|
|
1041
1444
|
...
|
|
1042
1445
|
|
|
1043
1446
|
@staticmethod
|
|
1044
1447
|
def sequential_split(
|
|
1045
|
-
starting_pred:
|
|
1046
|
-
stopping_pred:
|
|
1448
|
+
starting_pred: UnaryPredicate0D,
|
|
1449
|
+
stopping_pred: UnaryPredicate0D,
|
|
1047
1450
|
sampling: float = 0.0,
|
|
1048
1451
|
):
|
|
1049
|
-
"""
|
|
1452
|
+
"""Splits each chain of the current set of chains in a sequential way.
|
|
1453
|
+
The points of each chain are processed (with a specified sampling)
|
|
1454
|
+
sequentially. The first point of the initial chain is the
|
|
1455
|
+
first point of one of the resulting chains. The splitting ends when
|
|
1456
|
+
no more chain can start.
|
|
1457
|
+
|
|
1458
|
+
:param starting_pred: The predicate on a point that expresses the
|
|
1459
|
+
starting condition. Each time this condition is verified, a new chain begins
|
|
1460
|
+
:type starting_pred: UnaryPredicate0D
|
|
1461
|
+
:param stopping_pred: The predicate on a point that expresses the
|
|
1462
|
+
stopping condition. The chain ends as soon as this predicate is verified.
|
|
1463
|
+
:type stopping_pred: UnaryPredicate0D
|
|
1464
|
+
:param sampling: The resolution used to sample the chain for the
|
|
1465
|
+
predicates evaluation. (The chain is not actually resampled;
|
|
1466
|
+
a virtual point only progresses along the curve using this
|
|
1467
|
+
resolution.)
|
|
1468
|
+
:type sampling: float
|
|
1469
|
+
"""
|
|
1470
|
+
...
|
|
1471
|
+
|
|
1472
|
+
@staticmethod
|
|
1473
|
+
def sequential_split(pred: UnaryPredicate0D, sampling: float = 0.0):
|
|
1474
|
+
"""Splits each chain of the current set of chains in a sequential way.
|
|
1475
|
+
The points of each chain are processed (with a specified sampling)
|
|
1476
|
+
sequentially. The first point of the initial chain is the
|
|
1477
|
+
first point of one of the resulting chains. The splitting ends when
|
|
1478
|
+
no more chain can start.
|
|
1050
1479
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1480
|
+
:param pred: The predicate on a point that expresses the splitting condition.
|
|
1481
|
+
Each time the condition is verified, the chain is split into two chains.
|
|
1482
|
+
The resulting set of chains is a partition of the initial chain
|
|
1483
|
+
:type pred: UnaryPredicate0D
|
|
1484
|
+
:param sampling: The resolution used to sample the chain for the
|
|
1485
|
+
predicates evaluation. (The chain is not actually resampled;
|
|
1486
|
+
a virtual point only progresses along the curve using this
|
|
1487
|
+
resolution.)
|
|
1488
|
+
:type sampling: float
|
|
1059
1489
|
"""
|
|
1060
1490
|
...
|
|
1061
1491
|
|
|
1062
1492
|
@staticmethod
|
|
1063
|
-
def sort(pred:
|
|
1064
|
-
"""Sorts the current set of chains (or viewedges) according to the
|
|
1493
|
+
def sort(pred: BinaryPredicate1D):
|
|
1494
|
+
"""Sorts the current set of chains (or viewedges) according to the
|
|
1495
|
+
comparison predicate given as argument.
|
|
1065
1496
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1497
|
+
:param pred: The binary predicate used for the comparison.
|
|
1498
|
+
:type pred: BinaryPredicate1D
|
|
1068
1499
|
"""
|
|
1069
1500
|
...
|
|
1070
1501
|
|
|
1071
1502
|
class SShape:
|
|
1072
|
-
"""Class to define a feature shape. It is the gathering of feature
|
|
1503
|
+
"""Class to define a feature shape. It is the gathering of feature
|
|
1504
|
+
elements from an identified input shape.
|
|
1505
|
+
"""
|
|
1073
1506
|
|
|
1074
|
-
bbox:
|
|
1507
|
+
bbox: BBox
|
|
1075
1508
|
""" The bounding box of the SShape.
|
|
1076
1509
|
|
|
1077
|
-
:type:
|
|
1510
|
+
:type: BBox
|
|
1078
1511
|
"""
|
|
1079
1512
|
|
|
1080
|
-
edges: typing.List[
|
|
1513
|
+
edges: typing.List[FEdge]
|
|
1081
1514
|
""" The list of edges constituting this SShape.
|
|
1082
1515
|
|
|
1083
|
-
:type: typing.List[
|
|
1516
|
+
:type: typing.List[FEdge]
|
|
1084
1517
|
"""
|
|
1085
1518
|
|
|
1086
|
-
id:
|
|
1519
|
+
id: Id
|
|
1087
1520
|
""" The Id of this SShape.
|
|
1088
1521
|
|
|
1089
|
-
:type:
|
|
1522
|
+
:type: Id
|
|
1090
1523
|
"""
|
|
1091
1524
|
|
|
1092
1525
|
name: str
|
|
@@ -1095,33 +1528,38 @@ class SShape:
|
|
|
1095
1528
|
:type: str
|
|
1096
1529
|
"""
|
|
1097
1530
|
|
|
1098
|
-
vertices: typing.List[
|
|
1531
|
+
vertices: typing.List[SVertex]
|
|
1099
1532
|
""" The list of vertices constituting this SShape.
|
|
1100
1533
|
|
|
1101
|
-
:type: typing.List[
|
|
1534
|
+
:type: typing.List[SVertex]
|
|
1102
1535
|
"""
|
|
1103
1536
|
|
|
1104
1537
|
def __init__(self):
|
|
1105
|
-
"""
|
|
1538
|
+
"""Creates a `SShape` class using either a default constructor or copy constructor."""
|
|
1539
|
+
...
|
|
1540
|
+
|
|
1541
|
+
def __init__(self, brother: SShape):
|
|
1542
|
+
"""Creates a `SShape` class using either a default constructor or copy constructor.
|
|
1106
1543
|
|
|
1107
1544
|
:param brother: An SShape object.
|
|
1108
|
-
:type brother:
|
|
1545
|
+
:type brother: SShape
|
|
1109
1546
|
"""
|
|
1110
1547
|
...
|
|
1111
1548
|
|
|
1112
|
-
def add_edge(self, edge:
|
|
1549
|
+
def add_edge(self, edge: FEdge):
|
|
1113
1550
|
"""Adds an FEdge to the list of FEdges.
|
|
1114
1551
|
|
|
1115
1552
|
:param edge: An FEdge object.
|
|
1116
|
-
:type edge:
|
|
1553
|
+
:type edge: FEdge
|
|
1117
1554
|
"""
|
|
1118
1555
|
...
|
|
1119
1556
|
|
|
1120
|
-
def add_vertex(self, vertex:
|
|
1121
|
-
"""Adds an SVertex to the list of SVertex of this Shape. The SShape
|
|
1557
|
+
def add_vertex(self, vertex: SVertex):
|
|
1558
|
+
"""Adds an SVertex to the list of SVertex of this Shape. The SShape
|
|
1559
|
+
attribute of the SVertex is also set to this SShape.
|
|
1122
1560
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1561
|
+
:param vertex: An SVertex object.
|
|
1562
|
+
:type vertex: SVertex
|
|
1125
1563
|
"""
|
|
1126
1564
|
...
|
|
1127
1565
|
|
|
@@ -1130,25 +1568,32 @@ class SShape:
|
|
|
1130
1568
|
...
|
|
1131
1569
|
|
|
1132
1570
|
class SVertex:
|
|
1133
|
-
"""Class hierarchy: `Interface0D` > `SVertex`
|
|
1571
|
+
"""Class hierarchy: `Interface0D` > `SVertex`Class to define a vertex of the embedding."""
|
|
1134
1572
|
|
|
1135
1573
|
curvatures: typing.Tuple
|
|
1136
|
-
""" Curvature information expressed in the form of a seven-element tuple
|
|
1574
|
+
""" Curvature information expressed in the form of a seven-element tuple
|
|
1575
|
+
(K1, e1, K2, e2, Kr, er, dKr), where K1 and K2 are scalar values
|
|
1576
|
+
representing the first (maximum) and second (minimum) principal
|
|
1577
|
+
curvatures at this SVertex, respectively; e1 and e2 are
|
|
1578
|
+
three-dimensional vectors representing the first and second principal
|
|
1579
|
+
directions, i.e. the directions of the normal plane where the
|
|
1580
|
+
curvature takes its maximum and minimum values, respectively; and Kr,
|
|
1581
|
+
er and dKr are the radial curvature, radial direction, and the
|
|
1582
|
+
derivative of the radial curvature at this SVertex, respectively.
|
|
1137
1583
|
|
|
1138
1584
|
:type: typing.Tuple
|
|
1139
1585
|
"""
|
|
1140
1586
|
|
|
1141
|
-
id:
|
|
1587
|
+
id: Id
|
|
1142
1588
|
""" The Id of this SVertex.
|
|
1143
1589
|
|
|
1144
|
-
:type:
|
|
1590
|
+
:type: Id
|
|
1145
1591
|
"""
|
|
1146
1592
|
|
|
1147
|
-
normals: typing.
|
|
1148
|
-
""" The normals for this Vertex as a list. In a sharp surface, an SVertex
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
"""
|
|
1593
|
+
normals: typing.Any
|
|
1594
|
+
""" The normals for this Vertex as a list. In a sharp surface, an SVertex
|
|
1595
|
+
has exactly one normal. In a smooth surface, an SVertex can have any
|
|
1596
|
+
number of normals."""
|
|
1152
1597
|
|
|
1153
1598
|
normals_size: int
|
|
1154
1599
|
""" The number of different normals for this SVertex.
|
|
@@ -1156,62 +1601,83 @@ class SVertex:
|
|
|
1156
1601
|
:type: int
|
|
1157
1602
|
"""
|
|
1158
1603
|
|
|
1159
|
-
point_2d: typing.Union[typing.Sequence[float],
|
|
1604
|
+
point_2d: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1160
1605
|
""" The projected 3D coordinates of the SVertex.
|
|
1161
1606
|
|
|
1162
|
-
:type: typing.Union[typing.Sequence[float],
|
|
1607
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1163
1608
|
"""
|
|
1164
1609
|
|
|
1165
|
-
point_3d: typing.Union[typing.Sequence[float],
|
|
1610
|
+
point_3d: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1166
1611
|
""" The 3D coordinates of the SVertex.
|
|
1167
1612
|
|
|
1168
|
-
:type: typing.Union[typing.Sequence[float],
|
|
1613
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1169
1614
|
"""
|
|
1170
1615
|
|
|
1171
|
-
viewvertex:
|
|
1172
|
-
""" If this SVertex is also a ViewVertex, this property refers to the
|
|
1616
|
+
viewvertex: ViewVertex
|
|
1617
|
+
""" If this SVertex is also a ViewVertex, this property refers to the
|
|
1618
|
+
ViewVertex, and None otherwise.
|
|
1173
1619
|
|
|
1174
|
-
:type:
|
|
1620
|
+
:type: ViewVertex
|
|
1175
1621
|
"""
|
|
1176
1622
|
|
|
1177
1623
|
def __init__(self):
|
|
1178
|
-
"""
|
|
1624
|
+
"""Builds a `SVertex` using the default constructor,
|
|
1625
|
+
copy constructor or the overloaded constructor which builds a `SVertex` from 3D coordinates and an Id.
|
|
1626
|
+
|
|
1627
|
+
"""
|
|
1628
|
+
...
|
|
1629
|
+
|
|
1630
|
+
def __init__(self, brother: SVertex):
|
|
1631
|
+
"""Builds a `SVertex` using the default constructor,
|
|
1632
|
+
copy constructor or the overloaded constructor which builds a `SVertex` from 3D coordinates and an Id.
|
|
1633
|
+
|
|
1634
|
+
:param brother: A SVertex object.
|
|
1635
|
+
:type brother: SVertex
|
|
1636
|
+
"""
|
|
1637
|
+
...
|
|
1638
|
+
|
|
1639
|
+
def __init__(
|
|
1640
|
+
self, point_3d: typing.Union[typing.Sequence[float], mathutils.Vector], id: Id
|
|
1641
|
+
):
|
|
1642
|
+
"""Builds a `SVertex` using the default constructor,
|
|
1643
|
+
copy constructor or the overloaded constructor which builds a `SVertex` from 3D coordinates and an Id.
|
|
1179
1644
|
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
:param id: An Id object.
|
|
1185
|
-
:type id: 'Id'
|
|
1645
|
+
:param point_3d: A three-dimensional vector.
|
|
1646
|
+
:type point_3d: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1647
|
+
:param id: An Id object.
|
|
1648
|
+
:type id: Id
|
|
1186
1649
|
"""
|
|
1187
1650
|
...
|
|
1188
1651
|
|
|
1189
|
-
def add_fedge(self, fedge:
|
|
1652
|
+
def add_fedge(self, fedge: FEdge):
|
|
1190
1653
|
"""Add an FEdge to the list of edges emanating from this SVertex.
|
|
1191
1654
|
|
|
1192
1655
|
:param fedge: An FEdge.
|
|
1193
|
-
:type fedge:
|
|
1656
|
+
:type fedge: FEdge
|
|
1194
1657
|
"""
|
|
1195
1658
|
...
|
|
1196
1659
|
|
|
1197
1660
|
def add_normal(
|
|
1198
|
-
self,
|
|
1199
|
-
normal: typing.Union[typing.Sequence[float], "mathutils.Vector", typing.List],
|
|
1661
|
+
self, normal: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1200
1662
|
):
|
|
1201
|
-
"""Adds a normal to the SVertex's set of normals. If the same normal
|
|
1663
|
+
"""Adds a normal to the SVertex's set of normals. If the same normal
|
|
1664
|
+
is already in the set, nothing changes.
|
|
1202
1665
|
|
|
1203
|
-
|
|
1204
|
-
|
|
1666
|
+
:param normal: A three-dimensional vector.
|
|
1667
|
+
:type normal: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1205
1668
|
"""
|
|
1206
1669
|
...
|
|
1207
1670
|
|
|
1208
1671
|
class SVertexIterator:
|
|
1209
|
-
"""Class hierarchy: `Iterator` > `SVertexIterator`
|
|
1672
|
+
"""Class hierarchy: `Iterator` > `SVertexIterator`Class representing an iterator over `SVertex` of a
|
|
1673
|
+
`ViewEdge`. An instance of an SVertexIterator can be obtained
|
|
1674
|
+
from a ViewEdge by calling verticesBegin() or verticesEnd().
|
|
1675
|
+
"""
|
|
1210
1676
|
|
|
1211
|
-
object:
|
|
1677
|
+
object: SVertex
|
|
1212
1678
|
""" The SVertex object currently pointed by this iterator.
|
|
1213
1679
|
|
|
1214
|
-
:type:
|
|
1680
|
+
:type: SVertex
|
|
1215
1681
|
"""
|
|
1216
1682
|
|
|
1217
1683
|
t: float
|
|
@@ -1227,30 +1693,51 @@ class SVertexIterator:
|
|
|
1227
1693
|
"""
|
|
1228
1694
|
|
|
1229
1695
|
def __init__(self):
|
|
1230
|
-
"""
|
|
1696
|
+
"""Build an SVertexIterator using either the default constructor, copy constructor,or the overloaded constructor that starts iteration from an SVertex object vertex."""
|
|
1697
|
+
...
|
|
1698
|
+
|
|
1699
|
+
def __init__(self, brother: SVertexIterator):
|
|
1700
|
+
"""Build an SVertexIterator using either the default constructor, copy constructor,or the overloaded constructor that starts iteration from an SVertex object vertex.
|
|
1231
1701
|
|
|
1232
1702
|
:param brother: An SVertexIterator object.
|
|
1233
|
-
:type brother:
|
|
1703
|
+
:type brother: SVertexIterator
|
|
1704
|
+
"""
|
|
1705
|
+
...
|
|
1706
|
+
|
|
1707
|
+
def __init__(
|
|
1708
|
+
self,
|
|
1709
|
+
vertex: SVertex,
|
|
1710
|
+
begin: SVertex,
|
|
1711
|
+
previous_edge: FEdge,
|
|
1712
|
+
next_edge: FEdge,
|
|
1713
|
+
t: float,
|
|
1714
|
+
):
|
|
1715
|
+
"""Build an SVertexIterator using either the default constructor, copy constructor,or the overloaded constructor that starts iteration from an SVertex object vertex.
|
|
1716
|
+
|
|
1234
1717
|
:param vertex: The SVertex from which the iterator starts iteration.
|
|
1235
|
-
:type vertex:
|
|
1718
|
+
:type vertex: SVertex
|
|
1236
1719
|
:param begin: The first SVertex of a ViewEdge.
|
|
1237
|
-
:type begin:
|
|
1720
|
+
:type begin: SVertex
|
|
1238
1721
|
:param previous_edge: The previous FEdge coming to vertex.
|
|
1239
|
-
:type previous_edge:
|
|
1722
|
+
:type previous_edge: FEdge
|
|
1240
1723
|
:param next_edge: The next FEdge going out from vertex.
|
|
1241
|
-
:type next_edge:
|
|
1724
|
+
:type next_edge: FEdge
|
|
1242
1725
|
:param t: The curvilinear abscissa at vertex.
|
|
1243
1726
|
:type t: float
|
|
1244
1727
|
"""
|
|
1245
1728
|
...
|
|
1246
1729
|
|
|
1247
1730
|
class Stroke:
|
|
1248
|
-
"""Class hierarchy: `Interface1D` > `Stroke`
|
|
1731
|
+
"""Class hierarchy: `Interface1D` > `Stroke`Class to define a stroke. A stroke is made of a set of 2D vertices
|
|
1732
|
+
(`StrokeVertex`), regularly spaced out. This set of vertices
|
|
1733
|
+
defines the stroke's backbone geometry. Each of these stroke vertices
|
|
1734
|
+
defines the stroke's shape and appearance at this vertex position.
|
|
1735
|
+
"""
|
|
1249
1736
|
|
|
1250
|
-
id:
|
|
1737
|
+
id: Id
|
|
1251
1738
|
""" The Id of this Stroke.
|
|
1252
1739
|
|
|
1253
|
-
:type:
|
|
1740
|
+
:type: Id
|
|
1254
1741
|
"""
|
|
1255
1742
|
|
|
1256
1743
|
length_2d: float
|
|
@@ -1259,10 +1746,10 @@ class Stroke:
|
|
|
1259
1746
|
:type: float
|
|
1260
1747
|
"""
|
|
1261
1748
|
|
|
1262
|
-
medium_type:
|
|
1749
|
+
medium_type: MediumType
|
|
1263
1750
|
""" The MediumType used for this Stroke.
|
|
1264
1751
|
|
|
1265
|
-
:type:
|
|
1752
|
+
:type: MediumType
|
|
1266
1753
|
"""
|
|
1267
1754
|
|
|
1268
1755
|
texture_id: int
|
|
@@ -1278,26 +1765,41 @@ class Stroke:
|
|
|
1278
1765
|
"""
|
|
1279
1766
|
|
|
1280
1767
|
def Stroke(self):
|
|
1281
|
-
"""
|
|
1768
|
+
"""Creates a `Stroke` using the default constructor or copy constructor"""
|
|
1282
1769
|
...
|
|
1283
1770
|
|
|
1284
|
-
def
|
|
1285
|
-
"""
|
|
1771
|
+
def Stroke(self, brother):
|
|
1772
|
+
"""Creates a `Stroke` using the default constructor or copy constructor
|
|
1286
1773
|
|
|
1287
|
-
:param
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1774
|
+
:param brother:
|
|
1775
|
+
"""
|
|
1776
|
+
...
|
|
1777
|
+
|
|
1778
|
+
def compute_sampling(self, n: int) -> int:
|
|
1779
|
+
"""Compute the sampling needed to get N vertices. If the
|
|
1780
|
+
specified number of vertices is less than the actual number of
|
|
1781
|
+
vertices, the actual sampling value is returned. (To remove Vertices,
|
|
1782
|
+
use the RemoveVertex() method of this class.)
|
|
1783
|
+
|
|
1784
|
+
:param n: The number of stroke vertices we eventually want
|
|
1785
|
+
in our Stroke.
|
|
1786
|
+
:type n: int
|
|
1787
|
+
:return: The sampling that must be used in the Resample(float)
|
|
1788
|
+
method.
|
|
1789
|
+
:rtype: float
|
|
1291
1790
|
"""
|
|
1292
1791
|
...
|
|
1293
1792
|
|
|
1294
|
-
def insert_vertex(self, vertex:
|
|
1295
|
-
"""Inserts the StrokeVertex given as argument into the Stroke before the
|
|
1793
|
+
def insert_vertex(self, vertex: StrokeVertex, next: StrokeVertexIterator):
|
|
1794
|
+
"""Inserts the StrokeVertex given as argument into the Stroke before the
|
|
1795
|
+
point specified by next. The length and curvilinear abscissa are
|
|
1796
|
+
updated consequently.
|
|
1296
1797
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1798
|
+
:param vertex: The StrokeVertex to insert in the Stroke.
|
|
1799
|
+
:type vertex: StrokeVertex
|
|
1800
|
+
:param next: A StrokeVertexIterator pointing to the StrokeVertex
|
|
1801
|
+
before which vertex must be inserted.
|
|
1802
|
+
:type next: StrokeVertexIterator
|
|
1301
1803
|
"""
|
|
1302
1804
|
...
|
|
1303
1805
|
|
|
@@ -1305,47 +1807,64 @@ class Stroke:
|
|
|
1305
1807
|
"""Removes all vertices from the Stroke."""
|
|
1306
1808
|
...
|
|
1307
1809
|
|
|
1308
|
-
def remove_vertex(self, vertex:
|
|
1309
|
-
"""Removes the StrokeVertex given as argument from the Stroke. The length
|
|
1810
|
+
def remove_vertex(self, vertex: StrokeVertex):
|
|
1811
|
+
"""Removes the StrokeVertex given as argument from the Stroke. The length
|
|
1812
|
+
and curvilinear abscissa are updated consequently.
|
|
1310
1813
|
|
|
1311
|
-
|
|
1312
|
-
|
|
1814
|
+
:param vertex: the StrokeVertex to remove from the Stroke.
|
|
1815
|
+
:type vertex: StrokeVertex
|
|
1313
1816
|
"""
|
|
1314
1817
|
...
|
|
1315
1818
|
|
|
1316
1819
|
def resample(self, n: int):
|
|
1317
|
-
"""
|
|
1820
|
+
"""Resamples the stroke so using one of two methods with the goal
|
|
1821
|
+
of creating a stroke with fewer points and the same shape.
|
|
1318
1822
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1823
|
+
:param n: Resamples the stroke so that it eventually has N points. That means
|
|
1824
|
+
it is going to add N-vertices_size, where vertices_size is the
|
|
1825
|
+
number of points we already have. If vertices_size >= N, no
|
|
1826
|
+
resampling is done.
|
|
1827
|
+
:type n: int
|
|
1323
1828
|
"""
|
|
1324
1829
|
...
|
|
1325
1830
|
|
|
1326
|
-
def
|
|
1327
|
-
"""
|
|
1831
|
+
def resample(self, sampling: float):
|
|
1832
|
+
"""Resamples the stroke so using one of two methods with the goal
|
|
1833
|
+
of creating a stroke with fewer points and the same shape.
|
|
1328
1834
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1835
|
+
:param sampling: Resamples the stroke with a given sampling value. If the
|
|
1836
|
+
sampling is smaller than the actual sampling value, no resampling is done.
|
|
1837
|
+
:type sampling: float
|
|
1838
|
+
"""
|
|
1839
|
+
...
|
|
1840
|
+
|
|
1841
|
+
def stroke_vertices_begin(self, t: float = 0.0) -> float:
|
|
1842
|
+
"""Returns a StrokeVertexIterator pointing on the first StrokeVertex of
|
|
1843
|
+
the Stroke. One can specify a sampling value to re-sample the Stroke
|
|
1844
|
+
on the fly if needed.
|
|
1845
|
+
|
|
1846
|
+
:param t: The resampling value with which we want our Stroke to be
|
|
1847
|
+
resampled. If 0 is specified, no resampling is done.
|
|
1848
|
+
:type t: float
|
|
1849
|
+
:return: A StrokeVertexIterator pointing on the first StrokeVertex.
|
|
1850
|
+
:rtype: StrokeVertexIterator
|
|
1333
1851
|
"""
|
|
1334
1852
|
...
|
|
1335
1853
|
|
|
1336
|
-
def stroke_vertices_end(self) ->
|
|
1337
|
-
"""Returns a StrokeVertexIterator pointing after the last StrokeVertex
|
|
1854
|
+
def stroke_vertices_end(self) -> StrokeVertexIterator:
|
|
1855
|
+
"""Returns a StrokeVertexIterator pointing after the last StrokeVertex
|
|
1856
|
+
of the Stroke.
|
|
1338
1857
|
|
|
1339
|
-
|
|
1340
|
-
|
|
1858
|
+
:return: A StrokeVertexIterator pointing after the last StrokeVertex.
|
|
1859
|
+
:rtype: StrokeVertexIterator
|
|
1341
1860
|
"""
|
|
1342
1861
|
...
|
|
1343
1862
|
|
|
1344
|
-
def stroke_vertices_size(self) ->
|
|
1863
|
+
def stroke_vertices_size(self) -> StrokeVertexIterator:
|
|
1345
1864
|
"""Returns the number of StrokeVertex constituting the Stroke.
|
|
1346
1865
|
|
|
1347
|
-
:rtype: int
|
|
1348
1866
|
:return: The number of stroke vertices.
|
|
1867
|
+
:rtype: int
|
|
1349
1868
|
"""
|
|
1350
1869
|
...
|
|
1351
1870
|
|
|
@@ -1354,7 +1873,10 @@ class Stroke:
|
|
|
1354
1873
|
...
|
|
1355
1874
|
|
|
1356
1875
|
class StrokeAttribute:
|
|
1357
|
-
"""Class to define a set of attributes associated with a `StrokeVertex`.
|
|
1876
|
+
"""Class to define a set of attributes associated with a `StrokeVertex`.
|
|
1877
|
+
The attribute set stores the color, alpha and thickness values for a Stroke
|
|
1878
|
+
Vertex.
|
|
1879
|
+
"""
|
|
1358
1880
|
|
|
1359
1881
|
alpha: float
|
|
1360
1882
|
""" Alpha component of the stroke color.
|
|
@@ -1362,16 +1884,18 @@ class StrokeAttribute:
|
|
|
1362
1884
|
:type: float
|
|
1363
1885
|
"""
|
|
1364
1886
|
|
|
1365
|
-
color: typing.Union[typing.Sequence[float],
|
|
1887
|
+
color: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
1366
1888
|
""" RGB components of the stroke color.
|
|
1367
1889
|
|
|
1368
|
-
:type: typing.Union[typing.Sequence[float],
|
|
1890
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Color]
|
|
1369
1891
|
"""
|
|
1370
1892
|
|
|
1371
|
-
thickness: typing.Union[typing.Sequence[float],
|
|
1372
|
-
""" Right and left components of the stroke thickness.
|
|
1893
|
+
thickness: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1894
|
+
""" Right and left components of the stroke thickness.
|
|
1895
|
+
The right (left) component is the thickness on the right (left) of the vertex
|
|
1896
|
+
when following the stroke.
|
|
1373
1897
|
|
|
1374
|
-
:type: typing.Union[typing.Sequence[float],
|
|
1898
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1375
1899
|
"""
|
|
1376
1900
|
|
|
1377
1901
|
visible: bool
|
|
@@ -1381,131 +1905,182 @@ class StrokeAttribute:
|
|
|
1381
1905
|
"""
|
|
1382
1906
|
|
|
1383
1907
|
def __init__(self):
|
|
1384
|
-
"""
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
:param red: Red component of a stroke color.
|
|
1389
|
-
:type red: float
|
|
1390
|
-
:param green: Green component of a stroke color.
|
|
1391
|
-
:type green: float
|
|
1392
|
-
:param blue: Blue component of a stroke color.
|
|
1393
|
-
:type blue: float
|
|
1394
|
-
:param alpha: Alpha component of a stroke color.
|
|
1395
|
-
:type alpha: float
|
|
1396
|
-
:param thickness_right: Stroke thickness on the right.
|
|
1397
|
-
:type thickness_right: float
|
|
1398
|
-
:param thickness_left: Stroke thickness on the left.
|
|
1399
|
-
:type thickness_left: float
|
|
1400
|
-
:param attribute1: The first StrokeAttribute object.
|
|
1401
|
-
:type attribute1: 'StrokeAttribute'
|
|
1402
|
-
:param attribute2: The second StrokeAttribute object.
|
|
1403
|
-
:type attribute2: 'StrokeAttribute'
|
|
1404
|
-
:param t: The interpolation parameter (0 <= t <= 1).
|
|
1405
|
-
:type t: float
|
|
1908
|
+
"""Creates a `StrokeAttribute` object using either a default constructor,
|
|
1909
|
+
copy constructor, overloaded constructor, or and interpolation constructor
|
|
1910
|
+
to interpolate between two `StrokeAttribute` objects.
|
|
1911
|
+
|
|
1406
1912
|
"""
|
|
1407
1913
|
...
|
|
1408
1914
|
|
|
1409
|
-
def
|
|
1915
|
+
def __init__(self, brother: StrokeAttribute):
|
|
1916
|
+
"""Creates a `StrokeAttribute` object using either a default constructor,
|
|
1917
|
+
copy constructor, overloaded constructor, or and interpolation constructor
|
|
1918
|
+
to interpolate between two `StrokeAttribute` objects.
|
|
1919
|
+
|
|
1920
|
+
:param brother: A StrokeAttribute object to be used as a copy constructor.
|
|
1921
|
+
:type brother: StrokeAttribute
|
|
1922
|
+
"""
|
|
1923
|
+
...
|
|
1924
|
+
|
|
1925
|
+
def __init__(
|
|
1926
|
+
self,
|
|
1927
|
+
red: float,
|
|
1928
|
+
green: float,
|
|
1929
|
+
blue: float,
|
|
1930
|
+
alpha: float,
|
|
1931
|
+
thickness_right: float,
|
|
1932
|
+
thickness_left: float,
|
|
1933
|
+
):
|
|
1934
|
+
"""Creates a `StrokeAttribute` object using either a default constructor,
|
|
1935
|
+
copy constructor, overloaded constructor, or and interpolation constructor
|
|
1936
|
+
to interpolate between two `StrokeAttribute` objects.
|
|
1937
|
+
|
|
1938
|
+
:param red: Red component of a stroke color.
|
|
1939
|
+
:type red: float
|
|
1940
|
+
:param green: Green component of a stroke color.
|
|
1941
|
+
:type green: float
|
|
1942
|
+
:param blue: Blue component of a stroke color.
|
|
1943
|
+
:type blue: float
|
|
1944
|
+
:param alpha: Alpha component of a stroke color.
|
|
1945
|
+
:type alpha: float
|
|
1946
|
+
:param thickness_right: Stroke thickness on the right.
|
|
1947
|
+
:type thickness_right: float
|
|
1948
|
+
:param thickness_left: Stroke thickness on the left.
|
|
1949
|
+
:type thickness_left: float
|
|
1950
|
+
"""
|
|
1951
|
+
...
|
|
1952
|
+
|
|
1953
|
+
def __init__(
|
|
1954
|
+
self, attribute1: StrokeAttribute, attribute2: StrokeAttribute, t: float
|
|
1955
|
+
):
|
|
1956
|
+
"""Creates a `StrokeAttribute` object using either a default constructor,
|
|
1957
|
+
copy constructor, overloaded constructor, or and interpolation constructor
|
|
1958
|
+
to interpolate between two `StrokeAttribute` objects.
|
|
1959
|
+
|
|
1960
|
+
:param attribute1: The first StrokeAttribute object.
|
|
1961
|
+
:type attribute1: StrokeAttribute
|
|
1962
|
+
:param attribute2: The second StrokeAttribute object.
|
|
1963
|
+
:type attribute2: StrokeAttribute
|
|
1964
|
+
:param t: The interpolation parameter (0 <= t <= 1).
|
|
1965
|
+
:type t: float
|
|
1966
|
+
"""
|
|
1967
|
+
...
|
|
1968
|
+
|
|
1969
|
+
def get_attribute_real(self, name: str) -> str:
|
|
1410
1970
|
"""Returns an attribute of float type.
|
|
1411
1971
|
|
|
1412
1972
|
:param name: The name of the attribute.
|
|
1413
1973
|
:type name: str
|
|
1414
|
-
:rtype: float
|
|
1415
1974
|
:return: The attribute value.
|
|
1975
|
+
:rtype: float
|
|
1416
1976
|
"""
|
|
1417
1977
|
...
|
|
1418
1978
|
|
|
1419
|
-
def get_attribute_vec2(self, name: str) ->
|
|
1979
|
+
def get_attribute_vec2(self, name: str) -> str:
|
|
1420
1980
|
"""Returns an attribute of two-dimensional vector type.
|
|
1421
1981
|
|
|
1422
1982
|
:param name: The name of the attribute.
|
|
1423
1983
|
:type name: str
|
|
1424
|
-
:rtype: 'mathutils.Vector'
|
|
1425
1984
|
:return: The attribute value.
|
|
1985
|
+
:rtype: mathutils.Vector
|
|
1426
1986
|
"""
|
|
1427
1987
|
...
|
|
1428
1988
|
|
|
1429
|
-
def get_attribute_vec3(self, name: str) ->
|
|
1989
|
+
def get_attribute_vec3(self, name: str) -> str:
|
|
1430
1990
|
"""Returns an attribute of three-dimensional vector type.
|
|
1431
1991
|
|
|
1432
1992
|
:param name: The name of the attribute.
|
|
1433
1993
|
:type name: str
|
|
1434
|
-
:rtype: 'mathutils.Vector'
|
|
1435
1994
|
:return: The attribute value.
|
|
1995
|
+
:rtype: mathutils.Vector
|
|
1436
1996
|
"""
|
|
1437
1997
|
...
|
|
1438
1998
|
|
|
1439
|
-
def has_attribute_real(self, name: str) ->
|
|
1999
|
+
def has_attribute_real(self, name: str) -> str:
|
|
1440
2000
|
"""Checks whether the attribute name of float type is available.
|
|
1441
2001
|
|
|
1442
2002
|
:param name: The name of the attribute.
|
|
1443
2003
|
:type name: str
|
|
1444
|
-
:rtype: bool
|
|
1445
2004
|
:return: True if the attribute is available.
|
|
2005
|
+
:rtype: bool
|
|
1446
2006
|
"""
|
|
1447
2007
|
...
|
|
1448
2008
|
|
|
1449
|
-
def has_attribute_vec2(self, name: str) ->
|
|
1450
|
-
"""Checks whether the attribute name of two-dimensional vector type
|
|
2009
|
+
def has_attribute_vec2(self, name: str) -> str:
|
|
2010
|
+
"""Checks whether the attribute name of two-dimensional vector type
|
|
2011
|
+
is available.
|
|
1451
2012
|
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
2013
|
+
:param name: The name of the attribute.
|
|
2014
|
+
:type name: str
|
|
2015
|
+
:return: True if the attribute is available.
|
|
2016
|
+
:rtype: bool
|
|
1456
2017
|
"""
|
|
1457
2018
|
...
|
|
1458
2019
|
|
|
1459
|
-
def has_attribute_vec3(self, name: str) ->
|
|
1460
|
-
"""Checks whether the attribute name of three-dimensional vector
|
|
2020
|
+
def has_attribute_vec3(self, name: str) -> str:
|
|
2021
|
+
"""Checks whether the attribute name of three-dimensional vector
|
|
2022
|
+
type is available.
|
|
1461
2023
|
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
2024
|
+
:param name: The name of the attribute.
|
|
2025
|
+
:type name: str
|
|
2026
|
+
:return: True if the attribute is available.
|
|
2027
|
+
:rtype: bool
|
|
1466
2028
|
"""
|
|
1467
2029
|
...
|
|
1468
2030
|
|
|
1469
2031
|
def set_attribute_real(self, name: str, value: float):
|
|
1470
|
-
"""Adds a user-defined attribute of float type. If there is no
|
|
2032
|
+
"""Adds a user-defined attribute of float type. If there is no
|
|
2033
|
+
attribute of the given name, it is added. Otherwise, the new value
|
|
2034
|
+
replaces the old one.
|
|
1471
2035
|
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
2036
|
+
:param name: The name of the attribute.
|
|
2037
|
+
:type name: str
|
|
2038
|
+
:param value: The attribute value.
|
|
2039
|
+
:type value: float
|
|
1476
2040
|
"""
|
|
1477
2041
|
...
|
|
1478
2042
|
|
|
1479
2043
|
def set_attribute_vec2(
|
|
1480
2044
|
self,
|
|
1481
2045
|
name: str,
|
|
1482
|
-
value: typing.Union[typing.Sequence[float],
|
|
2046
|
+
value: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1483
2047
|
):
|
|
1484
|
-
"""Adds a user-defined attribute of two-dimensional vector type. If
|
|
2048
|
+
"""Adds a user-defined attribute of two-dimensional vector type. If
|
|
2049
|
+
there is no attribute of the given name, it is added. Otherwise,
|
|
2050
|
+
the new value replaces the old one.
|
|
1485
2051
|
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
2052
|
+
:param name: The name of the attribute.
|
|
2053
|
+
:type name: str
|
|
2054
|
+
:param value: The attribute value.
|
|
2055
|
+
:type value: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1490
2056
|
"""
|
|
1491
2057
|
...
|
|
1492
2058
|
|
|
1493
2059
|
def set_attribute_vec3(
|
|
1494
2060
|
self,
|
|
1495
2061
|
name: str,
|
|
1496
|
-
value: typing.Union[typing.Sequence[float],
|
|
2062
|
+
value: typing.Union[typing.Sequence[float], mathutils.Vector, list],
|
|
1497
2063
|
):
|
|
1498
|
-
"""Adds a user-defined attribute of three-dimensional vector type.
|
|
2064
|
+
"""Adds a user-defined attribute of three-dimensional vector type.
|
|
2065
|
+
If there is no attribute of the given name, it is added.
|
|
2066
|
+
Otherwise, the new value replaces the old one.
|
|
1499
2067
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
2068
|
+
:param name: The name of the attribute.
|
|
2069
|
+
:type name: str
|
|
2070
|
+
:param value: The attribute value.
|
|
2071
|
+
:type value: typing.Union[typing.Sequence[float], mathutils.Vector, list]
|
|
1504
2072
|
"""
|
|
1505
2073
|
...
|
|
1506
2074
|
|
|
1507
2075
|
class StrokeShader:
|
|
1508
|
-
"""Base class for stroke shaders. Any stroke shader must inherit from
|
|
2076
|
+
"""Base class for stroke shaders. Any stroke shader must inherit from
|
|
2077
|
+
this class and overload the shade() method. A StrokeShader is
|
|
2078
|
+
designed to modify stroke attributes such as thickness, color,
|
|
2079
|
+
geometry, texture, blending mode, and so on. The basic way for this
|
|
2080
|
+
operation is to iterate over the stroke vertices of the `Stroke`
|
|
2081
|
+
and to modify the `StrokeAttribute` of each vertex. Here is a
|
|
2082
|
+
code example of such an iteration:
|
|
2083
|
+
"""
|
|
1509
2084
|
|
|
1510
2085
|
name: str
|
|
1511
2086
|
""" The name of the stroke shader.
|
|
@@ -1517,21 +2092,21 @@ class StrokeShader:
|
|
|
1517
2092
|
"""Default constructor."""
|
|
1518
2093
|
...
|
|
1519
2094
|
|
|
1520
|
-
def shade(self, stroke:
|
|
2095
|
+
def shade(self, stroke: Stroke):
|
|
1521
2096
|
"""The shading method. Must be overloaded by inherited classes.
|
|
1522
2097
|
|
|
1523
2098
|
:param stroke: A Stroke object.
|
|
1524
|
-
:type stroke:
|
|
2099
|
+
:type stroke: Stroke
|
|
1525
2100
|
"""
|
|
1526
2101
|
...
|
|
1527
2102
|
|
|
1528
2103
|
class StrokeVertex:
|
|
1529
|
-
"""Class hierarchy: `Interface0D` > `CurvePoint` > `StrokeVertex`
|
|
2104
|
+
"""Class hierarchy: `Interface0D` > `CurvePoint` > `StrokeVertex`Class to define a stroke vertex."""
|
|
1530
2105
|
|
|
1531
|
-
attribute:
|
|
2106
|
+
attribute: StrokeAttribute
|
|
1532
2107
|
""" StrokeAttribute for this StrokeVertex.
|
|
1533
2108
|
|
|
1534
|
-
:type:
|
|
2109
|
+
:type: StrokeAttribute
|
|
1535
2110
|
"""
|
|
1536
2111
|
|
|
1537
2112
|
curvilinear_abscissa: float
|
|
@@ -1540,14 +2115,15 @@ class StrokeVertex:
|
|
|
1540
2115
|
:type: float
|
|
1541
2116
|
"""
|
|
1542
2117
|
|
|
1543
|
-
point: typing.Union[typing.Sequence[float],
|
|
2118
|
+
point: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1544
2119
|
""" 2D point coordinates.
|
|
1545
2120
|
|
|
1546
|
-
:type: typing.Union[typing.Sequence[float],
|
|
2121
|
+
:type: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
1547
2122
|
"""
|
|
1548
2123
|
|
|
1549
2124
|
stroke_length: float
|
|
1550
|
-
""" Stroke length (it is only a value retained by the StrokeVertex,
|
|
2125
|
+
""" Stroke length (it is only a value retained by the StrokeVertex,
|
|
2126
|
+
and it won't change the real stroke length).
|
|
1551
2127
|
|
|
1552
2128
|
:type: float
|
|
1553
2129
|
"""
|
|
@@ -1559,40 +2135,98 @@ class StrokeVertex:
|
|
|
1559
2135
|
"""
|
|
1560
2136
|
|
|
1561
2137
|
def __init__(self):
|
|
1562
|
-
"""
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
2138
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2139
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2140
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2141
|
+
|
|
2142
|
+
"""
|
|
2143
|
+
...
|
|
2144
|
+
|
|
2145
|
+
def __init__(self, brother: StrokeVertex):
|
|
2146
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2147
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2148
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2149
|
+
|
|
2150
|
+
:param brother: A StrokeVertex object.
|
|
2151
|
+
:type brother: StrokeVertex
|
|
2152
|
+
"""
|
|
2153
|
+
...
|
|
2154
|
+
|
|
2155
|
+
def __init__(
|
|
2156
|
+
self, first_vertex: StrokeVertex, second_vertex: StrokeVertex, t3d: float
|
|
2157
|
+
):
|
|
2158
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2159
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2160
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2161
|
+
|
|
2162
|
+
:param first_vertex: The first StrokeVertex.
|
|
2163
|
+
:type first_vertex: StrokeVertex
|
|
2164
|
+
:param second_vertex: The second StrokeVertex.
|
|
2165
|
+
:type second_vertex: StrokeVertex
|
|
2166
|
+
:param t3d: An interpolation parameter.
|
|
2167
|
+
:type t3d: float
|
|
2168
|
+
"""
|
|
2169
|
+
...
|
|
2170
|
+
|
|
2171
|
+
def __init__(self, point: CurvePoint):
|
|
2172
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2173
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2174
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2175
|
+
|
|
2176
|
+
:param point: A CurvePoint object.
|
|
2177
|
+
:type point: CurvePoint
|
|
2178
|
+
"""
|
|
2179
|
+
...
|
|
2180
|
+
|
|
2181
|
+
def __init__(self, svertex: typing.Union[SVertex, SVertex]):
|
|
2182
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2183
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2184
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2185
|
+
|
|
2186
|
+
:param svertex: An SVertex object.An SVertex object.
|
|
2187
|
+
:type svertex: typing.Union[SVertex, SVertex]
|
|
2188
|
+
"""
|
|
2189
|
+
...
|
|
2190
|
+
|
|
2191
|
+
def __init__(
|
|
2192
|
+
self, svertex: typing.Union[SVertex, SVertex], attribute: StrokeAttribute
|
|
2193
|
+
):
|
|
2194
|
+
"""Builds a `StrokeVertex` using the default constructor,
|
|
2195
|
+
copy constructor, from 2 `StrokeVertex` and an interpolation parameter,
|
|
2196
|
+
from a CurvePoint, from a SVertex, or a `SVertex` and a `StrokeAttribute` object.
|
|
2197
|
+
|
|
2198
|
+
:param svertex: An SVertex object.An SVertex object.
|
|
2199
|
+
:type svertex: typing.Union[SVertex, SVertex]
|
|
2200
|
+
:param attribute: A StrokeAttribute object.
|
|
2201
|
+
:type attribute: StrokeAttribute
|
|
1580
2202
|
"""
|
|
1581
2203
|
...
|
|
1582
2204
|
|
|
1583
2205
|
class StrokeVertexIterator:
|
|
1584
|
-
"""Class hierarchy: `Iterator` > `StrokeVertexIterator`
|
|
2206
|
+
"""Class hierarchy: `Iterator` > `StrokeVertexIterator`Class defining an iterator designed to iterate over the
|
|
2207
|
+
`StrokeVertex` of a `Stroke`. An instance of a
|
|
2208
|
+
StrokeVertexIterator can be obtained from a Stroke by calling
|
|
2209
|
+
iter(), stroke_vertices_begin() or stroke_vertices_begin(). It is iterating
|
|
2210
|
+
over the same vertices as an `Interface0DIterator`. The difference
|
|
2211
|
+
resides in the object access: an Interface0DIterator only allows
|
|
2212
|
+
access to an Interface0D while one might need to access the
|
|
2213
|
+
specialized StrokeVertex type. In this case, one should use a
|
|
2214
|
+
StrokeVertexIterator. To call functions of the UnaryFuntion0D type,
|
|
2215
|
+
a StrokeVertexIterator can be converted to an Interface0DIterator by
|
|
2216
|
+
by calling Interface0DIterator(it).
|
|
2217
|
+
"""
|
|
1585
2218
|
|
|
1586
2219
|
at_last: bool
|
|
1587
|
-
""" True if the iterator points to the last valid element.
|
|
2220
|
+
""" True if the iterator points to the last valid element.
|
|
2221
|
+
For its counterpart (pointing to the first valid element), use it.is_begin.
|
|
1588
2222
|
|
|
1589
2223
|
:type: bool
|
|
1590
2224
|
"""
|
|
1591
2225
|
|
|
1592
|
-
object:
|
|
2226
|
+
object: StrokeVertex
|
|
1593
2227
|
""" The StrokeVertex object currently pointed to by this iterator.
|
|
1594
2228
|
|
|
1595
|
-
:type:
|
|
2229
|
+
:type: StrokeVertex
|
|
1596
2230
|
"""
|
|
1597
2231
|
|
|
1598
2232
|
t: float
|
|
@@ -1608,84 +2242,107 @@ class StrokeVertexIterator:
|
|
|
1608
2242
|
"""
|
|
1609
2243
|
|
|
1610
2244
|
def __init__(self):
|
|
1611
|
-
"""
|
|
2245
|
+
"""Creates a `StrokeVertexIterator` using either the
|
|
2246
|
+
default constructor or the copy constructor.
|
|
2247
|
+
|
|
2248
|
+
"""
|
|
2249
|
+
...
|
|
2250
|
+
|
|
2251
|
+
def __init__(self, brother: StrokeVertexIterator):
|
|
2252
|
+
"""Creates a `StrokeVertexIterator` using either the
|
|
2253
|
+
default constructor or the copy constructor.
|
|
1612
2254
|
|
|
1613
|
-
|
|
1614
|
-
|
|
2255
|
+
:param brother: A StrokeVertexIterator object.
|
|
2256
|
+
:type brother: StrokeVertexIterator
|
|
1615
2257
|
"""
|
|
1616
2258
|
...
|
|
1617
2259
|
|
|
1618
|
-
def decremented(self) ->
|
|
2260
|
+
def decremented(self) -> StrokeVertexIterator:
|
|
1619
2261
|
"""Returns a copy of a decremented StrokeVertexIterator.
|
|
1620
2262
|
|
|
1621
|
-
:rtype: 'StrokeVertexIterator'
|
|
1622
2263
|
:return: A StrokeVertexIterator pointing the previous StrokeVertex.
|
|
2264
|
+
:rtype: StrokeVertexIterator
|
|
1623
2265
|
"""
|
|
1624
2266
|
...
|
|
1625
2267
|
|
|
1626
|
-
def incremented(self) ->
|
|
2268
|
+
def incremented(self) -> StrokeVertexIterator:
|
|
1627
2269
|
"""Returns a copy of an incremented StrokeVertexIterator.
|
|
1628
2270
|
|
|
1629
|
-
:rtype: 'StrokeVertexIterator'
|
|
1630
2271
|
:return: A StrokeVertexIterator pointing the next StrokeVertex.
|
|
2272
|
+
:rtype: StrokeVertexIterator
|
|
1631
2273
|
"""
|
|
1632
2274
|
...
|
|
1633
2275
|
|
|
1634
|
-
def reversed(self) ->
|
|
1635
|
-
"""Returns a StrokeVertexIterator that traverses stroke vertices in the
|
|
2276
|
+
def reversed(self) -> StrokeVertexIterator:
|
|
2277
|
+
"""Returns a StrokeVertexIterator that traverses stroke vertices in the
|
|
2278
|
+
reversed order.
|
|
1636
2279
|
|
|
1637
|
-
|
|
1638
|
-
|
|
2280
|
+
:return: A StrokeVertexIterator traversing stroke vertices backward.
|
|
2281
|
+
:rtype: StrokeVertexIterator
|
|
1639
2282
|
"""
|
|
1640
2283
|
...
|
|
1641
2284
|
|
|
1642
2285
|
class TVertex:
|
|
1643
|
-
"""Class hierarchy: `Interface0D` > `ViewVertex` > `TVertex`
|
|
2286
|
+
"""Class hierarchy: `Interface0D` > `ViewVertex` > `TVertex`Class to define a T vertex, i.e. an intersection between two edges.
|
|
2287
|
+
It points towards two SVertex and four ViewEdges. Among the
|
|
2288
|
+
ViewEdges, two are front and the other two are back. Basically a
|
|
2289
|
+
front edge hides part of a back edge. So, among the back edges, one
|
|
2290
|
+
is of invisibility N and the other of invisibility N+1.
|
|
2291
|
+
"""
|
|
1644
2292
|
|
|
1645
|
-
back_svertex:
|
|
2293
|
+
back_svertex: SVertex
|
|
1646
2294
|
""" The SVertex that is further away from the viewpoint.
|
|
1647
2295
|
|
|
1648
|
-
:type:
|
|
2296
|
+
:type: SVertex
|
|
1649
2297
|
"""
|
|
1650
2298
|
|
|
1651
|
-
front_svertex:
|
|
2299
|
+
front_svertex: SVertex
|
|
1652
2300
|
""" The SVertex that is closer to the viewpoint.
|
|
1653
2301
|
|
|
1654
|
-
:type:
|
|
2302
|
+
:type: SVertex
|
|
1655
2303
|
"""
|
|
1656
2304
|
|
|
1657
|
-
id:
|
|
2305
|
+
id: Id
|
|
1658
2306
|
""" The Id of this TVertex.
|
|
1659
2307
|
|
|
1660
|
-
:type:
|
|
2308
|
+
:type: Id
|
|
1661
2309
|
"""
|
|
1662
2310
|
|
|
1663
2311
|
def __init__(self):
|
|
1664
2312
|
"""Default constructor."""
|
|
1665
2313
|
...
|
|
1666
2314
|
|
|
1667
|
-
def get_mate(self, viewedge:
|
|
1668
|
-
"""Returns the mate edge of the ViewEdge given as argument. If the
|
|
2315
|
+
def get_mate(self, viewedge: ViewEdge) -> ViewEdge:
|
|
2316
|
+
"""Returns the mate edge of the ViewEdge given as argument. If the
|
|
2317
|
+
ViewEdge is frontEdgeA, frontEdgeB is returned. If the ViewEdge is
|
|
2318
|
+
frontEdgeB, frontEdgeA is returned. Same for back edges.
|
|
1669
2319
|
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
2320
|
+
:param viewedge: A ViewEdge object.
|
|
2321
|
+
:type viewedge: ViewEdge
|
|
2322
|
+
:return: The mate edge of the given ViewEdge.
|
|
2323
|
+
:rtype: ViewEdge
|
|
1674
2324
|
"""
|
|
1675
2325
|
...
|
|
1676
2326
|
|
|
1677
|
-
def get_svertex(self, fedge:
|
|
2327
|
+
def get_svertex(self, fedge: FEdge) -> FEdge:
|
|
1678
2328
|
"""Returns the SVertex (among the 2) belonging to the given FEdge.
|
|
1679
2329
|
|
|
1680
2330
|
:param fedge: An FEdge object.
|
|
1681
|
-
:type fedge:
|
|
1682
|
-
:rtype: 'SVertex'
|
|
2331
|
+
:type fedge: FEdge
|
|
1683
2332
|
:return: The SVertex belonging to the given FEdge.
|
|
2333
|
+
:rtype: SVertex
|
|
1684
2334
|
"""
|
|
1685
2335
|
...
|
|
1686
2336
|
|
|
1687
2337
|
class UnaryFunction0D:
|
|
1688
|
-
"""Base class for Unary Functions (functors) working on
|
|
2338
|
+
"""Base class for Unary Functions (functors) working on
|
|
2339
|
+
`Interface0DIterator`. A unary function will be used by
|
|
2340
|
+
invoking __call__() on an Interface0DIterator. In Python, several
|
|
2341
|
+
different subclasses of UnaryFunction0D are used depending on the
|
|
2342
|
+
types of functors' return values. For example, you would inherit from
|
|
2343
|
+
a `UnaryFunction0DDouble` if you wish to define a function that
|
|
2344
|
+
returns a double value. Available UnaryFunction0D subclasses are:
|
|
2345
|
+
"""
|
|
1689
2346
|
|
|
1690
2347
|
name: str
|
|
1691
2348
|
""" The name of the unary 0D function.
|
|
@@ -1694,77 +2351,105 @@ class UnaryFunction0D:
|
|
|
1694
2351
|
"""
|
|
1695
2352
|
|
|
1696
2353
|
class UnaryFunction0DDouble:
|
|
1697
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DDouble`
|
|
2354
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DDouble`Base class for unary functions (functors) that work on
|
|
2355
|
+
`Interface0DIterator` and return a float value.
|
|
2356
|
+
"""
|
|
1698
2357
|
|
|
1699
2358
|
def __init__(self):
|
|
1700
2359
|
"""Default constructor."""
|
|
1701
2360
|
...
|
|
1702
2361
|
|
|
1703
2362
|
class UnaryFunction0DEdgeNature:
|
|
1704
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DEdgeNature`
|
|
2363
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DEdgeNature`Base class for unary functions (functors) that work on
|
|
2364
|
+
`Interface0DIterator` and return a `Nature` object.
|
|
2365
|
+
"""
|
|
1705
2366
|
|
|
1706
2367
|
def __init__(self):
|
|
1707
2368
|
"""Default constructor."""
|
|
1708
2369
|
...
|
|
1709
2370
|
|
|
1710
2371
|
class UnaryFunction0DFloat:
|
|
1711
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DFloat`
|
|
2372
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DFloat`Base class for unary functions (functors) that work on
|
|
2373
|
+
`Interface0DIterator` and return a float value.
|
|
2374
|
+
"""
|
|
1712
2375
|
|
|
1713
2376
|
def __init__(self):
|
|
1714
2377
|
"""Default constructor."""
|
|
1715
2378
|
...
|
|
1716
2379
|
|
|
1717
2380
|
class UnaryFunction0DId:
|
|
1718
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DId`
|
|
2381
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DId`Base class for unary functions (functors) that work on
|
|
2382
|
+
`Interface0DIterator` and return an `Id` object.
|
|
2383
|
+
"""
|
|
1719
2384
|
|
|
1720
2385
|
def __init__(self):
|
|
1721
2386
|
"""Default constructor."""
|
|
1722
2387
|
...
|
|
1723
2388
|
|
|
1724
2389
|
class UnaryFunction0DMaterial:
|
|
1725
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DMaterial`
|
|
2390
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DMaterial`Base class for unary functions (functors) that work on
|
|
2391
|
+
`Interface0DIterator` and return a `Material` object.
|
|
2392
|
+
"""
|
|
1726
2393
|
|
|
1727
2394
|
def __init__(self):
|
|
1728
2395
|
"""Default constructor."""
|
|
1729
2396
|
...
|
|
1730
2397
|
|
|
1731
2398
|
class UnaryFunction0DUnsigned:
|
|
1732
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DUnsigned`
|
|
2399
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DUnsigned`Base class for unary functions (functors) that work on
|
|
2400
|
+
`Interface0DIterator` and return an int value.
|
|
2401
|
+
"""
|
|
1733
2402
|
|
|
1734
2403
|
def __init__(self):
|
|
1735
2404
|
"""Default constructor."""
|
|
1736
2405
|
...
|
|
1737
2406
|
|
|
1738
2407
|
class UnaryFunction0DVec2f:
|
|
1739
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVec2f`
|
|
2408
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVec2f`Base class for unary functions (functors) that work on
|
|
2409
|
+
`Interface0DIterator` and return a 2D vector.
|
|
2410
|
+
"""
|
|
1740
2411
|
|
|
1741
2412
|
def __init__(self):
|
|
1742
2413
|
"""Default constructor."""
|
|
1743
2414
|
...
|
|
1744
2415
|
|
|
1745
2416
|
class UnaryFunction0DVec3f:
|
|
1746
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVec3f`
|
|
2417
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVec3f`Base class for unary functions (functors) that work on
|
|
2418
|
+
`Interface0DIterator` and return a 3D vector.
|
|
2419
|
+
"""
|
|
1747
2420
|
|
|
1748
2421
|
def __init__(self):
|
|
1749
2422
|
"""Default constructor."""
|
|
1750
2423
|
...
|
|
1751
2424
|
|
|
1752
2425
|
class UnaryFunction0DVectorViewShape:
|
|
1753
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVectorViewShape`
|
|
2426
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DVectorViewShape`Base class for unary functions (functors) that work on
|
|
2427
|
+
`Interface0DIterator` and return a list of `ViewShape`
|
|
2428
|
+
objects.
|
|
2429
|
+
"""
|
|
1754
2430
|
|
|
1755
2431
|
def __init__(self):
|
|
1756
2432
|
"""Default constructor."""
|
|
1757
2433
|
...
|
|
1758
2434
|
|
|
1759
2435
|
class UnaryFunction0DViewShape:
|
|
1760
|
-
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DViewShape`
|
|
2436
|
+
"""Class hierarchy: `UnaryFunction0D` > `UnaryFunction0DViewShape`Base class for unary functions (functors) that work on
|
|
2437
|
+
`Interface0DIterator` and return a `ViewShape` object.
|
|
2438
|
+
"""
|
|
1761
2439
|
|
|
1762
2440
|
def __init__(self):
|
|
1763
2441
|
"""Default constructor."""
|
|
1764
2442
|
...
|
|
1765
2443
|
|
|
1766
2444
|
class UnaryFunction1D:
|
|
1767
|
-
"""Base class for Unary Functions (functors) working on
|
|
2445
|
+
"""Base class for Unary Functions (functors) working on
|
|
2446
|
+
`Interface1D`. A unary function will be used by invoking
|
|
2447
|
+
__call__() on an Interface1D. In Python, several different subclasses
|
|
2448
|
+
of UnaryFunction1D are used depending on the types of functors' return
|
|
2449
|
+
values. For example, you would inherit from a
|
|
2450
|
+
`UnaryFunction1DDouble` if you wish to define a function that
|
|
2451
|
+
returns a double value. Available UnaryFunction1D subclasses are:
|
|
2452
|
+
"""
|
|
1768
2453
|
|
|
1769
2454
|
name: str
|
|
1770
2455
|
""" The name of the unary 1D function.
|
|
@@ -1773,143 +2458,230 @@ class UnaryFunction1D:
|
|
|
1773
2458
|
"""
|
|
1774
2459
|
|
|
1775
2460
|
class UnaryFunction1DDouble:
|
|
1776
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DDouble`
|
|
2461
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DDouble`Base class for unary functions (functors) that work on
|
|
2462
|
+
`Interface1D` and return a float value.
|
|
2463
|
+
"""
|
|
1777
2464
|
|
|
1778
|
-
integration_type:
|
|
2465
|
+
integration_type: IntegrationType
|
|
1779
2466
|
""" The integration method.
|
|
1780
2467
|
|
|
1781
|
-
:type:
|
|
2468
|
+
:type: IntegrationType
|
|
1782
2469
|
"""
|
|
1783
2470
|
|
|
1784
2471
|
def __init__(self):
|
|
1785
|
-
"""
|
|
2472
|
+
"""Builds a unary 1D function using the default constructor
|
|
2473
|
+
or the integration method given as an argument.
|
|
1786
2474
|
|
|
1787
|
-
|
|
1788
|
-
|
|
2475
|
+
"""
|
|
2476
|
+
...
|
|
2477
|
+
|
|
2478
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2479
|
+
"""Builds a unary 1D function using the default constructor
|
|
2480
|
+
or the integration method given as an argument.
|
|
2481
|
+
|
|
2482
|
+
:param integration_type: An integration method.
|
|
2483
|
+
:type integration_type: IntegrationType
|
|
1789
2484
|
"""
|
|
1790
2485
|
...
|
|
1791
2486
|
|
|
1792
2487
|
class UnaryFunction1DEdgeNature:
|
|
1793
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DEdgeNature`
|
|
2488
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DEdgeNature`Base class for unary functions (functors) that work on
|
|
2489
|
+
`Interface1D` and return a `Nature` object.
|
|
2490
|
+
"""
|
|
1794
2491
|
|
|
1795
|
-
integration_type:
|
|
2492
|
+
integration_type: IntegrationType
|
|
1796
2493
|
""" The integration method.
|
|
1797
2494
|
|
|
1798
|
-
:type:
|
|
2495
|
+
:type: IntegrationType
|
|
1799
2496
|
"""
|
|
1800
2497
|
|
|
1801
2498
|
def __init__(self):
|
|
1802
|
-
"""
|
|
2499
|
+
"""Builds a unary 1D function using the default constructor
|
|
2500
|
+
or the integration method given as an argument.
|
|
2501
|
+
|
|
2502
|
+
"""
|
|
2503
|
+
...
|
|
1803
2504
|
|
|
1804
|
-
|
|
1805
|
-
|
|
2505
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2506
|
+
"""Builds a unary 1D function using the default constructor
|
|
2507
|
+
or the integration method given as an argument.
|
|
2508
|
+
|
|
2509
|
+
:param integration_type: An integration method.
|
|
2510
|
+
:type integration_type: IntegrationType
|
|
1806
2511
|
"""
|
|
1807
2512
|
...
|
|
1808
2513
|
|
|
1809
2514
|
class UnaryFunction1DFloat:
|
|
1810
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DFloat`
|
|
2515
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DFloat`Base class for unary functions (functors) that work on
|
|
2516
|
+
`Interface1D` and return a float value.
|
|
2517
|
+
"""
|
|
1811
2518
|
|
|
1812
|
-
integration_type:
|
|
2519
|
+
integration_type: IntegrationType
|
|
1813
2520
|
""" The integration method.
|
|
1814
2521
|
|
|
1815
|
-
:type:
|
|
2522
|
+
:type: IntegrationType
|
|
1816
2523
|
"""
|
|
1817
2524
|
|
|
1818
2525
|
def __init__(self):
|
|
1819
|
-
"""
|
|
2526
|
+
"""Builds a unary 1D function using the default constructor
|
|
2527
|
+
or the integration method given as an argument.
|
|
2528
|
+
|
|
2529
|
+
"""
|
|
2530
|
+
...
|
|
2531
|
+
|
|
2532
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2533
|
+
"""Builds a unary 1D function using the default constructor
|
|
2534
|
+
or the integration method given as an argument.
|
|
1820
2535
|
|
|
1821
|
-
|
|
1822
|
-
|
|
2536
|
+
:param integration_type: An integration method.
|
|
2537
|
+
:type integration_type: IntegrationType
|
|
1823
2538
|
"""
|
|
1824
2539
|
...
|
|
1825
2540
|
|
|
1826
2541
|
class UnaryFunction1DUnsigned:
|
|
1827
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DUnsigned`
|
|
2542
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DUnsigned`Base class for unary functions (functors) that work on
|
|
2543
|
+
`Interface1D` and return an int value.
|
|
2544
|
+
"""
|
|
1828
2545
|
|
|
1829
|
-
integration_type:
|
|
2546
|
+
integration_type: IntegrationType
|
|
1830
2547
|
""" The integration method.
|
|
1831
2548
|
|
|
1832
|
-
:type:
|
|
2549
|
+
:type: IntegrationType
|
|
1833
2550
|
"""
|
|
1834
2551
|
|
|
1835
2552
|
def __init__(self):
|
|
1836
|
-
"""
|
|
2553
|
+
"""Builds a unary 1D function using the default constructor
|
|
2554
|
+
or the integration method given as an argument.
|
|
2555
|
+
|
|
2556
|
+
"""
|
|
2557
|
+
...
|
|
2558
|
+
|
|
2559
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2560
|
+
"""Builds a unary 1D function using the default constructor
|
|
2561
|
+
or the integration method given as an argument.
|
|
1837
2562
|
|
|
1838
|
-
|
|
1839
|
-
|
|
2563
|
+
:param integration_type: An integration method.
|
|
2564
|
+
:type integration_type: IntegrationType
|
|
1840
2565
|
"""
|
|
1841
2566
|
...
|
|
1842
2567
|
|
|
1843
2568
|
class UnaryFunction1DVec2f:
|
|
1844
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVec2f`
|
|
2569
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVec2f`Base class for unary functions (functors) that work on
|
|
2570
|
+
`Interface1D` and return a 2D vector.
|
|
2571
|
+
"""
|
|
1845
2572
|
|
|
1846
|
-
integration_type:
|
|
2573
|
+
integration_type: IntegrationType
|
|
1847
2574
|
""" The integration method.
|
|
1848
2575
|
|
|
1849
|
-
:type:
|
|
2576
|
+
:type: IntegrationType
|
|
1850
2577
|
"""
|
|
1851
2578
|
|
|
1852
2579
|
def __init__(self):
|
|
1853
|
-
"""
|
|
2580
|
+
"""Builds a unary 1D function using the default constructor
|
|
2581
|
+
or the integration method given as an argument.
|
|
2582
|
+
|
|
2583
|
+
"""
|
|
2584
|
+
...
|
|
2585
|
+
|
|
2586
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2587
|
+
"""Builds a unary 1D function using the default constructor
|
|
2588
|
+
or the integration method given as an argument.
|
|
1854
2589
|
|
|
1855
|
-
|
|
1856
|
-
|
|
2590
|
+
:param integration_type: An integration method.
|
|
2591
|
+
:type integration_type: IntegrationType
|
|
1857
2592
|
"""
|
|
1858
2593
|
...
|
|
1859
2594
|
|
|
1860
2595
|
class UnaryFunction1DVec3f:
|
|
1861
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVec3f`
|
|
2596
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVec3f`Base class for unary functions (functors) that work on
|
|
2597
|
+
`Interface1D` and return a 3D vector.
|
|
2598
|
+
"""
|
|
1862
2599
|
|
|
1863
|
-
integration_type:
|
|
2600
|
+
integration_type: IntegrationType
|
|
1864
2601
|
""" The integration method.
|
|
1865
2602
|
|
|
1866
|
-
:type:
|
|
2603
|
+
:type: IntegrationType
|
|
1867
2604
|
"""
|
|
1868
2605
|
|
|
1869
2606
|
def __init__(self):
|
|
1870
|
-
"""
|
|
2607
|
+
"""Builds a unary 1D function using the default constructor
|
|
2608
|
+
or the integration method given as an argument.
|
|
1871
2609
|
|
|
1872
|
-
|
|
1873
|
-
|
|
2610
|
+
"""
|
|
2611
|
+
...
|
|
2612
|
+
|
|
2613
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2614
|
+
"""Builds a unary 1D function using the default constructor
|
|
2615
|
+
or the integration method given as an argument.
|
|
2616
|
+
|
|
2617
|
+
:param integration_type: An integration method.
|
|
2618
|
+
:type integration_type: IntegrationType
|
|
1874
2619
|
"""
|
|
1875
2620
|
...
|
|
1876
2621
|
|
|
1877
2622
|
class UnaryFunction1DVectorViewShape:
|
|
1878
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVectorViewShape`
|
|
2623
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVectorViewShape`Base class for unary functions (functors) that work on
|
|
2624
|
+
`Interface1D` and return a list of `ViewShape`
|
|
2625
|
+
objects.
|
|
2626
|
+
"""
|
|
1879
2627
|
|
|
1880
|
-
integration_type:
|
|
2628
|
+
integration_type: IntegrationType
|
|
1881
2629
|
""" The integration method.
|
|
1882
2630
|
|
|
1883
|
-
:type:
|
|
2631
|
+
:type: IntegrationType
|
|
1884
2632
|
"""
|
|
1885
2633
|
|
|
1886
2634
|
def __init__(self):
|
|
1887
|
-
"""
|
|
2635
|
+
"""Builds a unary 1D function using the default constructor
|
|
2636
|
+
or the integration method given as an argument.
|
|
1888
2637
|
|
|
1889
|
-
|
|
1890
|
-
|
|
2638
|
+
"""
|
|
2639
|
+
...
|
|
2640
|
+
|
|
2641
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2642
|
+
"""Builds a unary 1D function using the default constructor
|
|
2643
|
+
or the integration method given as an argument.
|
|
2644
|
+
|
|
2645
|
+
:param integration_type: An integration method.
|
|
2646
|
+
:type integration_type: IntegrationType
|
|
1891
2647
|
"""
|
|
1892
2648
|
...
|
|
1893
2649
|
|
|
1894
2650
|
class UnaryFunction1DVoid:
|
|
1895
|
-
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVoid`
|
|
2651
|
+
"""Class hierarchy: `UnaryFunction1D` > `UnaryFunction1DVoid`Base class for unary functions (functors) working on
|
|
2652
|
+
`Interface1D`.
|
|
2653
|
+
"""
|
|
1896
2654
|
|
|
1897
|
-
integration_type:
|
|
2655
|
+
integration_type: IntegrationType
|
|
1898
2656
|
""" The integration method.
|
|
1899
2657
|
|
|
1900
|
-
:type:
|
|
2658
|
+
:type: IntegrationType
|
|
1901
2659
|
"""
|
|
1902
2660
|
|
|
1903
2661
|
def __init__(self):
|
|
1904
|
-
"""
|
|
2662
|
+
"""Builds a unary 1D function using either a default constructor
|
|
2663
|
+
or the integration method given as an argument.
|
|
1905
2664
|
|
|
1906
|
-
|
|
1907
|
-
|
|
2665
|
+
"""
|
|
2666
|
+
...
|
|
2667
|
+
|
|
2668
|
+
def __init__(self, integration_type: IntegrationType):
|
|
2669
|
+
"""Builds a unary 1D function using either a default constructor
|
|
2670
|
+
or the integration method given as an argument.
|
|
2671
|
+
|
|
2672
|
+
:param integration_type: An integration method.
|
|
2673
|
+
:type integration_type: IntegrationType
|
|
1908
2674
|
"""
|
|
1909
2675
|
...
|
|
1910
2676
|
|
|
1911
2677
|
class UnaryPredicate0D:
|
|
1912
|
-
"""Base class for unary predicates that work on
|
|
2678
|
+
"""Base class for unary predicates that work on
|
|
2679
|
+
`Interface0DIterator`. A UnaryPredicate0D is a functor that
|
|
2680
|
+
evaluates a condition on an Interface0DIterator and returns true or
|
|
2681
|
+
false depending on whether this condition is satisfied or not. The
|
|
2682
|
+
UnaryPredicate0D is used by invoking its __call__() method. Any
|
|
2683
|
+
inherited class must overload the __call__() method.
|
|
2684
|
+
"""
|
|
1913
2685
|
|
|
1914
2686
|
name: str
|
|
1915
2687
|
""" The name of the unary 0D predicate.
|
|
@@ -1921,18 +2693,25 @@ class UnaryPredicate0D:
|
|
|
1921
2693
|
"""Default constructor."""
|
|
1922
2694
|
...
|
|
1923
2695
|
|
|
1924
|
-
def __call__(self, it:
|
|
2696
|
+
def __call__(self, it: Interface0DIterator) -> Interface0DIterator:
|
|
1925
2697
|
"""Must be overload by inherited classes.
|
|
1926
2698
|
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2699
|
+
:param it: The Interface0DIterator pointing onto the Interface0D at
|
|
2700
|
+
which we wish to evaluate the predicate.
|
|
2701
|
+
:type it: Interface0DIterator
|
|
2702
|
+
:return: True if the condition is satisfied, false otherwise.
|
|
2703
|
+
:rtype: bool
|
|
1931
2704
|
"""
|
|
1932
2705
|
...
|
|
1933
2706
|
|
|
1934
2707
|
class UnaryPredicate1D:
|
|
1935
|
-
"""Base class for unary predicates that work on `Interface1D`. A
|
|
2708
|
+
"""Base class for unary predicates that work on `Interface1D`. A
|
|
2709
|
+
UnaryPredicate1D is a functor that evaluates a condition on a
|
|
2710
|
+
Interface1D and returns true or false depending on whether this
|
|
2711
|
+
condition is satisfied or not. The UnaryPredicate1D is used by
|
|
2712
|
+
invoking its __call__() method. Any inherited class must overload the
|
|
2713
|
+
__call__() method.
|
|
2714
|
+
"""
|
|
1936
2715
|
|
|
1937
2716
|
name: str
|
|
1938
2717
|
""" The name of the unary 1D predicate.
|
|
@@ -1944,18 +2723,21 @@ class UnaryPredicate1D:
|
|
|
1944
2723
|
"""Default constructor."""
|
|
1945
2724
|
...
|
|
1946
2725
|
|
|
1947
|
-
def __call__(self, inter:
|
|
2726
|
+
def __call__(self, inter: Interface1D) -> Interface1D:
|
|
1948
2727
|
"""Must be overload by inherited classes.
|
|
1949
2728
|
|
|
1950
2729
|
:param inter: The Interface1D on which we wish to evaluate the predicate.
|
|
1951
|
-
:type inter:
|
|
1952
|
-
:rtype: bool
|
|
2730
|
+
:type inter: Interface1D
|
|
1953
2731
|
:return: True if the condition is satisfied, false otherwise.
|
|
2732
|
+
:rtype: bool
|
|
1954
2733
|
"""
|
|
1955
2734
|
...
|
|
1956
2735
|
|
|
1957
2736
|
class ViewEdge:
|
|
1958
|
-
"""Class hierarchy: `Interface1D` > `ViewEdge`
|
|
2737
|
+
"""Class hierarchy: `Interface1D` > `ViewEdge`Class defining a ViewEdge. A ViewEdge in an edge of the image graph.
|
|
2738
|
+
it connects two `ViewVertex` objects. It is made by connecting
|
|
2739
|
+
a set of FEdges.
|
|
2740
|
+
"""
|
|
1959
2741
|
|
|
1960
2742
|
chaining_time_stamp: int
|
|
1961
2743
|
""" The time stamp of this ViewEdge.
|
|
@@ -1963,22 +2745,22 @@ class ViewEdge:
|
|
|
1963
2745
|
:type: int
|
|
1964
2746
|
"""
|
|
1965
2747
|
|
|
1966
|
-
first_fedge:
|
|
2748
|
+
first_fedge: FEdge
|
|
1967
2749
|
""" The first FEdge that constitutes this ViewEdge.
|
|
1968
2750
|
|
|
1969
|
-
:type:
|
|
2751
|
+
:type: FEdge
|
|
1970
2752
|
"""
|
|
1971
2753
|
|
|
1972
|
-
first_viewvertex:
|
|
2754
|
+
first_viewvertex: ViewVertex
|
|
1973
2755
|
""" The first ViewVertex.
|
|
1974
2756
|
|
|
1975
|
-
:type:
|
|
2757
|
+
:type: ViewVertex
|
|
1976
2758
|
"""
|
|
1977
2759
|
|
|
1978
|
-
id:
|
|
2760
|
+
id: Id
|
|
1979
2761
|
""" The Id of this ViewEdge.
|
|
1980
2762
|
|
|
1981
|
-
:type:
|
|
2763
|
+
:type: Id
|
|
1982
2764
|
"""
|
|
1983
2765
|
|
|
1984
2766
|
is_closed: bool
|
|
@@ -1987,28 +2769,29 @@ class ViewEdge:
|
|
|
1987
2769
|
:type: bool
|
|
1988
2770
|
"""
|
|
1989
2771
|
|
|
1990
|
-
last_fedge:
|
|
2772
|
+
last_fedge: FEdge
|
|
1991
2773
|
""" The last FEdge that constitutes this ViewEdge.
|
|
1992
2774
|
|
|
1993
|
-
:type:
|
|
2775
|
+
:type: FEdge
|
|
1994
2776
|
"""
|
|
1995
2777
|
|
|
1996
|
-
last_viewvertex:
|
|
2778
|
+
last_viewvertex: ViewVertex
|
|
1997
2779
|
""" The second ViewVertex.
|
|
1998
2780
|
|
|
1999
|
-
:type:
|
|
2781
|
+
:type: ViewVertex
|
|
2000
2782
|
"""
|
|
2001
2783
|
|
|
2002
|
-
nature:
|
|
2784
|
+
nature: Nature
|
|
2003
2785
|
""" The nature of this ViewEdge.
|
|
2004
2786
|
|
|
2005
|
-
:type:
|
|
2787
|
+
:type: Nature
|
|
2006
2788
|
"""
|
|
2007
2789
|
|
|
2008
|
-
occludee:
|
|
2009
|
-
""" The shape that is occluded by the ViewShape to which this ViewEdge
|
|
2790
|
+
occludee: ViewShape
|
|
2791
|
+
""" The shape that is occluded by the ViewShape to which this ViewEdge
|
|
2792
|
+
belongs to. If no object is occluded, this property is set to None.
|
|
2010
2793
|
|
|
2011
|
-
:type:
|
|
2794
|
+
:type: ViewShape
|
|
2012
2795
|
"""
|
|
2013
2796
|
|
|
2014
2797
|
qi: int
|
|
@@ -2017,17 +2800,21 @@ class ViewEdge:
|
|
|
2017
2800
|
:type: int
|
|
2018
2801
|
"""
|
|
2019
2802
|
|
|
2020
|
-
viewshape:
|
|
2803
|
+
viewshape: ViewShape
|
|
2021
2804
|
""" The ViewShape to which this ViewEdge belongs to.
|
|
2022
2805
|
|
|
2023
|
-
:type:
|
|
2806
|
+
:type: ViewShape
|
|
2024
2807
|
"""
|
|
2025
2808
|
|
|
2026
2809
|
def __init__(self):
|
|
2027
|
-
"""
|
|
2810
|
+
"""Builds a `ViewEdge` using the default constructor or the copy constructor."""
|
|
2811
|
+
...
|
|
2812
|
+
|
|
2813
|
+
def __init__(self, brother: ViewEdge):
|
|
2814
|
+
"""Builds a `ViewEdge` using the default constructor or the copy constructor.
|
|
2028
2815
|
|
|
2029
2816
|
:param brother: A ViewEdge object.
|
|
2030
|
-
:type brother:
|
|
2817
|
+
:type brother: ViewEdge
|
|
2031
2818
|
"""
|
|
2032
2819
|
...
|
|
2033
2820
|
|
|
@@ -2036,43 +2823,59 @@ class ViewEdge:
|
|
|
2036
2823
|
...
|
|
2037
2824
|
|
|
2038
2825
|
class ViewEdgeIterator:
|
|
2039
|
-
"""Class hierarchy: `Iterator` > `ViewEdgeIterator`
|
|
2826
|
+
"""Class hierarchy: `Iterator` > `ViewEdgeIterator`Base class for iterators over ViewEdges of the `ViewMap` Graph.
|
|
2827
|
+
Basically the increment() operator of this class should be able to
|
|
2828
|
+
take the decision of "where" (on which ViewEdge) to go when pointing
|
|
2829
|
+
on a given ViewEdge.
|
|
2830
|
+
"""
|
|
2040
2831
|
|
|
2041
|
-
begin:
|
|
2832
|
+
begin: ViewEdge
|
|
2042
2833
|
""" The first ViewEdge used for the iteration.
|
|
2043
2834
|
|
|
2044
|
-
:type:
|
|
2835
|
+
:type: ViewEdge
|
|
2045
2836
|
"""
|
|
2046
2837
|
|
|
2047
|
-
current_edge:
|
|
2838
|
+
current_edge: ViewEdge
|
|
2048
2839
|
""" The ViewEdge object currently pointed by this iterator.
|
|
2049
2840
|
|
|
2050
|
-
:type:
|
|
2841
|
+
:type: ViewEdge
|
|
2051
2842
|
"""
|
|
2052
2843
|
|
|
2053
|
-
object:
|
|
2844
|
+
object: ViewEdge
|
|
2054
2845
|
""" The ViewEdge object currently pointed by this iterator.
|
|
2055
2846
|
|
|
2056
|
-
:type:
|
|
2847
|
+
:type: ViewEdge
|
|
2057
2848
|
"""
|
|
2058
2849
|
|
|
2059
2850
|
orientation: bool
|
|
2060
|
-
""" The orientation of the pointed ViewEdge in the iteration.
|
|
2851
|
+
""" The orientation of the pointed ViewEdge in the iteration.
|
|
2852
|
+
If true, the iterator looks for the next ViewEdge among those ViewEdges
|
|
2853
|
+
that surround the ending ViewVertex of the "begin" ViewEdge. If false,
|
|
2854
|
+
the iterator searches over the ViewEdges surrounding the ending ViewVertex
|
|
2855
|
+
of the "begin" ViewEdge.
|
|
2061
2856
|
|
|
2062
2857
|
:type: bool
|
|
2063
2858
|
"""
|
|
2064
2859
|
|
|
2065
|
-
def __init__(
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
"""__init__(brother) Builds a ViewEdgeIterator from a starting ViewEdge and its orientation or the copy constructor.
|
|
2860
|
+
def __init__(self, begin=None, orientation: bool = True):
|
|
2861
|
+
"""Builds a ViewEdgeIterator from a starting ViewEdge and its
|
|
2862
|
+
orientation or the copy constructor.
|
|
2069
2863
|
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2864
|
+
:param begin: The ViewEdge from where to start the iteration.
|
|
2865
|
+
:param orientation: If true, we'll look for the next ViewEdge among
|
|
2866
|
+
the ViewEdges that surround the ending ViewVertex of begin. If
|
|
2867
|
+
false, we'll search over the ViewEdges surrounding the ending
|
|
2868
|
+
ViewVertex of begin.
|
|
2869
|
+
:type orientation: bool
|
|
2870
|
+
"""
|
|
2871
|
+
...
|
|
2872
|
+
|
|
2873
|
+
def __init__(self, brother: ViewEdgeIterator):
|
|
2874
|
+
"""Builds a ViewEdgeIterator from a starting ViewEdge and its
|
|
2875
|
+
orientation or the copy constructor.
|
|
2876
|
+
|
|
2877
|
+
:param brother: A ViewEdgeIterator object.
|
|
2878
|
+
:type brother: ViewEdgeIterator
|
|
2076
2879
|
"""
|
|
2077
2880
|
...
|
|
2078
2881
|
|
|
@@ -2083,53 +2886,55 @@ class ViewEdgeIterator:
|
|
|
2083
2886
|
class ViewMap:
|
|
2084
2887
|
"""Class defining the ViewMap."""
|
|
2085
2888
|
|
|
2086
|
-
scene_bbox:
|
|
2889
|
+
scene_bbox: BBox
|
|
2087
2890
|
""" The 3D bounding box of the scene.
|
|
2088
2891
|
|
|
2089
|
-
:type:
|
|
2892
|
+
:type: BBox
|
|
2090
2893
|
"""
|
|
2091
2894
|
|
|
2092
2895
|
def __init__(self):
|
|
2093
2896
|
"""Default constructor."""
|
|
2094
2897
|
...
|
|
2095
2898
|
|
|
2096
|
-
def get_closest_fedge(self, x: float, y: float) ->
|
|
2899
|
+
def get_closest_fedge(self, x: float, y: float) -> float:
|
|
2097
2900
|
"""Gets the FEdge nearest to the 2D point specified as arguments.
|
|
2098
2901
|
|
|
2099
2902
|
:param x: X coordinate of a 2D point.
|
|
2100
2903
|
:type x: float
|
|
2101
2904
|
:param y: Y coordinate of a 2D point.
|
|
2102
2905
|
:type y: float
|
|
2103
|
-
:rtype: 'FEdge'
|
|
2104
2906
|
:return: The FEdge nearest to the specified 2D point.
|
|
2907
|
+
:rtype: FEdge
|
|
2105
2908
|
"""
|
|
2106
2909
|
...
|
|
2107
2910
|
|
|
2108
|
-
def get_closest_viewedge(self, x: float, y: float) ->
|
|
2911
|
+
def get_closest_viewedge(self, x: float, y: float) -> float:
|
|
2109
2912
|
"""Gets the ViewEdge nearest to the 2D point specified as arguments.
|
|
2110
2913
|
|
|
2111
2914
|
:param x: X coordinate of a 2D point.
|
|
2112
2915
|
:type x: float
|
|
2113
2916
|
:param y: Y coordinate of a 2D point.
|
|
2114
2917
|
:type y: float
|
|
2115
|
-
:rtype: 'ViewEdge'
|
|
2116
2918
|
:return: The ViewEdge nearest to the specified 2D point.
|
|
2919
|
+
:rtype: ViewEdge
|
|
2117
2920
|
"""
|
|
2118
2921
|
...
|
|
2119
2922
|
|
|
2120
2923
|
class ViewShape:
|
|
2121
|
-
"""Class gathering the elements of the ViewMap (i.e., `ViewVertex`
|
|
2924
|
+
"""Class gathering the elements of the ViewMap (i.e., `ViewVertex`
|
|
2925
|
+
and `ViewEdge`) that are issued from the same input shape.
|
|
2926
|
+
"""
|
|
2122
2927
|
|
|
2123
|
-
edges: typing.List[
|
|
2928
|
+
edges: typing.List[ViewEdge]
|
|
2124
2929
|
""" The list of ViewEdge objects contained in this ViewShape.
|
|
2125
2930
|
|
|
2126
|
-
:type: typing.List[
|
|
2931
|
+
:type: typing.List[ViewEdge]
|
|
2127
2932
|
"""
|
|
2128
2933
|
|
|
2129
|
-
id:
|
|
2934
|
+
id: Id
|
|
2130
2935
|
""" The Id of this ViewShape.
|
|
2131
2936
|
|
|
2132
|
-
:type:
|
|
2937
|
+
:type: Id
|
|
2133
2938
|
"""
|
|
2134
2939
|
|
|
2135
2940
|
library_path: typing.Union[str, typing.Any]
|
|
@@ -2144,92 +2949,133 @@ class ViewShape:
|
|
|
2144
2949
|
:type: str
|
|
2145
2950
|
"""
|
|
2146
2951
|
|
|
2147
|
-
sshape:
|
|
2952
|
+
sshape: SShape
|
|
2148
2953
|
""" The SShape on top of which this ViewShape is built.
|
|
2149
2954
|
|
|
2150
|
-
:type:
|
|
2955
|
+
:type: SShape
|
|
2151
2956
|
"""
|
|
2152
2957
|
|
|
2153
|
-
vertices: typing.List[
|
|
2958
|
+
vertices: typing.List[ViewVertex]
|
|
2154
2959
|
""" The list of ViewVertex objects contained in this ViewShape.
|
|
2155
2960
|
|
|
2156
|
-
:type: typing.List[
|
|
2961
|
+
:type: typing.List[ViewVertex]
|
|
2157
2962
|
"""
|
|
2158
2963
|
|
|
2159
2964
|
def __init__(self):
|
|
2160
|
-
"""
|
|
2965
|
+
"""Builds a `ViewShape` using the default constructor,
|
|
2966
|
+
copy constructor, or from a `SShape`.
|
|
2161
2967
|
|
|
2162
|
-
:param brother: A ViewShape object.
|
|
2163
|
-
:type brother: 'ViewShape'
|
|
2164
|
-
:param sshape: An SShape object.
|
|
2165
|
-
:type sshape: 'SShape'
|
|
2166
2968
|
"""
|
|
2167
2969
|
...
|
|
2168
2970
|
|
|
2169
|
-
def
|
|
2971
|
+
def __init__(self, brother: ViewShape):
|
|
2972
|
+
"""Builds a `ViewShape` using the default constructor,
|
|
2973
|
+
copy constructor, or from a `SShape`.
|
|
2974
|
+
|
|
2975
|
+
:param brother: A ViewShape object.
|
|
2976
|
+
:type brother: ViewShape
|
|
2977
|
+
"""
|
|
2978
|
+
...
|
|
2979
|
+
|
|
2980
|
+
def __init__(self, sshape: SShape):
|
|
2981
|
+
"""Builds a `ViewShape` using the default constructor,
|
|
2982
|
+
copy constructor, or from a `SShape`.
|
|
2983
|
+
|
|
2984
|
+
:param sshape: An SShape object.
|
|
2985
|
+
:type sshape: SShape
|
|
2986
|
+
"""
|
|
2987
|
+
...
|
|
2988
|
+
|
|
2989
|
+
def add_edge(self, edge: ViewEdge):
|
|
2170
2990
|
"""Adds a ViewEdge to the list of ViewEdge objects.
|
|
2171
2991
|
|
|
2172
2992
|
:param edge: A ViewEdge object.
|
|
2173
|
-
:type edge:
|
|
2993
|
+
:type edge: ViewEdge
|
|
2174
2994
|
"""
|
|
2175
2995
|
...
|
|
2176
2996
|
|
|
2177
|
-
def add_vertex(self, vertex:
|
|
2997
|
+
def add_vertex(self, vertex: ViewVertex):
|
|
2178
2998
|
"""Adds a ViewVertex to the list of the ViewVertex objects.
|
|
2179
2999
|
|
|
2180
3000
|
:param vertex: A ViewVertex object.
|
|
2181
|
-
:type vertex:
|
|
3001
|
+
:type vertex: ViewVertex
|
|
2182
3002
|
"""
|
|
2183
3003
|
...
|
|
2184
3004
|
|
|
2185
3005
|
class ViewVertex:
|
|
2186
|
-
"""Class hierarchy: `Interface0D` > `ViewVertex`
|
|
2187
|
-
|
|
2188
|
-
nature
|
|
3006
|
+
"""Class hierarchy: `Interface0D` > `ViewVertex`Class to define a view vertex. A view vertex is a feature vertex
|
|
3007
|
+
corresponding to a point of the image graph, where the characteristics
|
|
3008
|
+
of an edge (e.g., nature and visibility) might change. A
|
|
3009
|
+
`ViewVertex` can be of two kinds: A `TVertex` when it
|
|
3010
|
+
corresponds to the intersection between two ViewEdges or a
|
|
3011
|
+
`NonTVertex` when it corresponds to a vertex of the initial
|
|
3012
|
+
input mesh (it is the case for vertices such as corners for example).
|
|
3013
|
+
Thus, this class can be specialized into two classes, the
|
|
3014
|
+
`TVertex` class and the `NonTVertex` class.
|
|
3015
|
+
"""
|
|
3016
|
+
|
|
3017
|
+
nature: Nature
|
|
2189
3018
|
""" The nature of this ViewVertex.
|
|
2190
3019
|
|
|
2191
|
-
:type:
|
|
3020
|
+
:type: Nature
|
|
2192
3021
|
"""
|
|
2193
3022
|
|
|
2194
|
-
def edges_begin(self) ->
|
|
2195
|
-
"""Returns an iterator over the ViewEdges that goes to or comes from
|
|
3023
|
+
def edges_begin(self) -> Nature:
|
|
3024
|
+
"""Returns an iterator over the ViewEdges that goes to or comes from
|
|
3025
|
+
this ViewVertex pointing to the first ViewEdge of the list. The
|
|
3026
|
+
orientedViewEdgeIterator allows to iterate in CCW order over these
|
|
3027
|
+
ViewEdges and to get the orientation for each ViewEdge
|
|
3028
|
+
(incoming/outgoing).
|
|
2196
3029
|
|
|
2197
|
-
|
|
2198
|
-
|
|
3030
|
+
:return: An orientedViewEdgeIterator pointing to the first ViewEdge.
|
|
3031
|
+
:rtype: orientedViewEdgeIterator
|
|
2199
3032
|
"""
|
|
2200
3033
|
...
|
|
2201
3034
|
|
|
2202
|
-
def edges_end(self) ->
|
|
2203
|
-
"""Returns an orientedViewEdgeIterator over the ViewEdges around this
|
|
3035
|
+
def edges_end(self) -> orientedViewEdgeIterator:
|
|
3036
|
+
"""Returns an orientedViewEdgeIterator over the ViewEdges around this
|
|
3037
|
+
ViewVertex, pointing after the last ViewEdge.
|
|
2204
3038
|
|
|
2205
|
-
|
|
2206
|
-
|
|
3039
|
+
:return: An orientedViewEdgeIterator pointing after the last ViewEdge.
|
|
3040
|
+
:rtype: orientedViewEdgeIterator
|
|
2207
3041
|
"""
|
|
2208
3042
|
...
|
|
2209
3043
|
|
|
2210
|
-
def edges_iterator(self, edge:
|
|
2211
|
-
"""Returns an orientedViewEdgeIterator pointing to the ViewEdge given
|
|
3044
|
+
def edges_iterator(self, edge: ViewEdge) -> ViewEdge:
|
|
3045
|
+
"""Returns an orientedViewEdgeIterator pointing to the ViewEdge given
|
|
3046
|
+
as argument.
|
|
2212
3047
|
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
3048
|
+
:param edge: A ViewEdge object.
|
|
3049
|
+
:type edge: ViewEdge
|
|
3050
|
+
:return: An orientedViewEdgeIterator pointing to the given ViewEdge.
|
|
3051
|
+
:rtype: orientedViewEdgeIterator
|
|
2217
3052
|
"""
|
|
2218
3053
|
...
|
|
2219
3054
|
|
|
2220
3055
|
class orientedViewEdgeIterator:
|
|
2221
|
-
"""Class hierarchy: `Iterator` > `orientedViewEdgeIterator`
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
:type: typing.Union[bool, 'ViewEdge']
|
|
3056
|
+
"""Class hierarchy: `Iterator` > `orientedViewEdgeIterator`Class representing an iterator over oriented ViewEdges around a
|
|
3057
|
+
`ViewVertex`. This iterator allows a CCW iteration (in the image
|
|
3058
|
+
plane). An instance of an orientedViewEdgeIterator can only be
|
|
3059
|
+
obtained from a ViewVertex by calling edges_begin() or edges_end().
|
|
2227
3060
|
"""
|
|
2228
3061
|
|
|
3062
|
+
object: typing.Any
|
|
3063
|
+
""" The oriented ViewEdge (i.e., a tuple of the pointed ViewEdge and a boolean
|
|
3064
|
+
value) currently pointed to by this iterator. If the boolean value is true,
|
|
3065
|
+
the ViewEdge is incoming."""
|
|
3066
|
+
|
|
2229
3067
|
def __init__(self):
|
|
2230
|
-
"""
|
|
3068
|
+
"""Creates an `orientedViewEdgeIterator` using either the
|
|
3069
|
+
default constructor or the copy constructor.
|
|
3070
|
+
|
|
3071
|
+
"""
|
|
3072
|
+
...
|
|
3073
|
+
|
|
3074
|
+
def __init__(self, iBrother: orientedViewEdgeIterator):
|
|
3075
|
+
"""Creates an `orientedViewEdgeIterator` using either the
|
|
3076
|
+
default constructor or the copy constructor.
|
|
2231
3077
|
|
|
2232
|
-
|
|
2233
|
-
|
|
3078
|
+
:param iBrother: An orientedViewEdgeIterator object.
|
|
3079
|
+
:type iBrother: orientedViewEdgeIterator
|
|
2234
3080
|
"""
|
|
2235
3081
|
...
|