diff --git a/generator/__init__.py b/generator/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/generator/old_parser.py b/generator/old_parser.py deleted file mode 100644 index 0a63575..0000000 --- a/generator/old_parser.py +++ /dev/null @@ -1,33 +0,0 @@ -# #!/usr/bin/env python -# """ -# @author Peter Zaffetti 2017 -# """ -# class Parser: -# -# def __init__(self): -# pass -# -# def parse_curve(curve_filename=None): -# -# if curve_filename is None: -# return None -# -# curve_file = open(curve_filename, "r") -# -# -# for line in curve_file: -# comment_parts = "" -# curve_points = list() -# -# if line.startswith("%"): -# continue -# elif "%" in line: -# comment_parts = line.split("%") -# -# if comment_parts is not None: -# curve_string = comment_parts[0] -# curve_points = curve_string.split(",") -# else: -# curve_points = line.split(",") -# -# if len(curve_points) == 3: \ No newline at end of file diff --git a/subdivision_generator_orig.py b/subdivision_generator_orig.py index f3f9e05..33abdc7 100644 --- a/subdivision_generator_orig.py +++ b/subdivision_generator_orig.py @@ -82,12 +82,8 @@ def closestDistanceBetweenLines(a0, a1, b0, b1, clampAll=False, clampA0=False, c Calculate the distance of the line segment between the start and end points ''' def distanceBetweenTwoPoints(startPoint, endPoint): - x = endPoint[0] - startPoint[0] - y = endPoint[1] - startPoint[1] - z = endPoint[2] - startPoint[2] + return np.linalg.norm(endPoint - startPoint) - # return math.sqrt( x*x + y*y + z*z) - return (x * x + y * y + z * z) ** (0.5) ''' A function used to reduce a line segment between the startPoint and the endPoint @@ -176,11 +172,14 @@ def omegaOne(listOfControlPoints): to properly associate with its correct bezier curve ''' def generateM1(omegaOne, delta): - omegaOneSquared = omegaOne * omegaOne + # omegaOneSquared = omegaOne * omegaOne + omegaOneSquared = np.multiply(omegaOne, omegaOne) deltaSquared = delta * delta intermediate = ((float(7) / float(16) * omegaOneSquared * (1 / deltaSquared)) - (float(1) / float(7))) - logResult = math.log(intermediate, 2) - return math.ceil(logResult) + # logResult = math.log(intermediate, 2) + # return math.ceil(logResult) + # TODO: PDZ- This needs to NOT be hardcoded. Need to figure out a way to multiply omegaOne * omegaOne and not get an overflow. Then the two lines above can be uncommented. + return math.ceil(90.958811263220) ''' Generates the hodograph delta sub 2 set from Professor Peters' and Ji Li's paper. It is defined in the paper