fake-bpy-module 20240224__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 -10
- animsys_refactor/__init__.pyi +36 -6
- aud/__init__.pyi +132 -125
- bgl/__init__.pyi +2545 -546
- bl_app_override/__init__.pyi +14 -3
- bl_app_override/helpers/__init__.pyi +24 -2
- bl_app_template_utils/__init__.pyi +19 -4
- bl_console_utils/autocomplete/complete_calltip/__init__.pyi +24 -5
- bl_console_utils/autocomplete/complete_import/__init__.pyi +14 -3
- bl_console_utils/autocomplete/complete_namespace/__init__.pyi +24 -5
- bl_console_utils/autocomplete/intellisense/__init__.pyi +9 -2
- bl_i18n_utils/bl_extract_messages/__init__.pyi +74 -15
- bl_i18n_utils/merge_po/__init__.pyi +4 -1
- bl_i18n_utils/settings/__init__.pyi +53 -6
- bl_i18n_utils/utils/__init__.pyi +332 -44
- bl_i18n_utils/utils_cli/__init__.pyi +29 -6
- bl_i18n_utils/utils_languages_menu/__init__.pyi +4 -1
- bl_i18n_utils/utils_rtl/__init__.pyi +9 -2
- bl_keymap_utils/io/__init__.pyi +44 -9
- bl_keymap_utils/keymap_from_toolbar/__init__.pyi +4 -1
- bl_keymap_utils/keymap_hierarchy/__init__.pyi +4 -1
- bl_keymap_utils/platform_helpers/__init__.pyi +9 -2
- bl_keymap_utils/versioning/__init__.pyi +4 -1
- bl_math/__init__.pyi +3 -3
- bl_operators/__init__.pyi +9 -2
- bl_operators/add_mesh_torus/__init__.pyi +171 -37
- bl_operators/anim/__init__.pyi +1065 -226
- bl_operators/assets/__init__.pyi +427 -92
- bl_operators/bmesh/find_adjacent/__init__.pyi +44 -9
- bl_operators/clip/__init__.pyi +1342 -287
- bl_operators/console/__init__.pyi +647 -140
- bl_operators/constraint/__init__.pyi +524 -112
- bl_operators/file/__init__.pyi +396 -84
- bl_operators/freestyle/__init__.pyi +532 -113
- bl_operators/geometry_nodes/__init__.pyi +2412 -596
- bl_operators/image/__init__.pyi +380 -82
- bl_operators/mesh/__init__.pyi +401 -85
- bl_operators/node/__init__.pyi +1756 -384
- bl_operators/object/__init__.pyi +2022 -552
- bl_operators/object_align/__init__.pyi +145 -31
- bl_operators/object_quick_effects/__init__.pyi +555 -124
- bl_operators/object_randomize_transform/__init__.pyi +136 -32
- bl_operators/presets/__init__.pyi +3516 -708
- bl_operators/rigidbody/__init__.pyi +401 -85
- bl_operators/screen_play_rendered_anim/__init__.pyi +129 -29
- bl_operators/sequencer/__init__.pyi +731 -149
- bl_operators/spreadsheet/__init__.pyi +145 -30
- bl_operators/userpref/__init__.pyi +3416 -824
- bl_operators/uvcalc_follow_active/__init__.pyi +149 -32
- bl_operators/uvcalc_lightmap/__init__.pyi +187 -34
- bl_operators/uvcalc_transform/__init__.pyi +344 -73
- bl_operators/vertexpaint_dirt/__init__.pyi +140 -30
- bl_operators/view3d/__init__.pyi +697 -146
- bl_operators/wm/__init__.pyi +6287 -1533
- bl_previews_utils/bl_previews_render/__init__.pyi +34 -7
- bl_rna_utils/data_path/__init__.pyi +12 -2
- bl_text_utils/external_editor/__init__.pyi +4 -1
- bl_ui/__init__.pyi +504 -106
- bl_ui/anim/__init__.pyi +164 -33
- bl_ui/asset_shelf/__init__.pyi +146 -31
- bl_ui/generic_ui_list/__init__.pyi +471 -99
- bl_ui/node_add_menu/__init__.pyi +196 -40
- bl_ui/node_add_menu_compositor/__init__.pyi +3017 -621
- bl_ui/node_add_menu_geometry/__init__.pyi +8060 -1625
- bl_ui/node_add_menu_shader/__init__.pyi +1709 -348
- bl_ui/node_add_menu_texture/__init__.pyi +1502 -305
- bl_ui/properties_animviz/__init__.pyi +32 -2
- bl_ui/properties_collection/__init__.pyi +787 -179
- bl_ui/properties_constraint/__init__.pyi +28635 -5523
- bl_ui/properties_data_armature/__init__.pyi +1905 -448
- bl_ui/properties_data_bone/__init__.pyi +1560 -336
- bl_ui/properties_data_camera/__init__.pyi +2269 -494
- bl_ui/properties_data_curve/__init__.pyi +2362 -534
- bl_ui/properties_data_curves/__init__.pyi +951 -203
- bl_ui/properties_data_empty/__init__.pyi +317 -69
- bl_ui/properties_data_gpencil/__init__.pyi +2924 -734
- bl_ui/properties_data_grease_pencil/__init__.pyi +1631 -188
- bl_ui/properties_data_lattice/__init__.pyi +472 -104
- bl_ui/properties_data_light/__init__.pyi +1570 -337
- bl_ui/properties_data_lightprobe/__init__.pyi +938 -208
- bl_ui/properties_data_mesh/__init__.pyi +3205 -767
- bl_ui/properties_data_metaball/__init__.pyi +774 -170
- bl_ui/properties_data_modifier/__init__.pyi +1554 -328
- bl_ui/properties_data_pointcloud/__init__.pyi +821 -194
- bl_ui/properties_data_shaderfx/__init__.pyi +154 -34
- bl_ui/properties_data_speaker/__init__.pyi +782 -168
- bl_ui/properties_data_volume/__init__.pyi +1243 -281
- bl_ui/properties_freestyle/__init__.pyi +4071 -1030
- bl_ui/properties_grease_pencil_common/__init__.pyi +2399 -483
- bl_ui/properties_mask_common/__init__.pyi +1256 -249
- bl_ui/properties_material/__init__.pyi +2351 -542
- bl_ui/properties_material_gpencil/__init__.pyi +1590 -365
- bl_ui/properties_object/__init__.pyi +2179 -512
- bl_ui/properties_output/__init__.pyi +2956 -705
- bl_ui/properties_paint_common/__init__.pyi +947 -140
- bl_ui/properties_particle/__init__.pyi +8322 -1970
- bl_ui/properties_physics_cloth/__init__.pyi +2254 -508
- bl_ui/properties_physics_common/__init__.pyi +200 -44
- bl_ui/properties_physics_dynamicpaint/__init__.pyi +4454 -965
- bl_ui/properties_physics_field/__init__.pyi +1695 -364
- bl_ui/properties_physics_fluid/__init__.pyi +6127 -1280
- bl_ui/properties_physics_geometry_nodes/__init__.pyi +157 -32
- bl_ui/properties_physics_rigidbody/__init__.pyi +1254 -278
- bl_ui/properties_physics_rigidbody_constraint/__init__.pyi +2053 -483
- bl_ui/properties_physics_softbody/__init__.pyi +2394 -542
- bl_ui/properties_render/__init__.pyi +8312 -1933
- bl_ui/properties_scene/__init__.pyi +2211 -539
- bl_ui/properties_texture/__init__.pyi +4185 -1013
- bl_ui/properties_view_layer/__init__.pyi +2803 -664
- bl_ui/properties_workspace/__init__.pyi +626 -148
- bl_ui/properties_world/__init__.pyi +1092 -234
- bl_ui/space_clip/__init__.pyi +11475 -2805
- bl_ui/space_console/__init__.pyi +967 -202
- bl_ui/space_dopesheet/__init__.pyi +4260 -966
- bl_ui/space_filebrowser/__init__.pyi +4852 -1187
- bl_ui/space_graph/__init__.pyi +3251 -702
- bl_ui/space_image/__init__.pyi +12219 -2968
- bl_ui/space_info/__init__.pyi +964 -200
- bl_ui/space_nla/__init__.pyi +2756 -584
- bl_ui/space_node/__init__.pyi +5661 -1265
- bl_ui/space_outliner/__init__.pyi +2294 -478
- bl_ui/space_properties/__init__.pyi +417 -92
- bl_ui/space_sequencer/__init__.pyi +12436 -3009
- bl_ui/space_spreadsheet/__init__.pyi +184 -36
- bl_ui/space_statusbar/__init__.pyi +135 -30
- bl_ui/space_text/__init__.pyi +2556 -542
- bl_ui/space_time/__init__.pyi +1151 -243
- bl_ui/space_toolsystem_common/__init__.pyi +368 -66
- bl_ui/space_toolsystem_toolbar/__init__.pyi +1378 -228
- bl_ui/space_topbar/__init__.pyi +4214 -887
- bl_ui/space_userpref/__init__.pyi +13920 -3468
- bl_ui/space_view3d/__init__.pyi +43701 -10599
- bl_ui/space_view3d_toolbar/__init__.pyi +16380 -3860
- bl_ui/utils/__init__.pyi +42 -4
- bl_ui_utils/bug_report_url/__init__.pyi +4 -1
- bl_ui_utils/layout/__init__.pyi +4 -1
- blend_render_info/__init__.pyi +13 -3
- blf/__init__.pyi +5 -7
- bmesh/__init__.pyi +7 -7
- bmesh/geometry/__init__.pyi +5 -5
- bmesh/ops/__init__.pyi +490 -504
- bmesh/types/__init__.pyi +268 -262
- bmesh/utils/__init__.pyi +55 -55
- bpy/__init__.pyi +2 -2
- bpy/app/__init__.pyi +4 -5
- bpy/app/handlers/__init__.pyi +36 -36
- bpy/app/icons/__init__.pyi +8 -10
- bpy/app/timers/__init__.pyi +9 -11
- bpy/app/translations/__init__.pyi +20 -22
- bpy/msgbus/__init__.pyi +3 -12
- bpy/ops/action/__init__.pyi +350 -305
- bpy/ops/anim/__init__.pyi +464 -426
- bpy/ops/armature/__init__.pyi +392 -360
- bpy/ops/asset/__init__.pyi +166 -129
- bpy/ops/boid/__init__.pyi +64 -37
- bpy/ops/brush/__init__.pyi +78 -72
- bpy/ops/buttons/__init__.pyi +136 -122
- bpy/ops/cachefile/__init__.pyi +128 -123
- bpy/ops/camera/__init__.pyi +22 -24
- bpy/ops/clip/__init__.pyi +844 -735
- bpy/ops/cloth/__init__.pyi +10 -11
- bpy/ops/collection/__init__.pyi +38 -38
- bpy/ops/console/__init__.pyi +170 -141
- bpy/ops/constraint/__init__.pyi +156 -159
- bpy/ops/curve/__init__.pyi +518 -461
- bpy/ops/curves/__init__.pyi +188 -159
- bpy/ops/cycles/__init__.pyi +20 -18
- bpy/ops/dpaint/__init__.pyi +40 -30
- bpy/ops/ed/__init__.pyi +136 -107
- bpy/ops/export_anim/__init__.pyi +18 -19
- bpy/ops/export_mesh/__init__.pyi +26 -27
- bpy/ops/export_scene/__init__.pyi +313 -334
- bpy/ops/file/__init__.pyi +394 -304
- bpy/ops/fluid/__init__.pyi +114 -63
- bpy/ops/font/__init__.pyi +272 -245
- bpy/ops/geometry/__init__.pyi +92 -87
- bpy/ops/gizmogroup/__init__.pyi +24 -21
- bpy/ops/gpencil/__init__.pyi +1530 -1476
- bpy/ops/graph/__init__.pyi +680 -659
- bpy/ops/grease_pencil/__init__.pyi +510 -390
- bpy/ops/image/__init__.pyi +650 -603
- bpy/ops/import_anim/__init__.pyi +26 -27
- bpy/ops/import_curve/__init__.pyi +6 -7
- bpy/ops/import_mesh/__init__.pyi +18 -21
- bpy/ops/import_scene/__init__.pyi +86 -95
- bpy/ops/info/__init__.pyi +68 -55
- bpy/ops/lattice/__init__.pyi +70 -63
- bpy/ops/marker/__init__.pyi +110 -111
- bpy/ops/mask/__init__.pyi +352 -308
- bpy/ops/material/__init__.pyi +24 -12
- bpy/ops/mball/__init__.pyi +72 -75
- bpy/ops/mesh/__init__.pyi +2052 -2088
- bpy/ops/nla/__init__.pyi +369 -313
- bpy/ops/node/__init__.pyi +944 -805
- bpy/ops/object/__init__.pyi +2662 -2461
- bpy/ops/outliner/__init__.pyi +582 -431
- bpy/ops/paint/__init__.pyi +605 -516
- bpy/ops/paintcurve/__init__.pyi +72 -60
- bpy/ops/palette/__init__.pyi +54 -46
- bpy/ops/particle/__init__.pyi +302 -245
- bpy/ops/pose/__init__.pyi +366 -330
- bpy/ops/poselib/__init__.pyi +78 -64
- bpy/ops/preferences/__init__.pyi +361 -341
- bpy/ops/ptcache/__init__.pyi +56 -38
- bpy/ops/render/__init__.pyi +120 -117
- bpy/ops/rigidbody/__init__.pyi +114 -97
- bpy/ops/scene/__init__.pyi +302 -240
- bpy/ops/screen/__init__.pyi +414 -363
- bpy/ops/script/__init__.pyi +20 -18
- bpy/ops/sculpt/__init__.pyi +414 -452
- bpy/ops/sculpt_curves/__init__.pyi +42 -43
- bpy/ops/sequencer/__init__.pyi +1094 -1053
- bpy/ops/sound/__init__.pyi +214 -206
- bpy/ops/spreadsheet/__init__.pyi +34 -28
- bpy/ops/surface/__init__.pyi +108 -114
- bpy/ops/text/__init__.pyi +432 -350
- bpy/ops/text_editor/__init__.pyi +10 -11
- bpy/ops/texture/__init__.pyi +32 -21
- bpy/ops/transform/__init__.pyi +801 -854
- bpy/ops/ui/__init__.pyi +254 -185
- bpy/ops/uilist/__init__.pyi +20 -23
- bpy/ops/uv/__init__.pyi +618 -626
- bpy/ops/view2d/__init__.pyi +162 -161
- bpy/ops/view3d/__init__.pyi +669 -658
- bpy/ops/wm/__init__.pyi +2433 -2415
- bpy/ops/workspace/__init__.pyi +54 -31
- bpy/ops/world/__init__.pyi +8 -4
- bpy/path/__init__.pyi +111 -68
- bpy/props/__init__.pyi +263 -267
- bpy/types/__init__.pyi +86789 -85719
- bpy/utils/__init__.pyi +265 -123
- bpy/utils/previews/__init__.pyi +103 -17
- bpy/utils/units/__init__.pyi +19 -22
- bpy_extras/__init__.pyi +0 -4
- bpy_extras/anim_utils/__init__.pyi +11 -46
- bpy_extras/asset_utils/__init__.pyi +3 -12
- bpy_extras/id_map_utils/__init__.pyi +0 -2
- bpy_extras/image_utils/__init__.pyi +2 -2
- bpy_extras/io_utils/__init__.pyi +30 -27
- bpy_extras/keyconfig_utils/__init__.pyi +4 -1
- bpy_extras/mesh_utils/__init__.pyi +18 -18
- bpy_extras/node_utils/__init__.pyi +4 -3
- bpy_extras/object_utils/__init__.pyi +25 -26
- bpy_extras/view3d_utils/__init__.pyi +33 -38
- bpy_restrict_state/__init__.pyi +14 -1
- bpy_types/__init__.pyi +3873 -997
- console_python/__init__.pyi +41 -7
- console_shell/__init__.pyi +24 -5
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/METADATA +1 -1
- fake_bpy_module-20240326.dist-info/RECORD +343 -0
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/WHEEL +1 -1
- freestyle/chainingiterators/__init__.pyi +50 -52
- freestyle/functions/__init__.pyi +303 -207
- freestyle/predicates/__init__.pyi +299 -115
- freestyle/shaders/__init__.pyi +49 -80
- freestyle/types/__init__.pyi +465 -472
- freestyle/utils/ContextFunctions/__init__.pyi +9 -9
- freestyle/utils/__init__.pyi +28 -18
- gpu/capabilities/__init__.pyi +27 -19
- gpu/matrix/__init__.pyi +14 -16
- gpu/platform/__init__.pyi +5 -5
- gpu/shader/__init__.pyi +2 -5
- gpu/state/__init__.pyi +1 -1
- gpu/texture/__init__.pyi +3 -3
- gpu/types/__init__.pyi +54 -85
- gpu_extras/batch/__init__.pyi +27 -5
- gpu_extras/presets/__init__.pyi +52 -14
- graphviz_export/__init__.pyi +9 -2
- idprop/types/__init__.pyi +36 -12
- imbuf/__init__.pyi +8 -9
- imbuf/types/__init__.pyi +8 -15
- keyingsets_builtins/__init__.pyi +3149 -701
- keyingsets_utils/__init__.pyi +69 -14
- mathutils/__init__.pyi +502 -427
- mathutils/bvhtree/__init__.pyi +28 -32
- mathutils/geometry/__init__.pyi +177 -186
- mathutils/kdtree/__init__.pyi +16 -18
- mathutils/noise/__init__.pyi +47 -48
- nodeitems_builtins/__init__.pyi +50 -10
- nodeitems_utils/__init__.pyi +58 -10
- rna_info/__init__.pyi +230 -26
- rna_keymap_ui/__init__.pyi +29 -6
- rna_prop_ui/__init__.pyi +69 -12
- rna_xml/__init__.pyi +29 -6
- sys_info/__init__.pyi +4 -1
- bpy_extras/bmesh_utils/__init__.pyi +0 -6
- bpy_extras/extensions/__init__.pyi +0 -4
- bpy_extras/extensions/junction_module/__init__.pyi +0 -12
- bpy_extras/node_shader_utils/__init__.pyi +0 -131
- bpy_extras/wm_utils/__init__.pyi +0 -4
- bpy_extras/wm_utils/progress_report/__init__.pyi +0 -29
- fake_bpy_module-20240224.dist-info/RECORD +0 -349
- {fake_bpy_module-20240224.dist-info → fake_bpy_module-20240326.dist-info}/top_level.txt +0 -0
mathutils/geometry/__init__.pyi
CHANGED
|
@@ -4,105 +4,104 @@ import mathutils
|
|
|
4
4
|
GenericType = typing.TypeVar("GenericType")
|
|
5
5
|
|
|
6
6
|
def area_tri(
|
|
7
|
-
v1: typing.Union[
|
|
8
|
-
v2: typing.Union[
|
|
9
|
-
v3: typing.Union[
|
|
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],
|
|
10
10
|
) -> float:
|
|
11
11
|
"""Returns the area size of the 2D or 3D triangle defined.
|
|
12
12
|
|
|
13
13
|
:param v1: Point1
|
|
14
|
-
:type v1: typing.Union[
|
|
14
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
15
15
|
:param v2: Point2
|
|
16
|
-
:type v2: typing.Union[
|
|
16
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
17
17
|
:param v3: Point3
|
|
18
|
-
:type v3: typing.Union[
|
|
18
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
19
19
|
:rtype: float
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
...
|
|
23
23
|
|
|
24
24
|
def barycentric_transform(
|
|
25
|
-
point: typing.Union[
|
|
26
|
-
tri_a1: typing.Union[
|
|
27
|
-
tri_a2: typing.Union[
|
|
28
|
-
tri_a3: typing.Union[
|
|
29
|
-
tri_b1: typing.Union[
|
|
30
|
-
tri_b2: typing.Union[
|
|
31
|
-
tri_b3: typing.Union[
|
|
32
|
-
)
|
|
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
|
+
):
|
|
33
33
|
"""Return a transformed point, the transformation is defined by 2 triangles.
|
|
34
34
|
|
|
35
35
|
:param point: The point to transform.
|
|
36
|
-
:type point: typing.Union[
|
|
36
|
+
:type point: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
37
37
|
:param tri_a1: source triangle vertex.
|
|
38
|
-
:type tri_a1: typing.Union[
|
|
38
|
+
:type tri_a1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
39
39
|
:param tri_a2: source triangle vertex.
|
|
40
|
-
:type tri_a2: typing.Union[
|
|
40
|
+
:type tri_a2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
41
41
|
:param tri_a3: source triangle vertex.
|
|
42
|
-
:type tri_a3: typing.Union[
|
|
42
|
+
:type tri_a3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
43
43
|
:param tri_b1: target triangle vertex.
|
|
44
|
-
:type tri_b1: typing.Union[
|
|
44
|
+
:type tri_b1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
45
45
|
:param tri_b2: target triangle vertex.
|
|
46
|
-
:type tri_b2: typing.Union[
|
|
46
|
+
:type tri_b2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
47
47
|
:param tri_b3: target triangle vertex.
|
|
48
|
-
:type tri_b3: typing.Union[
|
|
49
|
-
:rtype: typing.Any
|
|
48
|
+
:type tri_b3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
50
49
|
:return: The transformed point
|
|
51
50
|
"""
|
|
52
51
|
|
|
53
52
|
...
|
|
54
53
|
|
|
55
|
-
def box_fit_2d(points:
|
|
54
|
+
def box_fit_2d(points: list) -> float:
|
|
56
55
|
"""Returns an angle that best fits the points to an axis aligned rectangle
|
|
57
56
|
|
|
58
57
|
:param points: list of 2d points.
|
|
59
|
-
:type points:
|
|
60
|
-
:rtype: float
|
|
58
|
+
:type points: list
|
|
61
59
|
:return: angle
|
|
60
|
+
:rtype: float
|
|
62
61
|
"""
|
|
63
62
|
|
|
64
63
|
...
|
|
65
64
|
|
|
66
|
-
def box_pack_2d(boxes:
|
|
65
|
+
def box_pack_2d(boxes: list) -> typing.Tuple:
|
|
67
66
|
"""Returns a tuple with the width and height of the packed bounding box.
|
|
68
67
|
|
|
69
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.
|
|
70
|
-
:type boxes:
|
|
71
|
-
:rtype: typing.Tuple
|
|
69
|
+
:type boxes: list
|
|
72
70
|
:return: the width and height of the packed bounding box
|
|
71
|
+
:rtype: typing.Tuple
|
|
73
72
|
"""
|
|
74
73
|
|
|
75
74
|
...
|
|
76
75
|
|
|
77
76
|
def closest_point_on_tri(
|
|
78
|
-
pt: typing.Union[
|
|
79
|
-
tri_p1: typing.Union[
|
|
80
|
-
tri_p2: typing.Union[
|
|
81
|
-
tri_p3: typing.Union[
|
|
82
|
-
) ->
|
|
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:
|
|
83
82
|
"""Takes 4 vectors: one is the point and the next 3 define the triangle.
|
|
84
83
|
|
|
85
84
|
:param pt: Point
|
|
86
|
-
:type pt: typing.Union[
|
|
85
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
87
86
|
:param tri_p1: First point of the triangle
|
|
88
|
-
:type tri_p1: typing.Union[
|
|
87
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
89
88
|
:param tri_p2: Second point of the triangle
|
|
90
|
-
:type tri_p2: typing.Union[
|
|
89
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
91
90
|
:param tri_p3: Third point of the triangle
|
|
92
|
-
:type tri_p3: typing.Union[
|
|
93
|
-
:rtype: 'mathutils.Vector'
|
|
91
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
94
92
|
:return: The closest point of the triangle.
|
|
93
|
+
:rtype: mathutils.Vector
|
|
95
94
|
"""
|
|
96
95
|
|
|
97
96
|
...
|
|
98
97
|
|
|
99
|
-
def convex_hull_2d(points:
|
|
98
|
+
def convex_hull_2d(points: list) -> typing.List[int]:
|
|
100
99
|
"""Returns a list of indices into the list given
|
|
101
100
|
|
|
102
101
|
:param points: list of 2d points.
|
|
103
|
-
:type points:
|
|
104
|
-
:rtype: typing.List[int]
|
|
102
|
+
:type points: list
|
|
105
103
|
:return: a list of indices
|
|
104
|
+
:rtype: typing.List[int]
|
|
106
105
|
"""
|
|
107
106
|
|
|
108
107
|
...
|
|
@@ -139,315 +138,309 @@ def delaunay_2d_cdt(vert_coords, edges, faces, output_type, epsilon, need_ids=Tr
|
|
|
139
138
|
...
|
|
140
139
|
|
|
141
140
|
def distance_point_to_plane(
|
|
142
|
-
pt: typing.Union[
|
|
143
|
-
plane_co: typing.Union[
|
|
144
|
-
plane_no: typing.Union[
|
|
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],
|
|
145
144
|
) -> float:
|
|
146
145
|
"""Returns the signed distance between a point and a plane (negative when below the normal).
|
|
147
146
|
|
|
148
147
|
:param pt: Point
|
|
149
|
-
:type pt: typing.Union[
|
|
148
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
150
149
|
:param plane_co: A point on the plane
|
|
151
|
-
:type plane_co: typing.Union[
|
|
150
|
+
:type plane_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
152
151
|
:param plane_no: The direction the plane is facing
|
|
153
|
-
:type plane_no: typing.Union[
|
|
152
|
+
:type plane_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
154
153
|
:rtype: float
|
|
155
154
|
"""
|
|
156
155
|
|
|
157
156
|
...
|
|
158
157
|
|
|
159
158
|
def interpolate_bezier(
|
|
160
|
-
knot1: typing.Union[
|
|
161
|
-
handle1: typing.Union[
|
|
162
|
-
handle2: typing.Union[
|
|
163
|
-
knot2: typing.Union[
|
|
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],
|
|
164
163
|
resolution: int,
|
|
165
|
-
)
|
|
164
|
+
):
|
|
166
165
|
"""Interpolate a bezier spline segment.
|
|
167
166
|
|
|
168
167
|
:param knot1: First bezier spline point.
|
|
169
|
-
:type knot1: typing.Union[
|
|
168
|
+
:type knot1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
170
169
|
:param handle1: First bezier spline handle.
|
|
171
|
-
:type handle1: typing.Union[
|
|
170
|
+
:type handle1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
172
171
|
:param handle2: Second bezier spline handle.
|
|
173
|
-
:type handle2: typing.Union[
|
|
172
|
+
:type handle2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
174
173
|
:param knot2: Second bezier spline point.
|
|
175
|
-
:type knot2: typing.Union[
|
|
174
|
+
:type knot2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
176
175
|
:param resolution: Number of points to return.
|
|
177
176
|
:type resolution: int
|
|
178
|
-
:rtype: typing.List
|
|
179
177
|
:return: The interpolated points
|
|
180
178
|
"""
|
|
181
179
|
|
|
182
180
|
...
|
|
183
181
|
|
|
184
182
|
def intersect_line_line(
|
|
185
|
-
v1: typing.Union[
|
|
186
|
-
v2: typing.Union[
|
|
187
|
-
v3: typing.Union[
|
|
188
|
-
v4: typing.Union[
|
|
189
|
-
) -> 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]:
|
|
190
188
|
"""Returns a tuple with the points on each line respectively closest to the other.
|
|
191
189
|
|
|
192
190
|
:param v1: First point of the first line
|
|
193
|
-
:type v1: typing.Union[
|
|
191
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
194
192
|
:param v2: Second point of the first line
|
|
195
|
-
:type v2: typing.Union[
|
|
193
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
196
194
|
:param v3: First point of the second line
|
|
197
|
-
:type v3: typing.Union[
|
|
195
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
198
196
|
:param v4: Second point of the second line
|
|
199
|
-
:type v4: typing.Union[
|
|
200
|
-
:rtype: typing.Tuple[
|
|
197
|
+
:type v4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
198
|
+
:rtype: typing.Tuple[mathutils.Vector]
|
|
201
199
|
"""
|
|
202
200
|
|
|
203
201
|
...
|
|
204
202
|
|
|
205
203
|
def intersect_line_line_2d(
|
|
206
|
-
lineA_p1: typing.Union[
|
|
207
|
-
lineA_p2: typing.Union[
|
|
208
|
-
lineB_p1: typing.Union[
|
|
209
|
-
lineB_p2: typing.Union[
|
|
210
|
-
)
|
|
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
|
+
):
|
|
211
209
|
"""Takes 2 segments (defined by 4 vectors) and returns a vector for their point of intersection or None.
|
|
212
210
|
|
|
213
211
|
:param lineA_p1: First point of the first line
|
|
214
|
-
:type lineA_p1: typing.Union[
|
|
212
|
+
:type lineA_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
215
213
|
:param lineA_p2: Second point of the first line
|
|
216
|
-
:type lineA_p2: typing.Union[
|
|
214
|
+
:type lineA_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
217
215
|
:param lineB_p1: First point of the second line
|
|
218
|
-
:type lineB_p1: typing.Union[
|
|
216
|
+
:type lineB_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
219
217
|
:param lineB_p2: Second point of the second line
|
|
220
|
-
:type lineB_p2: typing.Union[
|
|
221
|
-
:rtype: 'mathutils.Vector'
|
|
218
|
+
:type lineB_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
222
219
|
:return: The point of intersection or None when not found
|
|
223
220
|
"""
|
|
224
221
|
|
|
225
222
|
...
|
|
226
223
|
|
|
227
224
|
def intersect_line_plane(
|
|
228
|
-
line_a: typing.Union[
|
|
229
|
-
line_b: typing.Union[
|
|
230
|
-
plane_co: typing.Union[
|
|
231
|
-
plane_no: typing.Union[
|
|
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],
|
|
232
229
|
no_flip=False,
|
|
233
|
-
)
|
|
230
|
+
):
|
|
234
231
|
"""Calculate the intersection between a line (as 2 vectors) and a plane.
|
|
235
232
|
Returns a vector for the intersection or None.
|
|
236
233
|
|
|
237
234
|
:param line_a: First point of the first line
|
|
238
|
-
:type line_a: typing.Union[
|
|
235
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
239
236
|
:param line_b: Second point of the first line
|
|
240
|
-
:type line_b: typing.Union[
|
|
237
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
241
238
|
:param plane_co: A point on the plane
|
|
242
|
-
:type plane_co: typing.Union[
|
|
239
|
+
:type plane_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
243
240
|
:param plane_no: The direction the plane is facing
|
|
244
|
-
:type plane_no: typing.Union[
|
|
245
|
-
:rtype: 'mathutils.Vector'
|
|
241
|
+
:type plane_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
246
242
|
:return: The point of intersection or None when not found
|
|
247
243
|
"""
|
|
248
244
|
|
|
249
245
|
...
|
|
250
246
|
|
|
251
247
|
def intersect_line_sphere(
|
|
252
|
-
line_a: typing.Union[
|
|
253
|
-
line_b: typing.Union[
|
|
254
|
-
sphere_co: typing.Union[
|
|
255
|
-
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,
|
|
256
252
|
clip=True,
|
|
257
|
-
)
|
|
253
|
+
):
|
|
258
254
|
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
259
255
|
returns the intersection
|
|
260
256
|
|
|
261
257
|
:param line_a: First point of the line
|
|
262
|
-
:type line_a: typing.Union[
|
|
258
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
263
259
|
:param line_b: Second point of the line
|
|
264
|
-
:type line_b: typing.Union[
|
|
260
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
265
261
|
:param sphere_co: The center of the sphere
|
|
266
|
-
:type sphere_co: typing.Union[
|
|
262
|
+
:type sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
267
263
|
:param sphere_radius: Radius of the sphere
|
|
268
|
-
:type sphere_radius: typing.Any
|
|
269
|
-
:rtype: typing.Tuple
|
|
270
264
|
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
271
265
|
"""
|
|
272
266
|
|
|
273
267
|
...
|
|
274
268
|
|
|
275
269
|
def intersect_line_sphere_2d(
|
|
276
|
-
line_a: typing.Union[
|
|
277
|
-
line_b: typing.Union[
|
|
278
|
-
sphere_co: typing.Union[
|
|
279
|
-
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,
|
|
280
274
|
clip=True,
|
|
281
|
-
)
|
|
275
|
+
):
|
|
282
276
|
"""Takes a line (as 2 points) and a sphere (as a point and a radius) and
|
|
283
277
|
returns the intersection
|
|
284
278
|
|
|
285
279
|
:param line_a: First point of the line
|
|
286
|
-
:type line_a: typing.Union[
|
|
280
|
+
:type line_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
287
281
|
:param line_b: Second point of the line
|
|
288
|
-
:type line_b: typing.Union[
|
|
282
|
+
:type line_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
289
283
|
:param sphere_co: The center of the sphere
|
|
290
|
-
:type sphere_co: typing.Union[
|
|
284
|
+
:type sphere_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
291
285
|
:param sphere_radius: Radius of the sphere
|
|
292
|
-
:type sphere_radius: typing.Any
|
|
293
|
-
:rtype: typing.Tuple
|
|
294
286
|
:return: The intersection points as a pair of vectors or None when there is no intersection
|
|
295
287
|
"""
|
|
296
288
|
|
|
297
289
|
...
|
|
298
290
|
|
|
299
291
|
def intersect_plane_plane(
|
|
300
|
-
plane_a_co: typing.Union[
|
|
301
|
-
plane_a_no: typing.Union[
|
|
302
|
-
plane_b_co: typing.Union[
|
|
303
|
-
plane_b_no: typing.Union[
|
|
304
|
-
)
|
|
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
|
+
):
|
|
305
297
|
"""Return the intersection between two planes
|
|
306
298
|
|
|
307
299
|
:param plane_a_co: Point on the first plane
|
|
308
|
-
:type plane_a_co: typing.Union[
|
|
300
|
+
:type plane_a_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
309
301
|
:param plane_a_no: Normal of the first plane
|
|
310
|
-
:type plane_a_no: typing.Union[
|
|
302
|
+
:type plane_a_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
311
303
|
:param plane_b_co: Point on the second plane
|
|
312
|
-
:type plane_b_co: typing.Union[
|
|
304
|
+
:type plane_b_co: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
313
305
|
:param plane_b_no: Normal of the second plane
|
|
314
|
-
:type plane_b_no: typing.Union[
|
|
315
|
-
:rtype: typing.Tuple
|
|
306
|
+
:type plane_b_no: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
316
307
|
:return: The line of the intersection represented as a point and a vector
|
|
317
308
|
"""
|
|
318
309
|
|
|
319
310
|
...
|
|
320
311
|
|
|
321
312
|
def intersect_point_line(
|
|
322
|
-
pt: typing.Union[
|
|
323
|
-
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
|
+
],
|
|
324
320
|
line_p2,
|
|
325
|
-
)
|
|
321
|
+
):
|
|
326
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.
|
|
327
323
|
|
|
328
324
|
:param pt: Point
|
|
329
|
-
:type pt: typing.Union[
|
|
330
|
-
:param line_p1:
|
|
331
|
-
:type line_p1: typing.Union[
|
|
332
|
-
:rtype: typing.Union['mathutils.Vector', float]
|
|
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]
|
|
333
328
|
"""
|
|
334
329
|
|
|
335
330
|
...
|
|
336
331
|
|
|
337
332
|
def intersect_point_quad_2d(
|
|
338
|
-
pt: typing.Union[
|
|
339
|
-
quad_p1: typing.Union[
|
|
340
|
-
quad_p2: typing.Union[
|
|
341
|
-
quad_p3: typing.Union[
|
|
342
|
-
quad_p4: typing.Union[
|
|
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],
|
|
343
338
|
) -> int:
|
|
344
339
|
"""Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad,
|
|
345
340
|
only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.
|
|
346
341
|
Works only with convex quads without singular edges.
|
|
347
342
|
|
|
348
343
|
:param pt: Point
|
|
349
|
-
:type pt: typing.Union[
|
|
344
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
350
345
|
:param quad_p1: First point of the quad
|
|
351
|
-
:type quad_p1: typing.Union[
|
|
346
|
+
:type quad_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
352
347
|
:param quad_p2: Second point of the quad
|
|
353
|
-
:type quad_p2: typing.Union[
|
|
348
|
+
:type quad_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
354
349
|
:param quad_p3: Third point of the quad
|
|
355
|
-
:type quad_p3: typing.Union[
|
|
350
|
+
:type quad_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
356
351
|
:param quad_p4: Fourth point of the quad
|
|
357
|
-
:type quad_p4: typing.Union[
|
|
352
|
+
:type quad_p4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
358
353
|
:rtype: int
|
|
359
354
|
"""
|
|
360
355
|
|
|
361
356
|
...
|
|
362
357
|
|
|
363
358
|
def intersect_point_tri(
|
|
364
|
-
pt: typing.Union[
|
|
365
|
-
tri_p1: typing.Union[
|
|
366
|
-
tri_p2: typing.Union[
|
|
367
|
-
tri_p3: typing.Union[
|
|
368
|
-
)
|
|
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
|
+
):
|
|
369
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.
|
|
370
365
|
|
|
371
366
|
:param pt: Point
|
|
372
|
-
:type pt: typing.Union[
|
|
367
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
373
368
|
:param tri_p1: First point of the triangle
|
|
374
|
-
:type tri_p1: typing.Union[
|
|
369
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
375
370
|
:param tri_p2: Second point of the triangle
|
|
376
|
-
:type tri_p2: typing.Union[
|
|
371
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
377
372
|
:param tri_p3: Third point of the triangle
|
|
378
|
-
:type tri_p3: typing.Union[
|
|
379
|
-
:rtype: 'mathutils.Vector'
|
|
373
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
380
374
|
:return: Point on the triangles plane or None if its outside the triangle
|
|
381
375
|
"""
|
|
382
376
|
|
|
383
377
|
...
|
|
384
378
|
|
|
385
379
|
def intersect_point_tri_2d(
|
|
386
|
-
pt: typing.Union[
|
|
387
|
-
tri_p1: typing.Union[
|
|
388
|
-
tri_p2: typing.Union[
|
|
389
|
-
tri_p3: typing.Union[
|
|
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],
|
|
390
384
|
) -> int:
|
|
391
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.
|
|
392
386
|
|
|
393
387
|
:param pt: Point
|
|
394
|
-
:type pt: typing.Union[
|
|
388
|
+
:type pt: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
395
389
|
:param tri_p1: First point of the triangle
|
|
396
|
-
:type tri_p1: typing.Union[
|
|
390
|
+
:type tri_p1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
397
391
|
:param tri_p2: Second point of the triangle
|
|
398
|
-
:type tri_p2: typing.Union[
|
|
392
|
+
:type tri_p2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
399
393
|
:param tri_p3: Third point of the triangle
|
|
400
|
-
:type tri_p3: typing.Union[
|
|
394
|
+
:type tri_p3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
401
395
|
:rtype: int
|
|
402
396
|
"""
|
|
403
397
|
|
|
404
398
|
...
|
|
405
399
|
|
|
406
400
|
def intersect_ray_tri(
|
|
407
|
-
v1: typing.Union[
|
|
408
|
-
v2: typing.Union[
|
|
409
|
-
v3: typing.Union[
|
|
410
|
-
ray: typing.Union[
|
|
411
|
-
orig: typing.Union[
|
|
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],
|
|
412
406
|
clip: bool = True,
|
|
413
|
-
)
|
|
407
|
+
):
|
|
414
408
|
"""Returns the intersection between a ray and a triangle, if possible, returns None otherwise.
|
|
415
409
|
|
|
416
410
|
:param v1: Point1
|
|
417
|
-
:type v1: typing.Union[
|
|
411
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
418
412
|
:param v2: Point2
|
|
419
|
-
:type v2: typing.Union[
|
|
413
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
420
414
|
:param v3: Point3
|
|
421
|
-
:type v3: typing.Union[
|
|
415
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
422
416
|
:param ray: Direction of the projection
|
|
423
|
-
:type ray: typing.Union[
|
|
417
|
+
:type ray: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
424
418
|
:param orig: Origin
|
|
425
|
-
:type orig: typing.Union[
|
|
419
|
+
:type orig: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
426
420
|
:param clip: When False, don't restrict the intersection to the area of the triangle, use the infinite plane defined by the triangle.
|
|
427
421
|
:type clip: bool
|
|
428
|
-
:rtype: 'mathutils.Vector'
|
|
429
422
|
:return: The point of intersection or None if no intersection is found
|
|
430
423
|
"""
|
|
431
424
|
|
|
432
425
|
...
|
|
433
426
|
|
|
434
427
|
def intersect_sphere_sphere_2d(
|
|
435
|
-
p_a: typing.Union[
|
|
428
|
+
p_a: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
436
429
|
radius_a: float,
|
|
437
|
-
p_b: typing.Union[
|
|
430
|
+
p_b: typing.Union[typing.Sequence[float], mathutils.Vector],
|
|
438
431
|
radius_b: float,
|
|
439
|
-
) -> typing.Tuple[
|
|
432
|
+
) -> typing.Tuple[mathutils.Vector]:
|
|
440
433
|
"""Returns 2 points on between intersecting circles.
|
|
441
434
|
|
|
442
435
|
:param p_a: Center of the first circle
|
|
443
|
-
:type p_a: typing.Union[
|
|
436
|
+
:type p_a: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
444
437
|
:param radius_a: Radius of the first circle
|
|
445
438
|
:type radius_a: float
|
|
446
439
|
:param p_b: Center of the second circle
|
|
447
|
-
:type p_b: typing.Union[
|
|
440
|
+
:type p_b: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
448
441
|
:param radius_b: Radius of the second circle
|
|
449
442
|
:type radius_b: float
|
|
450
|
-
:rtype: typing.Tuple[
|
|
443
|
+
:rtype: typing.Tuple[mathutils.Vector]
|
|
451
444
|
"""
|
|
452
445
|
|
|
453
446
|
...
|
|
@@ -460,52 +453,50 @@ def intersect_tri_tri_2d(tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3) -> bool
|
|
|
460
453
|
|
|
461
454
|
...
|
|
462
455
|
|
|
463
|
-
def normal(vectors
|
|
456
|
+
def normal(vectors) -> mathutils.Vector:
|
|
464
457
|
"""Returns the normal of a 3D polygon.
|
|
465
458
|
|
|
466
459
|
:param vectors: Vectors to calculate normals with
|
|
467
|
-
:
|
|
468
|
-
:rtype: 'mathutils.Vector'
|
|
460
|
+
:rtype: mathutils.Vector
|
|
469
461
|
"""
|
|
470
462
|
|
|
471
463
|
...
|
|
472
464
|
|
|
473
|
-
def points_in_planes(planes: typing.List[
|
|
465
|
+
def points_in_planes(planes: typing.List[mathutils.Vector]):
|
|
474
466
|
"""Returns a list of points inside all planes given and a list of index values for the planes used.
|
|
475
467
|
|
|
476
468
|
:param planes: List of planes (4D vectors).
|
|
477
|
-
:type planes: typing.List[
|
|
478
|
-
:rtype: typing.Any
|
|
469
|
+
:type planes: typing.List[mathutils.Vector]
|
|
479
470
|
:return: two lists, once containing the vertices inside the planes, another containing the plane indices used
|
|
480
471
|
"""
|
|
481
472
|
|
|
482
473
|
...
|
|
483
474
|
|
|
484
|
-
def tessellate_polygon(veclist_list) ->
|
|
475
|
+
def tessellate_polygon(veclist_list) -> list:
|
|
485
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).
|
|
486
477
|
|
|
487
478
|
:param veclist_list: list of polylines
|
|
488
|
-
:rtype:
|
|
479
|
+
:rtype: list
|
|
489
480
|
"""
|
|
490
481
|
|
|
491
482
|
...
|
|
492
483
|
|
|
493
484
|
def volume_tetrahedron(
|
|
494
|
-
v1: typing.Union[
|
|
495
|
-
v2: typing.Union[
|
|
496
|
-
v3: typing.Union[
|
|
497
|
-
v4: typing.Union[
|
|
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],
|
|
498
489
|
) -> float:
|
|
499
490
|
"""Return the volume formed by a tetrahedron (points can be in any order).
|
|
500
491
|
|
|
501
492
|
:param v1: Point1
|
|
502
|
-
:type v1: typing.Union[
|
|
493
|
+
:type v1: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
503
494
|
:param v2: Point2
|
|
504
|
-
:type v2: typing.Union[
|
|
495
|
+
:type v2: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
505
496
|
:param v3: Point3
|
|
506
|
-
:type v3: typing.Union[
|
|
497
|
+
:type v3: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
507
498
|
:param v4: Point4
|
|
508
|
-
:type v4: typing.Union[
|
|
499
|
+
:type v4: typing.Union[typing.Sequence[float], mathutils.Vector]
|
|
509
500
|
:rtype: float
|
|
510
501
|
"""
|
|
511
502
|
|