<commit_before>try:
    from . import generic as g
except BaseException:
    import generic as g


class CreationTest(g.unittest.TestCase):

    def setUp(self):
        # we support two interfaces to triangle:
        # pip install meshpy
        # pip install triangle
        engines = []
        try:
            import meshpy  # NOQA
            engines.append('meshpy')
        except ImportError:
            g.log.error("no meshpy: skipping")

        try:
            from triangle import triangulate  # NOQA
            engines.append('triangle')
        except ImportError:
            g.log.error('no triangle: skipping')

        self.engines = engines

    def test_cylinder(self):
        # tolerance for cylinders
        atol = 0.03

        c = g.trimesh.creation.cylinder()
        assert c.is_volume
        assert c.body_count == 1

        c = g.trimesh.creation.cylinder(radius=0.5, height=1.0)
        assert c.is_volume
        assert c.body_count == 1
        assert g.np.allclose(c.extents, 1.0, atol=atol)

        # check the "use a segment" feature
        # passed height should be overridden
        radius = 0.75
        offset = 10.0
        c = g.trimesh.creation.cylinder(
            radius=radius,
            height=200,<commit_msg>Add cone creation test<commit_after>try:
    from . import generic as g
except BaseException:
    import generic as g


class CreationTest(g.unittest.TestCase):

    def setUp(self):
        # we support two interfaces to triangle:
        # pip install meshpy
        # pip install triangle
        engines = []
        try:
            import meshpy  # NOQA
            engines.append('meshpy')
        except ImportError:
            g.log.error("no meshpy: skipping")

        try:
            from triangle import triangulate  # NOQA
            engines.append('triangle')
        except ImportError:
            g.log.error('no triangle: skipping')

        self.engines = engines

    def test_cone(self):
        # tolerance for cone
        atol = 0.03

        c = g.trimesh.creation.cone()
        assert c.is_volume
        assert c.body_count == 1

        c = g.trimesh.creation.cone(radius=0.5, height=1.0)
        assert c.is_volume
        assert c.body_count == 1
        assert g.np.allclose(c.extents, 1.0, atol=atol)

    def test_cylinder(self):
        # tolerance for cylinders
        atol = 0.03

        c = g.trimesh.creation.cylinder()
        assert c.is_volume
        assert c.body_count == 1

        c = g.trimesh.creation.cylinder(radius=0.5, height=1.0)
        assert c.is_volume
        assert c.body_count == 1
        assert g.np.allclose(c.extents, 1.0, atol=atol)

        # check the "use a segment" feature
        # passed height should be overridden
        radius = 0.75
        offset = 10.0
        c = g.trimesh.creation.cylinder(
            radius=radius,
            height=200,
{'fraction_non_alphanumeric': 0.08959338387319091, 'fraction_numerical': 0.01757408683666437, 'mean_word_length': 1.7806513409961686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4974704', 'n_tokens_mistral': 931, 'n_tokens_neox': 857, 'n_words': 224}