<commit_before>"""Model classes for 3D density distribution."""

__author__  = "<NAME>, <NAME>"
__version__ = "2016-10-10"

# imports
from rhocube import Cube
import numpy as N


def spiral3D(h,Rbase,nturns,rtube,envelope='dualcone'):

        """Function to compute a helical parametric curve along the outline of
        a dual cone or a cylinder.
        """
        
        a = nturns * 2*N.pi/h
        delta = rtube/3.
        th = a*h # / (2*N.pi)
        nsteps = int(th/N.float(delta))
        t = N.linspace(-th,th,2*nsteps+1)
        z = t/a

        if envelope == 'dualcone':
            zprogression = z*(Rbase/h)
        elif envelope == 'cylinder':
            zprogression = Rbase/h
        else:
            raise Exception, "Invalid value for 'envelope'. Must be either of: ['dualcone','cylinder']."
        
        x = zprogression * N.cos(N.abs(t))
        y = zprogression * N.sin(N.abs(t))

        return x, y, z<commit_msg>Fixed small bug in Helix3D cylinder mode.<commit_after>"""Model classes for 3D density distribution."""

__author__  = "<NAME>, <NAME>"
__version__ = "2016-10-11"

# imports
from rhocube import Cube
import numpy as N


def spiral3D(h,Rbase,nturns,rtube,envelope='dualcone'):

        """Function to compute a helical parametric curve along the outline of
        a dual cone or a cylinder.
        """
        
        a = nturns * 2*N.pi/h
        delta = rtube/3.
        th = a*h # / (2*N.pi)
        nsteps = int(th/N.float(delta))
        t = N.linspace(-th,th,2*nsteps+1)
        z = t/a

        if envelope == 'dualcone':
            zprogression = z*(Rbase/h)
        elif envelope == 'cylinder':
            zprogression = Rbase
        else:
            raise Exception, "Invalid value for 'envelope'. Must be either of: ['dualcone','cylinder']."
        
        x = zprogression * N.cos(N.abs(t))
        y = zprogression * N.sin(N.abs(t))

        return x, y, z
{'fraction_non_alphanumeric': 0.1308411214953271, 'fraction_numerical': 0.016095534787123573, 'mean_word_length': 2.073365231259968, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752148', 'n_tokens_mistral': 677, 'n_tokens_neox': 631, 'n_words': 175}