def tangentCurve(baseCurves, tangent, point=(0.0, 0.0, 0.0), prec=2): """ :param baseCurves: list of Curves :param tangent: tangent to compare against :param point: point for tangent :param prec: number of digits to compare :return: list of curves """ curves = [] for curve in baseCurves: surfaceTangent = curve.tangent(point) if _functions.roundTuple(surfaceTangent, prec) == _functions.roundTuple(tangent, prec): curves.append(curve) return curves
def findSurfaceWithNormal(surfaces, normal, prec=2): """ Find the plain surfaces with the specified normal and return the list :param surfaces: list of surfaces :param normal: the normal in vector/list format :param prec: number of digits, the normals are compared to :return: list of surfaces """ tmpSurfaces = [] for surface in surfaces: # sort out cylinders if surface.is_cylindrical(): continue # test for normal surfaceNormal = surface.normal_at([0, 0, 0]) if _functions.roundTuple(surfaceNormal, prec) == _functions.roundTuple(normal, prec): tmpSurfaces.append(surface) return tmpSurfaces