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
mathutils/geometry/__init__.pyi
CHANGED
|
@@ -1,448 +1,446 @@
|
|
|
1
|
-
import sys
|
|
2
1
|
import typing
|
|
3
2
|
import mathutils
|
|
4
3
|
|
|
5
4
|
GenericType = typing.TypeVar("GenericType")
|
|
6
5
|
|
|
7
6
|
def area_tri(
|
|
8
|
-
v1: typing.Union[typing.Sequence[float],
|
|
9
|
-
v2: typing.Union[typing.Sequence[float],
|
|
10
|
-
v3: typing.Union[typing.Sequence[float],
|
|
7
|
+
v1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
8
|
+
v2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
9
|
+
v3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
11
10
|
) -> float:
|
|
12
11
|
"""Returns the area size of the 2D or 3D triangle defined.
|
|
13
12
|
|
|
14
13
|
:param v1: Point1
|
|
15
|
-
:type v1: typing.Union[typing.Sequence[float],
|
|
14
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
16
15
|
:param v2: Point2
|
|
17
|
-
:type v2: typing.Union[typing.Sequence[float],
|
|
16
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
18
17
|
:param v3: Point3
|
|
19
|
-
:type v3: typing.Union[typing.Sequence[float],
|
|
18
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
20
19
|
:rtype: float
|
|
21
20
|
"""
|
|
22
21
|
|
|
23
22
|
...
|
|
24
23
|
|
|
25
24
|
def barycentric_transform(
|
|
26
|
-
point: typing.Union[typing.Sequence[float],
|
|
27
|
-
tri_a1: typing.Union[typing.Sequence[float],
|
|
28
|
-
tri_a2: typing.Union[typing.Sequence[float],
|
|
29
|
-
tri_a3: typing.Union[typing.Sequence[float],
|
|
30
|
-
tri_b1: typing.Union[typing.Sequence[float],
|
|
31
|
-
tri_b2: typing.Union[typing.Sequence[float],
|
|
32
|
-
tri_b3: typing.Union[typing.Sequence[float],
|
|
33
|
-
)
|
|
25
|
+
point: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
26
|
+
tri_a1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
27
|
+
tri_a2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
28
|
+
tri_a3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
29
|
+
tri_b1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
30
|
+
tri_b2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
31
|
+
tri_b3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
32
|
+
):
|
|
34
33
|
"""Return a transformed point, the transformation is defined by 2 triangles.
|
|
35
34
|
|
|
36
35
|
:param point: The point to transform.
|
|
37
|
-
:type point: typing.Union[typing.Sequence[float],
|
|
36
|
+
:type point: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
38
37
|
:param tri_a1: source triangle vertex.
|
|
39
|
-
:type tri_a1: typing.Union[typing.Sequence[float],
|
|
38
|
+
:type tri_a1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
40
39
|
:param tri_a2: source triangle vertex.
|
|
41
|
-
:type tri_a2: typing.Union[typing.Sequence[float],
|
|
40
|
+
:type tri_a2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
42
41
|
:param tri_a3: source triangle vertex.
|
|
43
|
-
:type tri_a3: typing.Union[typing.Sequence[float],
|
|
42
|
+
:type tri_a3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
44
43
|
:param tri_b1: target triangle vertex.
|
|
45
|
-
:type tri_b1: typing.Union[typing.Sequence[float],
|
|
44
|
+
:type tri_b1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
46
45
|
:param tri_b2: target triangle vertex.
|
|
47
|
-
:type tri_b2: typing.Union[typing.Sequence[float],
|
|
46
|
+
:type tri_b2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
48
47
|
:param tri_b3: target triangle vertex.
|
|
49
|
-
:type tri_b3: typing.Union[typing.Sequence[float],
|
|
50
|
-
:rtype: typing.Any
|
|
48
|
+
:type tri_b3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
51
49
|
:return: The transformed point
|
|
52
50
|
"""
|
|
53
51
|
|
|
54
52
|
...
|
|
55
53
|
|
|
56
|
-
def box_fit_2d(points:
|
|
54
|
+
def box_fit_2d(points: list) -> float:
|
|
57
55
|
"""Returns an angle that best fits the points to an axis aligned rectangle
|
|
58
56
|
|
|
59
57
|
:param points: list of 2d points.
|
|
60
|
-
:type points:
|
|
61
|
-
:rtype: float
|
|
58
|
+
:type points: list
|
|
62
59
|
:return: angle
|
|
60
|
+
:rtype: float
|
|
63
61
|
"""
|
|
64
62
|
|
|
65
63
|
...
|
|
66
64
|
|
|
67
|
-
def box_pack_2d(boxes:
|
|
65
|
+
def box_pack_2d(boxes: list) -> typing.Tuple:
|
|
68
66
|
"""Returns a tuple with the width and height of the packed bounding box.
|
|
69
67
|
|
|
70
68
|
:param boxes: list of boxes, each box is a list where the first 4 items are [x, y, width, height, ...] other items are ignored.
|
|
71
|
-
:type boxes:
|
|
72
|
-
:rtype: typing.Tuple
|
|
69
|
+
:type boxes: list
|
|
73
70
|
:return: the width and height of the packed bounding box
|
|
71
|
+
:rtype: typing.Tuple
|
|
74
72
|
"""
|
|
75
73
|
|
|
76
74
|
...
|
|
77
75
|
|
|
78
76
|
def closest_point_on_tri(
|
|
79
|
-
pt: typing.Union[typing.Sequence[float],
|
|
80
|
-
tri_p1: typing.Union[typing.Sequence[float],
|
|
81
|
-
tri_p2: typing.Union[typing.Sequence[float],
|
|
82
|
-
tri_p3: typing.Union[typing.Sequence[float],
|
|
83
|
-
) ->
|
|
77
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
78
|
+
tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
79
|
+
tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
80
|
+
tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
81
|
+
) -> mathutils.Vector:
|
|
84
82
|
"""Takes 4 vectors: one is the point and the next 3 define the triangle.
|
|
85
83
|
|
|
86
84
|
:param pt: Point
|
|
87
|
-
:type pt: typing.Union[typing.Sequence[float],
|
|
85
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
88
86
|
:param tri_p1: First point of the triangle
|
|
89
|
-
:type tri_p1: typing.Union[typing.Sequence[float],
|
|
87
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
90
88
|
:param tri_p2: Second point of the triangle
|
|
91
|
-
:type tri_p2: typing.Union[typing.Sequence[float],
|
|
89
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
92
90
|
:param tri_p3: Third point of the triangle
|
|
93
|
-
:type tri_p3: typing.Union[typing.Sequence[float],
|
|
94
|
-
:rtype: 'mathutils.Vector'
|
|
91
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
95
92
|
:return: The closest point of the triangle.
|
|
93
|
+
:rtype: mathutils.Vector
|
|
96
94
|
"""
|
|
97
95
|
|
|
98
96
|
...
|
|
99
97
|
|
|
100
|
-
def convex_hull_2d(points:
|
|
98
|
+
def convex_hull_2d(points: list) -> typing.List[int]:
|
|
101
99
|
"""Returns a list of indices into the list given
|
|
102
100
|
|
|
103
101
|
:param points: list of 2d points.
|
|
104
|
-
:type points:
|
|
105
|
-
:rtype: typing.List[int]
|
|
102
|
+
:type points: list
|
|
106
103
|
:return: a list of indices
|
|
104
|
+
:rtype: typing.List[int]
|
|
107
105
|
"""
|
|
108
106
|
|
|
109
107
|
...
|
|
110
108
|
|
|
111
|
-
def delaunay_2d_cdt(
|
|
112
|
-
|
|
113
|
-
edges
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
:
|
|
125
|
-
:
|
|
126
|
-
:
|
|
127
|
-
:
|
|
128
|
-
:
|
|
109
|
+
def delaunay_2d_cdt(vert_coords, edges, faces, output_type, epsilon, need_ids=True):
|
|
110
|
+
"""Computes the Constrained Delaunay Triangulation of a set of vertices,
|
|
111
|
+
with edges and faces that must appear in the triangulation.
|
|
112
|
+
Some triangles may be eaten away, or combined with other triangles,
|
|
113
|
+
according to output type.
|
|
114
|
+
The returned verts may be in a different order from input verts, may be moved
|
|
115
|
+
slightly, and may be merged with other nearby verts.
|
|
116
|
+
The three returned orig lists give, for each of verts, edges, and faces, the list of
|
|
117
|
+
input element indices corresponding to the positionally same output element.
|
|
118
|
+
For edges, the orig indices start with the input edges and then continue
|
|
119
|
+
with the edges implied by each of the faces (n of them for an n-gon).
|
|
120
|
+
If the need_ids argument is supplied, and False, then the code skips the preparation
|
|
121
|
+
of the orig arrays, which may save some time.
|
|
122
|
+
:arg vert_coords: Vertex coordinates (2d)
|
|
123
|
+
:type vert_coords: list of `mathutils.Vector`
|
|
124
|
+
:arg edges: Edges, as pairs of indices in vert_coords
|
|
125
|
+
:type edges: list of (int, int)
|
|
126
|
+
:arg faces: Faces, each sublist is a face, as indices in vert_coords (CCW oriented)
|
|
127
|
+
:type faces: list of list of int
|
|
128
|
+
:arg output_type: What output looks like. 0 => triangles with convex hull. 1 => triangles inside constraints. 2 => the input constraints, intersected. 3 => like 2 but detect holes and omit them from output. 4 => like 2 but with extra edges to make valid BMesh faces. 5 => like 4 but detect holes and omit them from output.
|
|
129
|
+
:type output_type: intn :arg epsilon: For nearness tests; should not be zero
|
|
129
130
|
:type epsilon: float
|
|
131
|
+
:arg need_ids: are the orig output arrays needed?
|
|
130
132
|
:type need_args: bool
|
|
131
|
-
:param need_ids: are the orig output arrays needed?
|
|
132
|
-
:type need_ids: typing.Any
|
|
133
|
-
:rtype: typing.Union[typing.List[int], typing.List['mathutils.Vector']]
|
|
134
133
|
:return: Output tuple, (vert_coords, edges, faces, orig_verts, orig_edges, orig_faces)
|
|
134
|
+
:rtype: (list of mathutils.Vector, list of (int, int), list of list of int, list of list of int, list of list of int, list of list of int)
|
|
135
|
+
|
|
135
136
|
"""
|
|
136
137
|
|
|
137
138
|
...
|
|
138
139
|
|
|
139
140
|
def distance_point_to_plane(
|
|
140
|
-
pt: typing.Union[typing.Sequence[float],
|
|
141
|
-
plane_co: typing.Union[typing.Sequence[float],
|
|
142
|
-
plane_no: typing.Union[typing.Sequence[float],
|
|
141
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
142
|
+
plane_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
143
|
+
plane_no: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
143
144
|
) -> float:
|
|
144
|
-
"""Returns the signed distance between a point and a plane
|
|
145
|
+
"""Returns the signed distance between a point and a plane (negative when below the normal).
|
|
145
146
|
|
|
146
147
|
:param pt: Point
|
|
147
|
-
:type pt: typing.Union[typing.Sequence[float],
|
|
148
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
148
149
|
:param plane_co: A point on the plane
|
|
149
|
-
:type plane_co: typing.Union[typing.Sequence[float],
|
|
150
|
+
:type plane_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
150
151
|
:param plane_no: The direction the plane is facing
|
|
151
|
-
:type plane_no: typing.Union[typing.Sequence[float],
|
|
152
|
+
:type plane_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
152
153
|
:rtype: float
|
|
153
154
|
"""
|
|
154
155
|
|
|
155
156
|
...
|
|
156
157
|
|
|
157
158
|
def interpolate_bezier(
|
|
158
|
-
knot1: typing.Union[typing.Sequence[float],
|
|
159
|
-
handle1: typing.Union[typing.Sequence[float],
|
|
160
|
-
handle2: typing.Union[typing.Sequence[float],
|
|
161
|
-
knot2: typing.Union[typing.Sequence[float],
|
|
159
|
+
knot1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
160
|
+
handle1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
161
|
+
handle2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
162
|
+
knot2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
162
163
|
resolution: int,
|
|
163
|
-
)
|
|
164
|
+
):
|
|
164
165
|
"""Interpolate a bezier spline segment.
|
|
165
166
|
|
|
166
167
|
:param knot1: First bezier spline point.
|
|
167
|
-
:type knot1: typing.Union[typing.Sequence[float],
|
|
168
|
+
:type knot1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
168
169
|
:param handle1: First bezier spline handle.
|
|
169
|
-
:type handle1: typing.Union[typing.Sequence[float],
|
|
170
|
+
:type handle1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
170
171
|
:param handle2: Second bezier spline handle.
|
|
171
|
-
:type handle2: typing.Union[typing.Sequence[float],
|
|
172
|
+
:type handle2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
172
173
|
:param knot2: Second bezier spline point.
|
|
173
|
-
:type knot2: typing.Union[typing.Sequence[float],
|
|
174
|
+
:type knot2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
174
175
|
:param resolution: Number of points to return.
|
|
175
176
|
:type resolution: int
|
|
176
|
-
:rtype: typing.List
|
|
177
177
|
:return: The interpolated points
|
|
178
178
|
"""
|
|
179
179
|
|
|
180
180
|
...
|
|
181
181
|
|
|
182
182
|
def intersect_line_line(
|
|
183
|
-
v1: typing.Union[typing.Sequence[float],
|
|
184
|
-
v2: typing.Union[typing.Sequence[float],
|
|
185
|
-
v3: typing.Union[typing.Sequence[float],
|
|
186
|
-
v4: typing.Union[typing.Sequence[float],
|
|
187
|
-
) -> typing.Tuple[
|
|
183
|
+
v1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
184
|
+
v2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
185
|
+
v3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
186
|
+
v4: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
187
|
+
) -> typing.Tuple[mathutils.Vector]:
|
|
188
188
|
"""Returns a tuple with the points on each line respectively closest to the other.
|
|
189
189
|
|
|
190
190
|
:param v1: First point of the first line
|
|
191
|
-
:type v1: typing.Union[typing.Sequence[float],
|
|
191
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
192
192
|
:param v2: Second point of the first line
|
|
193
|
-
:type v2: typing.Union[typing.Sequence[float],
|
|
193
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
194
194
|
:param v3: First point of the second line
|
|
195
|
-
:type v3: typing.Union[typing.Sequence[float],
|
|
195
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
196
196
|
:param v4: Second point of the second line
|
|
197
|
-
:type v4: typing.Union[typing.Sequence[float],
|
|
198
|
-
:rtype: typing.Tuple[
|
|
197
|
+
:type v4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
198
|
+
:rtype: typing.Tuple[mathutils.Vector]
|
|
199
199
|
"""
|
|
200
200
|
|
|
201
201
|
...
|
|
202
202
|
|
|
203
203
|
def intersect_line_line_2d(
|
|
204
|
-
lineA_p1: typing.Union[typing.Sequence[float],
|
|
205
|
-
lineA_p2: typing.Union[typing.Sequence[float],
|
|
206
|
-
lineB_p1: typing.Union[typing.Sequence[float],
|
|
207
|
-
lineB_p2: typing.Union[typing.Sequence[float],
|
|
208
|
-
)
|
|
204
|
+
lineA_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
205
|
+
lineA_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
206
|
+
lineB_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
207
|
+
lineB_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
208
|
+
):
|
|
209
209
|
"""Takes 2 segments (defined by 4 vectors) and returns a vector for their point of intersection or None.
|
|
210
210
|
|
|
211
211
|
:param lineA_p1: First point of the first line
|
|
212
|
-
:type lineA_p1: typing.Union[typing.Sequence[float],
|
|
212
|
+
:type lineA_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
213
213
|
:param lineA_p2: Second point of the first line
|
|
214
|
-
:type lineA_p2: typing.Union[typing.Sequence[float],
|
|
214
|
+
:type lineA_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
215
215
|
:param lineB_p1: First point of the second line
|
|
216
|
-
:type lineB_p1: typing.Union[typing.Sequence[float],
|
|
216
|
+
:type lineB_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
217
217
|
:param lineB_p2: Second point of the second line
|
|
218
|
-
:type lineB_p2: typing.Union[typing.Sequence[float],
|
|
219
|
-
:rtype: 'mathutils.Vector'
|
|
218
|
+
:type lineB_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
220
219
|
:return: The point of intersection or None when not found
|
|
221
220
|
"""
|
|
222
221
|
|
|
223
222
|
...
|
|
224
223
|
|
|
225
224
|
def intersect_line_plane(
|
|
226
|
-
line_a: typing.Union[typing.Sequence[float],
|
|
227
|
-
line_b: typing.Union[typing.Sequence[float],
|
|
228
|
-
plane_co: typing.Union[typing.Sequence[float],
|
|
229
|
-
plane_no: typing.Union[typing.Sequence[float],
|
|
225
|
+
line_a: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
226
|
+
line_b: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
227
|
+
plane_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
228
|
+
plane_no: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
230
229
|
no_flip=False,
|
|
231
|
-
)
|
|
232
|
-
"""Calculate the intersection between a line (as 2 vectors) and a plane.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
):
|
|
231
|
+
"""Calculate the intersection between a line (as 2 vectors) and a plane.
|
|
232
|
+
Returns a vector for the intersection or None.
|
|
233
|
+
|
|
234
|
+
:param line_a: First point of the first line
|
|
235
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
236
|
+
:param line_b: Second point of the first line
|
|
237
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
238
|
+
:param plane_co: A point on the plane
|
|
239
|
+
:type plane_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
240
|
+
:param plane_no: The direction the plane is facing
|
|
241
|
+
:type plane_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
242
|
+
:return: The point of intersection or None when not found
|
|
244
243
|
"""
|
|
245
244
|
|
|
246
245
|
...
|
|
247
246
|
|
|
248
247
|
def intersect_line_sphere(
|
|
249
|
-
line_a: typing.Union[typing.Sequence[float],
|
|
250
|
-
line_b: typing.Union[typing.Sequence[float],
|
|
251
|
-
sphere_co: typing.Union[typing.Sequence[float],
|
|
252
|
-
sphere_radius
|
|
248
|
+
line_a: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
249
|
+
line_b: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
250
|
+
sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
251
|
+
sphere_radius,
|
|
253
252
|
clip=True,
|
|
254
|
-
)
|
|
255
|
-
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
253
|
+
):
|
|
254
|
+
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
255
|
+
returns the intersection
|
|
256
|
+
|
|
257
|
+
:param line_a: First point of the line
|
|
258
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
259
|
+
:param line_b: Second point of the line
|
|
260
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
261
|
+
:param sphere_co: The center of the sphere
|
|
262
|
+
:type sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
263
|
+
:param sphere_radius: Radius of the sphere
|
|
264
|
+
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
267
265
|
"""
|
|
268
266
|
|
|
269
267
|
...
|
|
270
268
|
|
|
271
269
|
def intersect_line_sphere_2d(
|
|
272
|
-
line_a: typing.Union[typing.Sequence[float],
|
|
273
|
-
line_b: typing.Union[typing.Sequence[float],
|
|
274
|
-
sphere_co: typing.Union[typing.Sequence[float],
|
|
275
|
-
sphere_radius
|
|
270
|
+
line_a: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
271
|
+
line_b: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
272
|
+
sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
273
|
+
sphere_radius,
|
|
276
274
|
clip=True,
|
|
277
|
-
)
|
|
278
|
-
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
275
|
+
):
|
|
276
|
+
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
277
|
+
returns the intersection
|
|
278
|
+
|
|
279
|
+
:param line_a: First point of the line
|
|
280
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
281
|
+
:param line_b: Second point of the line
|
|
282
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
283
|
+
:param sphere_co: The center of the sphere
|
|
284
|
+
:type sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
285
|
+
:param sphere_radius: Radius of the sphere
|
|
286
|
+
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
290
287
|
"""
|
|
291
288
|
|
|
292
289
|
...
|
|
293
290
|
|
|
294
291
|
def intersect_plane_plane(
|
|
295
|
-
plane_a_co: typing.Union[typing.Sequence[float],
|
|
296
|
-
plane_a_no: typing.Union[typing.Sequence[float],
|
|
297
|
-
plane_b_co: typing.Union[typing.Sequence[float],
|
|
298
|
-
plane_b_no: typing.Union[typing.Sequence[float],
|
|
299
|
-
)
|
|
292
|
+
plane_a_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
293
|
+
plane_a_no: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
294
|
+
plane_b_co: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
295
|
+
plane_b_no: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
296
|
+
):
|
|
300
297
|
"""Return the intersection between two planes
|
|
301
298
|
|
|
302
299
|
:param plane_a_co: Point on the first plane
|
|
303
|
-
:type plane_a_co: typing.Union[typing.Sequence[float],
|
|
300
|
+
:type plane_a_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
304
301
|
:param plane_a_no: Normal of the first plane
|
|
305
|
-
:type plane_a_no: typing.Union[typing.Sequence[float],
|
|
302
|
+
:type plane_a_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
306
303
|
:param plane_b_co: Point on the second plane
|
|
307
|
-
:type plane_b_co: typing.Union[typing.Sequence[float],
|
|
304
|
+
:type plane_b_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
308
305
|
:param plane_b_no: Normal of the second plane
|
|
309
|
-
:type plane_b_no: typing.Union[typing.Sequence[float],
|
|
310
|
-
:rtype: typing.Tuple
|
|
306
|
+
:type plane_b_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
311
307
|
:return: The line of the intersection represented as a point and a vector
|
|
312
308
|
"""
|
|
313
309
|
|
|
314
310
|
...
|
|
315
311
|
|
|
316
312
|
def intersect_point_line(
|
|
317
|
-
pt: typing.Union[typing.Sequence[float],
|
|
318
|
-
line_p1: typing.Union[
|
|
313
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
314
|
+
line_p1: typing.Union[
|
|
315
|
+
typing.Sequence[float],
|
|
316
|
+
mathutils.Vector,
|
|
317
|
+
typing.Sequence[float],
|
|
318
|
+
mathutils.Vector,
|
|
319
|
+
],
|
|
319
320
|
line_p2,
|
|
320
|
-
)
|
|
321
|
+
):
|
|
321
322
|
"""Takes a point and a line and returns a tuple with the closest point on the line and its distance from the first point of the line as a percentage of the length of the line.
|
|
322
323
|
|
|
323
324
|
:param pt: Point
|
|
324
|
-
:type pt: typing.Union[typing.Sequence[float],
|
|
325
|
-
:param line_p1: First point of the
|
|
326
|
-
:type line_p1: typing.Union[typing.Sequence[float],
|
|
327
|
-
:param line_p1: First point of the line Second point of the line
|
|
328
|
-
:type line_p1: typing.Union[typing.Sequence[float], 'mathutils.Vector']
|
|
329
|
-
:rtype: typing.Union[float, 'mathutils.Vector']
|
|
325
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
326
|
+
:param line_p1: First point of the lineSecond point of the line
|
|
327
|
+
:type line_p1: typing.Union[typing.Sequence[float], mathutils.Vector, typing.Sequence[float], mathutils.Vector]
|
|
330
328
|
"""
|
|
331
329
|
|
|
332
330
|
...
|
|
333
331
|
|
|
334
332
|
def intersect_point_quad_2d(
|
|
335
|
-
pt: typing.Union[typing.Sequence[float],
|
|
336
|
-
quad_p1: typing.Union[typing.Sequence[float],
|
|
337
|
-
quad_p2: typing.Union[typing.Sequence[float],
|
|
338
|
-
quad_p3: typing.Union[typing.Sequence[float],
|
|
339
|
-
quad_p4: typing.Union[typing.Sequence[float],
|
|
333
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
334
|
+
quad_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
335
|
+
quad_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
336
|
+
quad_p3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
337
|
+
quad_p4: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
340
338
|
) -> int:
|
|
341
|
-
"""Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
339
|
+
"""Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad,
|
|
340
|
+
only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.
|
|
341
|
+
Works only with convex quads without singular edges.
|
|
342
|
+
|
|
343
|
+
:param pt: Point
|
|
344
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
345
|
+
:param quad_p1: First point of the quad
|
|
346
|
+
:type quad_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
347
|
+
:param quad_p2: Second point of the quad
|
|
348
|
+
:type quad_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
349
|
+
:param quad_p3: Third point of the quad
|
|
350
|
+
:type quad_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
351
|
+
:param quad_p4: Fourth point of the quad
|
|
352
|
+
:type quad_p4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
353
|
+
:rtype: int
|
|
354
354
|
"""
|
|
355
355
|
|
|
356
356
|
...
|
|
357
357
|
|
|
358
358
|
def intersect_point_tri(
|
|
359
|
-
pt: typing.Union[typing.Sequence[float],
|
|
360
|
-
tri_p1: typing.Union[typing.Sequence[float],
|
|
361
|
-
tri_p2: typing.Union[typing.Sequence[float],
|
|
362
|
-
tri_p3: typing.Union[typing.Sequence[float],
|
|
363
|
-
)
|
|
359
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
360
|
+
tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
361
|
+
tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
362
|
+
tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
363
|
+
):
|
|
364
364
|
"""Takes 4 vectors: one is the point and the next 3 define the triangle. Projects the point onto the triangle plane and checks if it is within the triangle.
|
|
365
365
|
|
|
366
366
|
:param pt: Point
|
|
367
|
-
:type pt: typing.Union[typing.Sequence[float],
|
|
367
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
368
368
|
:param tri_p1: First point of the triangle
|
|
369
|
-
:type tri_p1: typing.Union[typing.Sequence[float],
|
|
369
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
370
370
|
:param tri_p2: Second point of the triangle
|
|
371
|
-
:type tri_p2: typing.Union[typing.Sequence[float],
|
|
371
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
372
372
|
:param tri_p3: Third point of the triangle
|
|
373
|
-
:type tri_p3: typing.Union[typing.Sequence[float],
|
|
374
|
-
:rtype: 'mathutils.Vector'
|
|
373
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
375
374
|
:return: Point on the triangles plane or None if its outside the triangle
|
|
376
375
|
"""
|
|
377
376
|
|
|
378
377
|
...
|
|
379
378
|
|
|
380
379
|
def intersect_point_tri_2d(
|
|
381
|
-
pt: typing.Union[typing.Sequence[float],
|
|
382
|
-
tri_p1: typing.Union[typing.Sequence[float],
|
|
383
|
-
tri_p2: typing.Union[typing.Sequence[float],
|
|
384
|
-
tri_p3: typing.Union[typing.Sequence[float],
|
|
380
|
+
pt: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
381
|
+
tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
382
|
+
tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
383
|
+
tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
385
384
|
) -> int:
|
|
386
385
|
"""Takes 4 vectors (using only the x and y coordinates): one is the point and the next 3 define the triangle. Returns 1 if the point is within the triangle, otherwise 0.
|
|
387
386
|
|
|
388
387
|
:param pt: Point
|
|
389
|
-
:type pt: typing.Union[typing.Sequence[float],
|
|
388
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
390
389
|
:param tri_p1: First point of the triangle
|
|
391
|
-
:type tri_p1: typing.Union[typing.Sequence[float],
|
|
390
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
392
391
|
:param tri_p2: Second point of the triangle
|
|
393
|
-
:type tri_p2: typing.Union[typing.Sequence[float],
|
|
392
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
394
393
|
:param tri_p3: Third point of the triangle
|
|
395
|
-
:type tri_p3: typing.Union[typing.Sequence[float],
|
|
394
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
396
395
|
:rtype: int
|
|
397
396
|
"""
|
|
398
397
|
|
|
399
398
|
...
|
|
400
399
|
|
|
401
400
|
def intersect_ray_tri(
|
|
402
|
-
v1: typing.Union[typing.Sequence[float],
|
|
403
|
-
v2: typing.Union[typing.Sequence[float],
|
|
404
|
-
v3: typing.Union[typing.Sequence[float],
|
|
405
|
-
ray: typing.Union[typing.Sequence[float],
|
|
406
|
-
orig: typing.Union[typing.Sequence[float],
|
|
401
|
+
v1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
402
|
+
v2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
403
|
+
v3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
404
|
+
ray: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
405
|
+
orig: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
407
406
|
clip: bool = True,
|
|
408
|
-
)
|
|
407
|
+
):
|
|
409
408
|
"""Returns the intersection between a ray and a triangle, if possible, returns None otherwise.
|
|
410
409
|
|
|
411
410
|
:param v1: Point1
|
|
412
|
-
:type v1: typing.Union[typing.Sequence[float],
|
|
411
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
413
412
|
:param v2: Point2
|
|
414
|
-
:type v2: typing.Union[typing.Sequence[float],
|
|
413
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
415
414
|
:param v3: Point3
|
|
416
|
-
:type v3: typing.Union[typing.Sequence[float],
|
|
415
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
417
416
|
:param ray: Direction of the projection
|
|
418
|
-
:type ray: typing.Union[typing.Sequence[float],
|
|
417
|
+
:type ray: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
419
418
|
:param orig: Origin
|
|
420
|
-
:type orig: typing.Union[typing.Sequence[float],
|
|
419
|
+
:type orig: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
421
420
|
:param clip: When False, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
|
|
422
421
|
:type clip: bool
|
|
423
|
-
:rtype: 'mathutils.Vector'
|
|
424
422
|
:return: The point of intersection or None if no intersection is found
|
|
425
423
|
"""
|
|
426
424
|
|
|
427
425
|
...
|
|
428
426
|
|
|
429
427
|
def intersect_sphere_sphere_2d(
|
|
430
|
-
p_a: typing.Union[typing.Sequence[float],
|
|
428
|
+
p_a: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
431
429
|
radius_a: float,
|
|
432
|
-
p_b: typing.Union[typing.Sequence[float],
|
|
430
|
+
p_b: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
433
431
|
radius_b: float,
|
|
434
|
-
) -> typing.Tuple[
|
|
432
|
+
) -> typing.Tuple[mathutils.Vector]:
|
|
435
433
|
"""Returns 2 points on between intersecting circles.
|
|
436
434
|
|
|
437
435
|
:param p_a: Center of the first circle
|
|
438
|
-
:type p_a: typing.Union[typing.Sequence[float],
|
|
436
|
+
:type p_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
439
437
|
:param radius_a: Radius of the first circle
|
|
440
438
|
:type radius_a: float
|
|
441
439
|
:param p_b: Center of the second circle
|
|
442
|
-
:type p_b: typing.Union[typing.Sequence[float],
|
|
440
|
+
:type p_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
443
441
|
:param radius_b: Radius of the second circle
|
|
444
442
|
:type radius_b: float
|
|
445
|
-
:rtype: typing.Tuple[
|
|
443
|
+
:rtype: typing.Tuple[mathutils.Vector]
|
|
446
444
|
"""
|
|
447
445
|
|
|
448
446
|
...
|
|
@@ -455,53 +453,50 @@ def intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3) -> bool
|
|
|
455
453
|
|
|
456
454
|
...
|
|
457
455
|
|
|
458
|
-
def normal(vectors
|
|
456
|
+
def normal(vectors) -> mathutils.Vector:
|
|
459
457
|
"""Returns the normal of a 3D polygon.
|
|
460
458
|
|
|
461
459
|
:param vectors: Vectors to calculate normals with
|
|
462
|
-
:
|
|
463
|
-
:rtype: 'mathutils.Vector'
|
|
460
|
+
:rtype: mathutils.Vector
|
|
464
461
|
"""
|
|
465
462
|
|
|
466
463
|
...
|
|
467
464
|
|
|
468
|
-
def points_in_planes(planes: typing.List[
|
|
465
|
+
def points_in_planes(planes: typing.List[mathutils.Vector]):
|
|
469
466
|
"""Returns a list of points inside all planes given and a list of index values for the planes used.
|
|
470
467
|
|
|
471
468
|
:param planes: List of planes (4D vectors).
|
|
472
|
-
:type planes: typing.List[
|
|
473
|
-
:rtype: typing.Any
|
|
469
|
+
:type planes: typing.List[mathutils.Vector]
|
|
474
470
|
:return: two lists, once containing the vertices inside the planes, another containing the plane indices used
|
|
475
471
|
"""
|
|
476
472
|
|
|
477
473
|
...
|
|
478
474
|
|
|
479
|
-
def tessellate_polygon(veclist_list
|
|
475
|
+
def tessellate_polygon(veclist_list) -> list:
|
|
480
476
|
"""Takes a list of polylines (each point a pair or triplet of numbers) and returns the point indices for a polyline filled with triangles. Does not handle degenerate geometry (such as zero-length lines due to consecutive identical points).
|
|
481
477
|
|
|
482
|
-
:param veclist_list:
|
|
483
|
-
:
|
|
484
|
-
:rtype: typing.List
|
|
478
|
+
:param veclist_list: list of polylines
|
|
479
|
+
:rtype: list
|
|
485
480
|
"""
|
|
486
481
|
|
|
487
482
|
...
|
|
488
483
|
|
|
489
484
|
def volume_tetrahedron(
|
|
490
|
-
v1: typing.Union[typing.Sequence[float],
|
|
491
|
-
v2: typing.Union[typing.Sequence[float],
|
|
492
|
-
v3: typing.Union[typing.Sequence[float],
|
|
493
|
-
v4: typing.Union[typing.Sequence[float],
|
|
485
|
+
v1: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
486
|
+
v2: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
487
|
+
v3: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
488
|
+
v4: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
494
489
|
) -> float:
|
|
495
490
|
"""Return the volume formed by a tetrahedron (points can be in any order).
|
|
496
491
|
|
|
497
492
|
:param v1: Point1
|
|
498
|
-
:type v1: typing.Union[typing.Sequence[float],
|
|
493
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
499
494
|
:param v2: Point2
|
|
500
|
-
:type v2: typing.Union[typing.Sequence[float],
|
|
495
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
501
496
|
:param v3: Point3
|
|
502
|
-
:type v3: typing.Union[typing.Sequence[float],
|
|
497
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
503
498
|
:param v4: Point4
|
|
504
|
-
:type v4: typing.Union[typing.Sequence[float],
|
|
499
|
+
:type v4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
505
500
|
:rtype: float
|
|
506
501
|
"""
|
|
507
502
|
|