File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1987,6 +1987,23 @@ def find_curve_knots( cu ):
19871987 print ('knotoid:' )
19881988 print (info )
19891989
1990+ def calc_gauss_code ( cu ):
1991+ assert len (cu .data .splines )== 1
1992+ points = []
1993+ for pnt in cu .data .splines [0 ].bezier_points :
1994+ x ,y ,z = pnt .handle_left
1995+ points .append ([x ,y ,z ])
1996+ x ,y ,z = pnt .co
1997+ points .append ([x ,y ,z ])
1998+ x ,y ,z = pnt .handle_right
1999+ points .append ([x ,y ,z ])
2000+
2001+ k = knotid .sp .SpaceCurve ( points )
2002+ print (k )
2003+ g = k .gauss_code (recalculate = True , try_cython = False )
2004+ print ('guass code:' , g )
2005+ return g
2006+
19902007
19912008if __name__ == '__main__' :
19922009 args = []
@@ -2459,6 +2476,8 @@ def find_curve_knots( cu ):
24592476 #knots = knotoid.calc_knotoid( ktrace )
24602477 knots = find_curve_knots ( trace_cu )
24612478 print (knots )
2479+ if knotid :
2480+ gauss = calc_gauss_code ( trace_cu )
24622481
24632482 #bpy.ops.wm.save_as_mainfile(filepath=tmp, check_existing=False)
24642483 if matplotlib and GLOBALS ['plot' ]:
You can’t perform that action at this time.
0 commit comments