add testing scripts
This commit is contained in:
parent
6160b99c93
commit
bb0a5a4a2c
2 changed files with 140 additions and 0 deletions
25
testing_scripts/bezier_distance.py
Normal file
25
testing_scripts/bezier_distance.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import bpy
|
||||
from mathutils import *
|
||||
from math import *
|
||||
import abc3d.butils
|
||||
|
||||
v = 0
|
||||
goal = 5.0
|
||||
step = 0.1
|
||||
speed = 1.0
|
||||
|
||||
C = bpy.context
|
||||
obj = C.scene.objects['Cube']
|
||||
curve = C.scene.objects['BézierCurve']
|
||||
|
||||
m = curve.matrix
|
||||
|
||||
def fun(distance):
|
||||
obj.location = m @ abc3d.butils.calc_point_on_bezier_curve(curve,
|
||||
distance,
|
||||
output_tangent=True)
|
||||
print(f"executed {distance}")
|
||||
|
||||
while v < goal:
|
||||
bpy.app.timers.register(lambda: fun(v), first_interval=(v * speed))
|
||||
v += step
|
Loading…
Add table
Add a link
Reference in a new issue